Skip to content

Commit

Permalink
license: consistent with official used
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainVincent committed Jun 26, 2020
1 parent 2686ba5 commit b87db19
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 727 deletions.
4 changes: 2 additions & 2 deletions bindings/rust/evmc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

[package]
name = "evmc-client"
version = "6.3.1"
version = "7.4.0"
authors = ["Zigang Lin <vincent@secondstate.io>"]
license = "Apache-2.0"
repository = "https://github.com/ethereum/evmc"
description = "Bindings to EVMC (Client/Host specific)"
edition = "2018"

[dependencies]
evmc-sys = { path = "../evmc-sys" }
evmc-sys = { path = "../evmc-sys", version = "7.4.0" }
libloading = "0.5"
661 changes: 0 additions & 661 deletions bindings/rust/evmc-client/LICENSE

This file was deleted.

31 changes: 13 additions & 18 deletions bindings/rust/evmc-client/src/host.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// Copyright (C) 2020 Second State.
// This file is part of Rust-SSVM.

// Rust-SSVM is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.

// Rust-SSVM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.

// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* EVMC: Ethereum Client-VM Connector API.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*/

use crate::types::*;
use evmc_sys as ffi;
Expand Down Expand Up @@ -53,7 +42,9 @@ struct Callback {
host_interface: ::std::option::Option<Box<dyn HostInterface>>,
}

static mut CALLBACK: Callback = Callback { host_interface: None };
static mut CALLBACK: Callback = Callback {
host_interface: None,
};

pub fn set_host_interface(interface: Option<Box<dyn HostInterface>>) {
unsafe {
Expand All @@ -62,7 +53,9 @@ pub fn set_host_interface(interface: Option<Box<dyn HostInterface>>) {
}

pub fn get_evmc_host_context() -> ffi::evmc_host_context {
ffi::evmc_host_context {_bindgen_opaque_blob:[0u8; 0]}
ffi::evmc_host_context {
_bindgen_opaque_blob: [0u8; 0],
}
}

pub fn get_evmc_host_interface() -> ffi::evmc_host_interface {
Expand Down Expand Up @@ -203,7 +196,9 @@ unsafe extern "C" fn selfdestruct(
beneficiary: *const ffi::evmc_address,
) {
match &mut CALLBACK.host_interface {
Some(host_interface) => host_interface.selfdestruct(&(*address).bytes, &(*beneficiary).bytes),
Some(host_interface) => {
host_interface.selfdestruct(&(*address).bytes, &(*beneficiary).bytes)
}
None => {
panic!("Host context not implemented");
}
Expand Down
21 changes: 5 additions & 16 deletions bindings/rust/evmc-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// Copyright (C) 2020 Second State.
// This file is part of Rust-SSVM.

// Rust-SSVM is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.

// Rust-SSVM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.

// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* EVMC: Ethereum Client-VM Connector API.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*/

pub mod host;
mod loader;
Expand Down Expand Up @@ -50,7 +39,7 @@ fn error(err: EvmcLoaderErrorCode) -> Result<EvmcLoaderErrorCode, &'static str>

pub struct EvmcVm {
handle: *mut ffi::evmc_vm,
host_context: *mut ffi::evmc_host_context,
host_context: *mut ffi::evmc_host_context,
host_interface: *mut ffi::evmc_host_interface,
}

Expand Down
19 changes: 4 additions & 15 deletions bindings/rust/evmc-client/src/loader.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// Copyright (C) 2020 Second State.
// This file is part of Rust-SSVM.

// Rust-SSVM is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.

// Rust-SSVM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.

// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* EVMC: Ethereum Client-VM Connector API.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*/

use evmc_sys as ffi;
use libloading::{Library, Symbol};
Expand Down
19 changes: 4 additions & 15 deletions bindings/rust/evmc-client/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// Copyright (C) 2020 Second State.
// This file is part of Rust-SSVM.

// Rust-SSVM is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.

// Rust-SSVM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.

// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/* EVMC: Ethereum Client-VM Connector API.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*/

pub use evmc_sys as ffi;

Expand Down

0 comments on commit b87db19

Please sign in to comment.