1919/// }
2020/// ```
2121mod native;
22+ pub mod types;
2223
2324#[ cfg( feature = "std" ) ]
2425use std:: vec:: Vec ;
2526
27+ use types:: * ;
28+
2629#[ cfg( feature = "std" ) ]
2730fn unsafe_alloc_buffer ( len : usize ) -> Vec < u8 > {
2831 let mut ret: Vec < u8 > = Vec :: with_capacity ( len) ;
@@ -32,51 +35,6 @@ fn unsafe_alloc_buffer(len: usize) -> Vec<u8> {
3235 ret
3336}
3437
35- /// A little-endian unsigned 128-bit integer.
36- #[ derive( Default , Copy , Clone ) ]
37- pub struct Uint128 {
38- pub bytes : [ u8 ; 16 ] ,
39- }
40-
41- /// A little-endian unsigned 256-bit integer.
42- #[ derive( Default , Copy , Clone ) ]
43- pub struct Uint256 {
44- pub bytes : [ u8 ; 32 ] ,
45- }
46-
47- /// An array of 160 bits.
48- #[ derive( Default , Copy , Clone ) ]
49- pub struct Bytes20 {
50- pub bytes : [ u8 ; 20 ] ,
51- }
52-
53- /// An array of 256 bits.
54- #[ derive( Default , Copy , Clone ) ]
55- pub struct Bytes32 {
56- pub bytes : [ u8 ; 32 ] ,
57- }
58-
59- /// Type representing a value in wei.
60- pub type EtherValue = Uint128 ;
61-
62- /// Type representing an address.
63- pub type Address = Bytes20 ;
64-
65- /// Type representing a storage key.
66- pub type StorageKey = Bytes32 ;
67-
68- /// Type representing a storage value.
69- pub type StorageValue = Bytes32 ;
70-
71- /// Type representing a log topic.
72- pub type Topic = Bytes32 ;
73-
74- /// Type representing a Keccak-256 or SHA-256 hash.
75- pub type Hash = Bytes32 ;
76-
77- /// Type representing a block's difficulty.
78- pub type Difficulty = Uint256 ;
79-
8038/// Enum representing an error code for EEI calls. Currently used by `codeCopy`, `callDataCopy`,
8139/// `externalCodeCopy`, and `returnDataCopy`.
8240pub enum Error {
0 commit comments