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

Commit 5995741

Browse files
bearaurexav
bear
andauthored
Upgrade EVM pallet to FRAMEv2 (#648)
* darwinia-evm new style * Update license * Change `Module::<T>` to `Pallet<T>` * Add lost comment * update format Co-authored-by: Xavier Lau <[email protected]>
1 parent 989342a commit 5995741

File tree

7 files changed

+439
-393
lines changed

7 files changed

+439
-393
lines changed

bin/node/runtime/pangolin/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl_runtime_apis! {
656656
}
657657

658658
fn account_code_at(address: H160) -> Vec<u8> {
659-
darwinia_evm::Module::<Runtime>::account_codes(address)
659+
darwinia_evm::Pallet::<Runtime>::account_codes(address)
660660
}
661661

662662
fn author() -> H160 {
@@ -666,7 +666,7 @@ impl_runtime_apis! {
666666
fn storage_at(address: H160, index: U256) -> H256 {
667667
let mut tmp = [0u8; 32];
668668
index.to_big_endian(&mut tmp);
669-
darwinia_evm::Module::<Runtime>::account_storages(address, H256::from_slice(&tmp[..]))
669+
darwinia_evm::Pallet::<Runtime>::account_storages(address, H256::from_slice(&tmp[..]))
670670
}
671671

672672
fn call(

frame/dvm-dynamic-fee/src/lib.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
// SPDX-License-Identifier: Apache-2.0
2-
// This file is part of Frontier.
1+
// This file is part of Darwinia.
32
//
4-
// Copyright (c) 2021 Parity Technologies (UK) Ltd.
3+
// Copyright (C) 2018-2021 Darwinia Network
4+
// SPDX-License-Identifier: GPL-3.0
55
//
6-
// Licensed under the Apache License, Version 2.0 (the "License");
7-
// you may not use this file except in compliance with the License.
8-
// You may obtain a copy of the License at
6+
// Darwinia is free software: you can redistribute it and/or modify
7+
// it under the terms of the GNU General Public License as published by
8+
// the Free Software Foundation, either version 3 of the License, or
9+
// (at your option) any later version.
910
//
10-
// http://www.apache.org/licenses/LICENSE-2.0
11+
// Darwinia is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
// GNU General Public License for more details.
1115
//
12-
// Unless required by applicable law or agreed to in writing, software
13-
// distributed under the License is distributed on an "AS IS" BASIS,
14-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
// See the License for the specific language governing permissions and
16-
// limitations under the License.
16+
// You should have received a copy of the GNU General Public License
17+
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.
1718

1819
#![cfg_attr(not(feature = "std"), no_std)]
1920

frame/evm/precompile/contracts/kton/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use sp_core::{H160, U256};
3030
use sp_runtime::{traits::UniqueSaturatedInto, SaturatedConversion};
3131
use sp_std::{borrow::ToOwned, marker::PhantomData, prelude::*, vec::Vec};
3232

33-
use darwinia_evm::{Account, AccountBasic, Config, Module, Runner};
33+
use darwinia_evm::{Account, AccountBasic, Config, Pallet, Runner};
3434
use darwinia_support::evm::POW_9;
3535
use dp_evm::Precompile;
3636
use dvm_ethereum::{
@@ -73,7 +73,7 @@ impl<T: Config + dvm_ethereum::Config> Precompile for Kton<T> {
7373
Action::TransferAndCall(call_data) => {
7474
// Ensure wkton is a contract
7575
ensure!(
76-
!crate::Module::<T>::is_contract_code_empty(&call_data.wkton_address),
76+
!crate::Pallet::<T>::is_contract_code_empty(&call_data.wkton_address),
7777
ExitError::Other("Wkton must be a contract!".into())
7878
);
7979
// Ensure context's apparent_value is zero, since the transfer value is encoded in input field
@@ -119,7 +119,7 @@ impl<T: Config + dvm_ethereum::Config> Precompile for Kton<T> {
119119
Action::Withdraw(wd) => {
120120
// Ensure wkton is a contract
121121
ensure!(
122-
!crate::Module::<T>::is_contract_code_empty(&context.caller),
122+
!crate::Pallet::<T>::is_contract_code_empty(&context.caller),
123123
ExitError::Other("The caller must be wkton contract!".into())
124124
);
125125
// Ensure context's apparent_value is zero

0 commit comments

Comments
 (0)