-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from paritytech/sp-integ
pallet-evm: move to Frontier (Part III)
- Loading branch information
Showing
14 changed files
with
127 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[package] | ||
name = "fp-evm" | ||
version = "0.8.0" | ||
license = "Apache-2.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
homepage = "https://substrate.dev" | ||
repository = "https://github.com/paritytech/substrate/" | ||
description = "Primitive EVM abstractions for Substrate." | ||
documentation = "https://docs.rs/sp-evm" | ||
readme = "README.md" | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
sp-core = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git", branch = "frontier", default-features = false } | ||
sp-std = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git", branch = "frontier", default-features = false } | ||
serde = { version = "1.0.101", optional = true, features = ["derive"] } | ||
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } | ||
evm = { version = "0.18", default-features = false, features = ["with-codec"] } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"sp-core/std", | ||
"sp-std/std", | ||
"serde", | ||
"codec/std", | ||
"evm/std", | ||
"evm/with-serde", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
use codec::{Encode, Decode}; | ||
#[cfg(feature = "std")] | ||
use serde::{Serialize, Deserialize}; | ||
use sp_std::vec::Vec; | ||
use sp_core::{U256, H160}; | ||
use evm::ExitReason; | ||
|
||
pub use evm::backend::{Basic as Account, Log}; | ||
|
||
#[derive(Clone, Eq, PartialEq, Encode, Decode, Default)] | ||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] | ||
/// External input from the transaction. | ||
pub struct Vicinity { | ||
/// Current transaction gas price. | ||
pub gas_price: U256, | ||
/// Origin of the transaction. | ||
pub origin: H160, | ||
} | ||
|
||
#[derive(Clone, Eq, PartialEq, Encode, Decode)] | ||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] | ||
pub struct ExecutionInfo<T> { | ||
pub exit_reason: ExitReason, | ||
pub value: T, | ||
pub used_gas: U256, | ||
pub logs: Vec<Log>, | ||
} | ||
|
||
pub type CallInfo = ExecutionInfo<Vec<u8>>; | ||
pub type CreateInfo = ExecutionInfo<H160>; | ||
|
||
#[derive(Clone, Eq, PartialEq, Encode, Decode)] | ||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] | ||
pub enum CallOrCreateInfo { | ||
Call(CallInfo), | ||
Create(CreateInfo), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters