Skip to content
8 changes: 0 additions & 8 deletions Cargo.toml

This file was deleted.

4 changes: 2 additions & 2 deletions bindings/rust/evmc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the Apache License, Version 2.0.

[package]
name = "evmc-sys"
name = "ssvm-evmc-sys"
version = "7.4.0"
authors = ["Alex Beregszaszi <alex@rtfs.hu>"]
license = "Apache-2.0"
repository = "https://github.com/ethereum/evmc"
repository = "https://github.com/secondstate/evmc"
description = "Bindings to EVMC (low-level)"
categories = ["external-ffi-bindings"]
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/evmc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn gen_bindings() {
.derive_hash(true)
// force deriving the PratialEq trait on basic types (address, bytes32)
.derive_partialeq(true)
.opaque_type("evmc_host_context")
.blacklist_type("evmc_host_context")
.whitelist_type("evmc_.*")
.whitelist_function("evmc_.*")
.whitelist_var("EVMC_ABI_VERSION")
Expand Down
6 changes: 6 additions & 0 deletions bindings/rust/evmc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

// Defining evmc_host_context here, because bindgen cannot create a useful declaration yet.

pub type evmc_host_context = ::std::os::raw::c_void;

//pub struct evmc_host_context { }

// TODO: add `.derive_default(true)` to bindgen instead?

impl Default for evmc_address {
Expand Down
6 changes: 3 additions & 3 deletions bindings/rust/evmc-vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Licensed under the Apache License, Version 2.0.

[package]
name = "evmc-vm"
name = "ssvm-evmc-vm"
version = "7.4.0"
authors = ["Alex Beregszaszi <alex@rtfs.hu>", "Jake Lang <jak3lang@gmail.com>"]
license = "Apache-2.0"
repository = "https://github.com/ethereum/evmc"
repository = "https://github.com/secondstate/evmc"
description = "Bindings to EVMC (VM specific)"
edition = "2018"

[dependencies]
evmc-sys = { path = "../evmc-sys", version = "7.4.0" }
evmc-sys = { version = "7.4.0", package = "ssvm-evmc-sys" }
19 changes: 19 additions & 0 deletions bindings/rust/evmc-vm/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub type MessageKind = ffi::evmc_call_kind;
/// EVMC message (call) flags.
pub type MessageFlags = ffi::evmc_flags;

/// EVMC VM capabilities.
pub type Capabilities = ffi::evmc_capabilities;

/// EVMC status code.
pub type StatusCode = ffi::evmc_status_code;

Expand Down Expand Up @@ -69,6 +72,22 @@ mod tests {
assert_eq!(MessageFlags::EVMC_STATIC, ffi::evmc_flags::EVMC_STATIC);
}

#[test]
fn capabilities() {
assert_eq!(
Capabilities::EVMC_CAPABILITY_EVM1,
ffi::evmc_capabilities::EVMC_CAPABILITY_EVM1
);
assert_eq!(
Capabilities::EVMC_CAPABILITY_EWASM,
ffi::evmc_capabilities::EVMC_CAPABILITY_EWASM
);
assert_eq!(
Capabilities::EVMC_CAPABILITY_PRECOMPILES,
ffi::evmc_capabilities::EVMC_CAPABILITY_PRECOMPILES
);
}

#[test]
fn status_code() {
assert_eq!(
Expand Down