This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
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,27 @@ | ||
//! Contains ismp primitives for contract support | ||
use alloc::vec::Vec; | ||
use codec::{Decode, Encode}; | ||
|
||
/// A return type that indicates the gas consumed by the contract executor | ||
#[derive(PartialEq, Eq, Debug)] | ||
pub struct Gas { | ||
/// Gas consumed when executing the contract call | ||
pub gas_used: Option<u64>, | ||
/// Gas limit passed to the contract executor | ||
pub gas_limit: Option<u64>, | ||
} | ||
|
||
impl From<()> for Gas { | ||
fn from(_: ()) -> Self { | ||
Self { gas_used: None, gas_limit: None } | ||
} | ||
} | ||
|
||
/// The contract data to provide additional metadata for the contract executor | ||
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)] | ||
pub struct ContractData { | ||
/// Opaque bytes that would be decoded by the contract | ||
pub data: Vec<u8>, | ||
/// The gas limit the executor should use when executing the contract call | ||
pub gas_limit: u64, | ||
} |
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
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