Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Sep 9, 2024
1 parent 08be0c4 commit 8d4f258
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub enum SnTrieError {

#[error("Invalid transaction index")]
InvalidTxIndex,

#[error("Invalid commit")]
InvalidCommitment,
}

#[derive(Error, Debug)]
Expand Down
1 change: 0 additions & 1 deletion src/starknet/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ impl GatewayProvider {

if response.status().is_success() {
let block_data: Value = response.json().await.unwrap();
println!("block_data: {}", block_data);
let block_data: &Value = &block_data["transaction_commitment"];
Ok(block_data.to_string())
} else {
Expand Down
10 changes: 3 additions & 7 deletions src/starknet/tx_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,9 @@ impl<'a> TxsMptHandler<'a> {
}

let (root, root_idx) = tree.commit().unwrap();
println!("expected root: {:?}", expected_commit);
println!("root: {:?}", expected_commit);

// assert_eq!(
// root,
// Felt::from_bytes_be_slice(hex::decode(expected_commit).unwrap().as_slice())
// );
// TODO: Slightly root value is different huh
println!("root: {:?}", root);
println!("expected_commit: {:?}", expected_commit);

let result_mpt = TxsMpt {
trie: tree,
Expand Down

0 comments on commit 8d4f258

Please sign in to comment.