Skip to content
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: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions evm-tests/src/contracts/pureProxy.ts

This file was deleted.

10 changes: 0 additions & 10 deletions evm-tests/src/subtensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,6 @@ export async function setMaxChildkeyTake(api: TypedApi<typeof devnet>, take: num
await waitForTransactionWithRetry(api, tx, alice)
}

// use the alice as wrong mapped account to send extrinsic
export async function setPureProxyAccount(api: TypedApi<typeof devnet>, address: string, account: string) {
const alice = getAliceSigner()
const call = api.tx.SubtensorModule.set_pure_proxy_account({
address: ethAddressToH160(address),
account
})
await waitForTransactionWithRetry(api, call, alice)
}

// Swap coldkey to contract address
export async function swapColdkey(
api: TypedApi<typeof devnet>,
Expand Down
130 changes: 0 additions & 130 deletions evm-tests/test/pure-proxy.precompile.test.ts

This file was deleted.

4 changes: 0 additions & 4 deletions pallets/admin-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pallet-scheduler = { workspace = true }
pallet-grandpa = { workspace = true }
sp-std = { workspace = true }
pallet-subtensor-swap = { workspace = true }
pallet-evm = { workspace = true }
pallet-crowdloan = { workspace = true, default-features = false }
pallet-preimage = { workspace = true, default-features = false }

Expand All @@ -59,7 +58,6 @@ std = [
"log/std",
"pallet-balances/std",
"pallet-drand/std",
"pallet-evm/std",
"pallet-evm-chain-id/std",
"pallet-grandpa/std",
"pallet-scheduler/std",
Expand All @@ -86,7 +84,6 @@ runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-drand/runtime-benchmarks",
"pallet-evm/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-subtensor/runtime-benchmarks",
Expand All @@ -100,7 +97,6 @@ try-runtime = [
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"pallet-drand/try-runtime",
"pallet-evm/try-runtime",
"pallet-evm-chain-id/try-runtime",
"pallet-grandpa/try-runtime",
"pallet-scheduler/try-runtime",
Expand Down
10 changes: 0 additions & 10 deletions pallets/admin-utils/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ use sp_weights::Weight;
use subtensor_runtime_common::NetUid;

type Block = frame_system::mocking::MockBlock<Test>;

pub struct DummyAddressMap;

impl pallet_evm::AddressMapping<AccountId> for DummyAddressMap {
fn into_account_id(address: sp_core::H160) -> AccountId {
let account = pallet_evm::HashedAddressMapping::<BlakeTwo256>::into_account_id(address);
U256::from_big_endian(account.as_ref())
}
}
// Configure a mock runtime to test the pallet.
frame_support::construct_runtime!(
pub enum Test {
Expand Down Expand Up @@ -230,7 +221,6 @@ impl pallet_subtensor::Config for Test {
type SwapInterface = Swap;
type KeySwapOnSubnetCost = InitialKeySwapOnSubnetCost;
type HotkeySwapOnSubnetInterval = HotkeySwapOnSubnetInterval;
type AddressMapping = DummyAddressMap;
type ProxyInterface = ();
type LeaseDividendsDistributionInterval = LeaseDividendsDistributionInterval;
}
Expand Down
4 changes: 0 additions & 4 deletions pallets/subtensor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ subtensor-runtime-common = { workspace = true, features = ["approx"] }

pallet-collective = { version = "4.0.0-dev", default-features = false, path = "../collective" }
pallet-drand = { path = "../drand", default-features = false }
pallet-evm = { workspace = true }
pallet-membership = { workspace = true }
hex-literal = { workspace = true }
num-traits = { version = "0.2.19", default-features = false, features = [
Expand Down Expand Up @@ -93,7 +92,6 @@ std = [
"pallet-balances/std",
"pallet-collective/std",
"pallet-drand/std",
"pallet-evm/std",
"pallet-membership/std",
"pallet-preimage/std",
"pallet-scheduler/std",
Expand Down Expand Up @@ -136,7 +134,6 @@ runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-evm/runtime-benchmarks",
"pallet-drand/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
Expand All @@ -152,7 +149,6 @@ try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"pallet-evm/try-runtime",
"pallet-membership/try-runtime",
"pallet-preimage/try-runtime",
"pallet-scheduler/try-runtime",
Expand Down
13 changes: 1 addition & 12 deletions pallets/subtensor/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use frame_benchmarking::v2::*;
use frame_support::{StorageDoubleMap, assert_ok};
use frame_system::{RawOrigin, pallet_prelude::BlockNumberFor};
pub use pallet::*;
use sp_core::{H160, H256};
use sp_core::H256;
use sp_runtime::{
BoundedVec, Percent,
traits::{BlakeTwo256, Hash},
Expand All @@ -20,7 +20,6 @@ use subtensor_runtime_common::{AlphaCurrency, NetUid};
#[frame_benchmarking::v2::benchmarks]
mod pallet_benchmarks {
use super::*;
use pallet_evm::AddressMapping;

#[benchmark]
fn register() {
Expand Down Expand Up @@ -1382,16 +1381,6 @@ mod pallet_benchmarks {
_(RawOrigin::Signed(coldkey), hotkey);
}

#[benchmark]
fn set_pure_proxy_account() {
let address: H160 = H160::zero();
let mapped_account = T::AddressMapping::into_account_id(address);
let proxy_account: T::AccountId = account("A", 0, 7);

#[extrinsic_call]
_(RawOrigin::Signed(mapped_account), address, proxy_account);
}

#[benchmark]
fn remove_stake_full_limit() {
let netuid = NetUid::from(1);
Expand Down
5 changes: 0 additions & 5 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1717,11 +1717,6 @@ pub mod pallet {
pub type AssociatedEvmAddress<T: Config> =
StorageDoubleMap<_, Twox64Concat, NetUid, Twox64Concat, u16, (H160, u64), OptionQuery>;

#[pallet::storage]
/// --- MAP (H160) --> T::AccountId
pub type PureProxyAccount<T: Config> =
StorageMap<_, Twox64Concat, H160, T::AccountId, OptionQuery>;

/// ========================
/// ==== Subnet Leasing ====
/// ========================
Expand Down
4 changes: 0 additions & 4 deletions pallets/subtensor/src/macros/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use frame_support::pallet_macros::pallet_section;
#[pallet_section]
mod config {

use pallet_evm::AddressMapping;
use subtensor_swap_interface::SwapHandler;

/// Configure the pallet by specifying the parameters and types on which it depends.
Expand Down Expand Up @@ -56,9 +55,6 @@ mod config {
/// Swap interface.
type SwapInterface: SwapHandler<Self::AccountId>;

/// Mapping evm address to account Id
type AddressMapping: AddressMapping<Self::AccountId>;

/// Interface to allow interacting with the proxy pallet.
type ProxyInterface: crate::ProxyInterface<Self::AccountId>;

Expand Down
15 changes: 0 additions & 15 deletions pallets/subtensor/src/macros/dispatches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2175,20 +2175,5 @@ mod dispatches {
Self::deposit_event(Event::SymbolUpdated { netuid, symbol });
Ok(())
}

/// Sets proxy account for evm address
#[pallet::call_index(113)]
#[pallet::weight((
Weight::from_parts(21_010_000, 0).saturating_add(T::DbWeight::get().reads_writes(1, 1)),
DispatchClass::Operational,
Pays::Yes
))]
pub fn set_pure_proxy_account(
origin: OriginFor<T>,
address: H160,
account: T::AccountId,
) -> DispatchResult {
Self::do_set_pure_proxy_account(origin, address, account)
}
}
}
4 changes: 0 additions & 4 deletions pallets/subtensor/src/macros/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ mod errors {
SameNetuid,
/// The caller does not have enough balance for the operation.
InsufficientBalance,
/// Origin not match the mapped EVM account
OriginNotMatchMappedEVM,
/// Pure proxy account already set
PureProxyAccountExisted,
/// Too frequent staking operations
StakingOperationRateLimitExceeded,
/// Invalid lease beneficiary to register the leased network.
Expand Down
7 changes: 0 additions & 7 deletions pallets/subtensor/src/macros/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,5 @@ mod events {
/// The symbol that has been updated.
symbol: Vec<u8>,
},
/// Pure proxy account is set
PureProxyAccountSet {
/// EVM address
address: H160,
/// Pure proxy account
account: T::AccountId,
},
}
}
Loading
Loading