-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init code for omni-executor offchain worker
- Loading branch information
1 parent
302f865
commit 8a65e5a
Showing
39 changed files
with
11,430 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; | ||
use scale_info::TypeInfo; | ||
use sp_core::H160; | ||
use sp_runtime::{traits::ConstU32, BoundedVec}; | ||
|
||
pub const CALL_ETHEREUM_INPUT_LEN: u32 = 10 * 1024; | ||
|
||
#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] | ||
pub enum Intention { | ||
#[codec(index = 0)] | ||
TransferEthereum(TransferEthereum), | ||
#[codec(index = 1)] | ||
CallEthereum(CallEthereum), | ||
} | ||
|
||
#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] | ||
pub struct TransferEthereum { | ||
pub to: H160, | ||
pub value: [u8; 32], | ||
} | ||
|
||
pub type CallEthereumInputLen = ConstU32<CALL_ETHEREUM_INPUT_LEN>; | ||
|
||
#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] | ||
pub struct CallEthereum { | ||
pub address: H160, | ||
pub input: BoundedVec<u8, CallEthereumInputLen>, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
debug/ | ||
target/ | ||
.idea/ | ||
**/*.bin | ||
|
||
cache | ||
|
Oops, something went wrong.