diff --git a/bindings/rust/evmc-vm/src/lib.rs b/bindings/rust/evmc-vm/src/lib.rs index fffd783bb..5dcd2d3d4 100644 --- a/bindings/rust/evmc-vm/src/lib.rs +++ b/bindings/rust/evmc-vm/src/lib.rs @@ -5,20 +5,7 @@ pub use evmc_sys as ffi; // TODO: Add convenient helpers for evmc_execute // TODO: Add a derive macro here for creating evmc_create -/// EVMC message (call) kind. -pub type MessageKind = ffi::evmc_call_kind; - -/// EVMC message (call) flags. -pub type MessageFlags = ffi::evmc_flags; - -/// EVMC status code. -pub type StatusCode = ffi::evmc_status_code; - -/// EVMC storage status. -pub type StorageStatus = ffi::evmc_storage_status; - -/// EVMC VM revision. -pub type Revision = ffi::evmc_revision; +pub mod types; /// EVMC result structure. pub struct ExecutionResult { diff --git a/bindings/rust/evmc-vm/src/types.rs b/bindings/rust/evmc-vm/src/types.rs new file mode 100644 index 000000000..69b67f3d9 --- /dev/null +++ b/bindings/rust/evmc-vm/src/types.rs @@ -0,0 +1,29 @@ +use evmc_sys as ffi; + +/// EVMC message (call) kind. +pub type MessageKind = ffi::evmc_call_kind; + +/// EVMC message (call) flags. +pub type MessageFlags = ffi::evmc_flags; + +/// EVMC status code. +pub type StatusCode = ffi::evmc_status_code; + +/// EVMC storage status. +pub type StorageStatus = ffi::evmc_storage_status; + +/// EVMC VM revision. +pub type Revision = ffi::evmc_revision; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn message_kind() { + // assert_eq!(MessageKind::EVMC_CALL, ffi::evmc_call_kind::EVMC_CALL); + // assert_eq!(MessageKind::EVMC_CREATE, ffi::evmc_call_kind::EVMC_CREATE); + let x = MessageKind::EVMC_ISTANBUL; + // assert_eq!(Revision::EVMC_ISTANBUL, ffi::evmc_revision::EVMC_ISTANBUL); + } +}