-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
heavy refactor, cleanup and documentation
- Loading branch information
Showing
25 changed files
with
686 additions
and
546 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#[cfg(not(feature = "sp1"))] | ||
use tiny_keccak::{Hasher, Keccak}; | ||
#[cfg(feature = "sp1")] | ||
use tiny_keccak_sp1::{Hasher, Keccak}; | ||
|
||
pub fn digest_keccak(bytes: &[u8]) -> [u8; 32] { | ||
let mut hasher = Keccak::v256(); | ||
let mut output = [0u8; 32]; | ||
|
||
hasher.update(bytes); | ||
hasher.finalize(&mut output); | ||
|
||
output | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct MerkleProofInput { | ||
pub proof: Vec<Vec<u8>>, | ||
pub root_hash: Vec<u8>, | ||
pub key: Vec<u8>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct MerkleProofListInput { | ||
pub account_proof: Vec<Vec<u8>>, | ||
pub storage_proofs: Vec<Vec<Vec<u8>>>, | ||
pub root_hash: Vec<u8>, | ||
pub account_key: Vec<u8>, | ||
pub storage_keys: Vec<Vec<u8>>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.