Created
May 16, 2019 14:02
-
-
Save brenzi/936ceab317e350507ae4cb7d6ec4434f to your computer and use it in GitHub Desktop.
raw Externalities HashMap write
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
pub type SgxExternalities = HashMap<Vec<u8>, Vec<u8>>; | |
... | |
let mut ext = SgxExternalities::new(); | |
... | |
//custom struct | |
let key = runtime_io::twox_128("Contract Schedule".to_vec()); | |
let value = Schedule::<Gas>::default().encode() | |
ext.insert(key.to_vec(), value) | |
... | |
// primitive Type | |
let key = runtime_io::twox_128("Contract BlockGasLimit".to_vec()); | |
let value = 10_000_000u64.encode() | |
ext.insert(key.to_vec(), value) |
Author
brenzi
commented
May 16, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment