Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Upgrade Ethereum pallet to FRAMEv2 #649

Merged
merged 2 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/node/runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ impl_runtime_apis! {
}

fn author() -> H160 {
<dvm_ethereum::Module<Runtime>>::find_author()
<dvm_ethereum::Pallet<Runtime>>::find_author()
}

fn storage_at(address: H160, index: U256) -> H256 {
Expand Down
4 changes: 2 additions & 2 deletions frame/bridge/ethereum/issuing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl<T: Config> Module<T> {
let factory_address = MappingFactoryAddress::get();
let bytes = Abi::encode_mapping_token(backing, source)
.map_err(|_| Error::<T>::InvalidIssuingAccount)?;
let mapped_address = dvm_ethereum::Module::<T>::do_call(factory_address, bytes)
let mapped_address = dvm_ethereum::Pallet::<T>::do_call(factory_address, bytes)
.map_err(|e| -> &'static str { e.into() })?;
if mapped_address.len() != 32 {
return Err(Error::<T>::InvalidAddressLen.into());
Expand Down Expand Up @@ -370,7 +370,7 @@ impl<T: Config> Module<T> {

pub fn transact_mapping_factory(input: Vec<u8>) -> DispatchResult {
let contract = MappingFactoryAddress::get();
let result = dvm_ethereum::Module::<T>::internal_transact(contract, input).map_err(
let result = dvm_ethereum::Pallet::<T>::internal_transact(contract, input).map_err(
|e| -> &'static str {
log::debug!("call mapping factory contract error {:?}", &e);
e.into()
Expand Down
19 changes: 10 additions & 9 deletions frame/dvm/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// This file is part of Frontier.

// Substrate is free software: you can redistribute it and/or modify
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Substrate is distributed in the hope that it will be useful,
//
// Darwinia 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 General Public License for more details.

//
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.
#![cfg_attr(not(feature = "std"), no_std)]

use codec::{Decode, Encode};
Expand Down
18 changes: 10 additions & 8 deletions frame/dvm/rpc/src/eth.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Frontier.

// Open Ethereum is free software: you can redistribute it and/or modify
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Open Ethereum is distributed in the hope that it will be useful,
//
// Darwinia 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 General Public License for more details.

//
// You should have received a copy of the GNU General Public License
// along with Open Ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

//! Eth rpc interface.

Expand Down
19 changes: 10 additions & 9 deletions frame/dvm/rpc/src/eth_pubsub.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Frontier.

// Open Ethereum is free software: you can redistribute it and/or modify
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Open Ethereum is distributed in the hope that it will be useful,
//
// Darwinia 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 General Public License for more details.

//
// You should have received a copy of the GNU General Public License
// along with Open Ethereum. If not, see <http://www.gnu.org/licenses/>.

// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.
//! Eth PUB-SUB rpc interface.

use jsonrpc_core::Result;
Expand Down
18 changes: 18 additions & 0 deletions frame/dvm/rpc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Darwinia 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

mod eth;
mod eth_pubsub;
mod net;
Expand Down
18 changes: 10 additions & 8 deletions frame/dvm/rpc/src/net.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Frontier.

// Open Ethereum is free software: you can redistribute it and/or modify
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Open Ethereum is distributed in the hope that it will be useful,
//
// Darwinia 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 General Public License for more details.

//
// You should have received a copy of the GNU General Public License
// along with Open Ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

//! Net rpc interface.
use dp_rpc::PeerCount;
Expand Down
18 changes: 10 additions & 8 deletions frame/dvm/rpc/src/web3.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Frontier.

// Open Ethereum is free software: you can redistribute it and/or modify
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Open Ethereum is distributed in the hope that it will be useful,
//
// Darwinia 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 General Public License for more details.

//
// You should have received a copy of the GNU General Public License
// along with Open Ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

//! Web3 rpc interface.
use ethereum_types::H256;
Expand Down
21 changes: 19 additions & 2 deletions frame/dvm/src/account_basic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Darwinia 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.

use crate::{Config, KtonBalance, RemainingKtonBalance, RemainingRingBalance, RingBalance};
use darwinia_evm::{Account as EVMAccount, AccountBasic, AddressMapping};
use darwinia_support::evm::POW_9;
use evm::ExitError;
use frame_support::ensure;
use frame_support::{storage::StorageMap, traits::Currency};
use frame_support::{ensure, traits::Currency};
use sp_core::{H160, U256};
use sp_runtime::{
traits::{Saturating, UniqueSaturatedInto},
Expand Down
Loading