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
37 changes: 37 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion precompiles/src/balance_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sp_runtime::traits::{AsSystemOriginSigner, Dispatchable, StaticLookup, Uniqu

use crate::{PrecompileExt, PrecompileHandleExt};

pub(crate) struct BalanceTransferPrecompile<R>(PhantomData<R>);
pub struct BalanceTransferPrecompile<R>(PhantomData<R>);

impl<R> PrecompileExt<R::AccountId> for BalanceTransferPrecompile<R>
where
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use fp_evm::{ExitError, ExitSucceed, LinearCostPrecompile, PrecompileFailure};

use crate::{PrecompileExt, parse_slice};

pub(crate) struct Ed25519Verify<A>(PhantomData<A>);
pub struct Ed25519Verify<A>(PhantomData<A>);

impl<A> PrecompileExt<A> for Ed25519Verify<A>
where
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn extension_error(err: TransactionValidityError) -> PrecompileFailure {

impl<T> PrecompileHandleExt for T where T: PrecompileHandle {}

pub(crate) trait PrecompileExt<AccountId: From<[u8; 32]>>: Precompile {
pub trait PrecompileExt<AccountId: From<[u8; 32]>>: Precompile {
const INDEX: u64;

// ss58 public key i.e., the contract sends funds it received to the destination address from
Expand Down
35 changes: 18 additions & 17 deletions precompiles/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use frame_support::{
dispatch::{DispatchInfo, GetDispatchInfo, PostDispatchInfo},
pallet_prelude::Decode,
};
use pallet_admin_utils::PrecompileEnum;
use pallet_evm::{
AddressMapping, IsPrecompileResult, Precompile, PrecompileHandle, PrecompileResult,
PrecompileSet,
Expand All @@ -24,24 +25,24 @@ use sp_core::{H160, U256, crypto::ByteArray};
use sp_runtime::traits::{AsSystemOriginSigner, Dispatchable, StaticLookup};
use subtensor_runtime_common::ProxyType;

use pallet_admin_utils::PrecompileEnum;

use crate::address_mapping::*;
use crate::alpha::*;
use crate::balance_transfer::*;
use crate::crowdloan::*;
use crate::ed25519::*;
use crate::extensions::*;
use crate::leasing::*;
use crate::metagraph::*;
use crate::neuron::*;
use crate::proxy::*;
use crate::sr25519::*;
use crate::staking::*;
use crate::storage_query::*;
use crate::subnet::*;
use crate::uid_lookup::*;
use crate::voting_power::*;

pub use address_mapping::AddressMappingPrecompile;
pub use alpha::AlphaPrecompile;
pub use balance_transfer::BalanceTransferPrecompile;
pub use crowdloan::CrowdloanPrecompile;
pub use ed25519::Ed25519Verify;
pub use extensions::PrecompileExt;
pub use leasing::LeasingPrecompile;
pub use metagraph::MetagraphPrecompile;
pub use neuron::NeuronPrecompile;
pub use proxy::ProxyPrecompile;
pub use sr25519::Sr25519Verify;
pub use staking::{StakingPrecompile, StakingPrecompileV2};
pub use storage_query::StorageQueryPrecompile;
pub use subnet::SubnetPrecompile;
pub use uid_lookup::UidLookupPrecompile;
pub use voting_power::VotingPowerPrecompile;

mod address_mapping;
mod alpha;
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/sr25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use fp_evm::{ExitError, ExitSucceed, LinearCostPrecompile, PrecompileFailure};

use crate::{PrecompileExt, parse_slice};

pub(crate) struct Sr25519Verify<A>(PhantomData<A>);
pub struct Sr25519Verify<A>(PhantomData<A>);

impl<A> PrecompileExt<A> for Sr25519Verify<A>
where
Expand Down
4 changes: 2 additions & 2 deletions precompiles/src/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use crate::{PrecompileExt, PrecompileHandleExt};
// to stop supporting both precompiles.
//
// All the future extensions should happen in StakingPrecompileV2.
pub(crate) struct StakingPrecompileV2<R>(PhantomData<R>);
pub struct StakingPrecompileV2<R>(PhantomData<R>);

impl<R> PrecompileExt<R::AccountId> for StakingPrecompileV2<R>
where
Expand Down Expand Up @@ -450,7 +450,7 @@ where
}

// Deprecated, exists for backward compatibility.
pub(crate) struct StakingPrecompile<R>(PhantomData<R>);
pub struct StakingPrecompile<R>(PhantomData<R>);

impl<R> PrecompileExt<R::AccountId> for StakingPrecompile<R>
where
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/storage_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use sp_std::vec::Vec;

use crate::PrecompileExt;

pub(crate) struct StorageQueryPrecompile<R>(PhantomData<R>);
pub struct StorageQueryPrecompile<R>(PhantomData<R>);

impl<R> PrecompileExt<R::AccountId> for StorageQueryPrecompile<R>
where
Expand Down
2 changes: 1 addition & 1 deletion precompiles/src/uid_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sp_std::vec::Vec;

use crate::PrecompileExt;

pub(crate) struct UidLookupPrecompile<R>(PhantomData<R>);
pub struct UidLookupPrecompile<R>(PhantomData<R>);

impl<R> PrecompileExt<R::AccountId> for UidLookupPrecompile<R>
where
Expand Down
1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ ethereum.workspace = true
frame-metadata.workspace = true
sp-io.workspace = true
sp-tracing.workspace = true
precompile-utils = { workspace = true, features = ["testing"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 377,
spec_version: 378,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Loading
Loading