Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jun 4, 2019
1 parent bccecd6 commit 75cde21
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
15 changes: 1 addition & 14 deletions bindings/rust/evmc-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,7 @@ pub trait EvmcVm {
fn execute(&self, code: &[u8], context: &ExecutionContext) -> ExecutionResult;
}

/// 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 {
Expand Down
29 changes: 29 additions & 0 deletions bindings/rust/evmc-vm/src/types.rs
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 75cde21

Please sign in to comment.