-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(advance-runner): get on-chain machine hash
- Loading branch information
Showing
12 changed files
with
3,726 additions
and
1 deletion.
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
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,38 @@ | ||
use crate::snapshot::SnapshotManager; | ||
use rollups_events::Address; | ||
use snafu::Snafu; | ||
|
||
#[derive(Debug, Snafu)] | ||
#[allow(clippy::enum_variant_names)] | ||
pub enum TemplateHashError { | ||
#[snafu(display("off-chain hash does not match on-chain hash"))] | ||
MismatchError, | ||
} | ||
|
||
pub struct TemplateHashChecker<'a, Snap> { | ||
provider_http_endpoint: String, | ||
dapp_address: Address, | ||
snapshot_manager: &'a Snap, | ||
} | ||
|
||
impl<'a, Snap: SnapshotManager + std::fmt::Debug + 'static> | ||
TemplateHashChecker<'a, Snap> | ||
{ | ||
pub fn new( | ||
provider_http_endpoint: String, | ||
dapp_address: Address, | ||
snapshot_manager: &'a Snap, | ||
) -> Self { | ||
Self { | ||
provider_http_endpoint, | ||
dapp_address, | ||
snapshot_manager, | ||
} | ||
} | ||
|
||
pub async fn validate_template_hash( | ||
&self, | ||
) -> Result<bool, TemplateHashError> { | ||
todo!() | ||
} | ||
} |
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
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.