Skip to content

Commit 8914936

Browse files
committed
f
1 parent e1b3713 commit 8914936

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

bindings/rust/evmc-vm/src/lib.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,7 @@ pub use evmc_sys as ffi;
55
// TODO: Add convenient helpers for evmc_execute
66
// TODO: Add a derive macro here for creating evmc_create
77

8-
/// EVMC message (call) kind.
9-
pub type MessageKind = ffi::evmc_call_kind;
10-
11-
/// EVMC message (call) flags.
12-
pub type MessageFlags = ffi::evmc_flags;
13-
14-
/// EVMC status code.
15-
pub type StatusCode = ffi::evmc_status_code;
16-
17-
/// EVMC storage status.
18-
pub type StorageStatus = ffi::evmc_storage_status;
19-
20-
/// EVMC VM revision.
21-
pub type Revision = ffi::evmc_revision;
8+
pub mod types;
229

2310
/// EVMC result structure.
2411
pub struct ExecutionResult {

bindings/rust/evmc-vm/src/types.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use evmc_sys as ffi;
2+
3+
/// EVMC message (call) kind.
4+
pub type MessageKind = ffi::evmc_call_kind;
5+
6+
/// EVMC message (call) flags.
7+
pub type MessageFlags = ffi::evmc_flags;
8+
9+
/// EVMC status code.
10+
pub type StatusCode = ffi::evmc_status_code;
11+
12+
/// EVMC storage status.
13+
pub type StorageStatus = ffi::evmc_storage_status;
14+
15+
/// EVMC VM revision.
16+
pub type Revision = ffi::evmc_revision;
17+
18+
#[cfg(test)]
19+
mod tests {
20+
use super::*;
21+
22+
#[test]
23+
fn message_kind() {
24+
// assert_eq!(MessageKind::EVMC_CALL, ffi::evmc_call_kind::EVMC_CALL);
25+
// assert_eq!(MessageKind::EVMC_CREATE, ffi::evmc_call_kind::EVMC_CREATE);
26+
let x = MessageKind::EVMC_ISTANBUL;
27+
// assert_eq!(Revision::EVMC_ISTANBUL, ffi::evmc_revision::EVMC_ISTANBUL);
28+
}
29+
}

0 commit comments

Comments
 (0)