Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ee473d3
Bump all deps to 0.9.34 and start working on compilation
drewstone Dec 15, 2022
57dae40
Building the runtime
drewstone Dec 15, 2022
fd4feec
Add feature
drewstone Dec 15, 2022
2b76ee2
cargo check passes
Dec 16, 2022
859bfaf
wip
Dec 16, 2022
41ed679
try workaround - wrapper types
Dec 16, 2022
e8a78f9
update to 0.9.36 - wip
Dec 23, 2022
468e033
wip
Dec 23, 2022
e5467be
compiling with cargo check --tests
Dec 27, 2022
cb68766
update dep
Dec 28, 2022
84acbab
cargo fmt
1xstj Jan 9, 2023
1f12f24
cargo clippy fix
1xstj Jan 9, 2023
41fff0e
remove unused files
1xstj Jan 9, 2023
550a022
Merge branch 'main' of github.com:webb-tools/protocol-substrate into …
1xstj Jan 9, 2023
e5b2655
cargo fmt
1xstj Jan 9, 2023
a00307f
fix missing pallet
1xstj Jan 9, 2023
ba991c2
more fixes
1xstj Jan 9, 2023
e8b5a2a
fix failing tests
1xstj Jan 9, 2023
ee59554
remove without_storage_info
1xstj Jan 9, 2023
9c693d7
fix asset registry
1xstj Jan 10, 2023
21e3c0b
fix pallet-mt
1xstj Jan 10, 2023
13477e0
Merge branch 'main' of github.com:webb-tools/protocol-substrate into …
1xstj Jan 10, 2023
6694378
fix linkable tree
1xstj Jan 10, 2023
1b2c5a4
fix token-wrapper
1xstj Jan 10, 2023
9d7c094
fix token-wrapper
1xstj Jan 10, 2023
fdba6c8
fix signature bridge
1xstj Jan 10, 2023
36aef04
fix anonimity mining
1xstj Jan 12, 2023
bff2f6a
everything compiles
1xstj Jan 12, 2023
358b7ad
make all tests pass
1xstj Jan 12, 2023
1c098ee
clippy fix
1xstj Jan 12, 2023
31a77ff
add pallet indices, resolves #286
1xstj Jan 12, 2023
18f62c3
Merge branch 'main' of github.com:webb-tools/protocol-substrate into …
1xstj Jan 12, 2023
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
1 change: 1 addition & 0 deletions Cargo.lock

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

13 changes: 3 additions & 10 deletions pallets/anonymity-mining/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use frame_support::{
};
use orml_traits::MultiCurrency;
use pallet_vanchor::VAnchorConfigration;
use sp_std::{convert::TryInto, prelude::*, vec};
use sp_std::{convert::TryInto, vec};
use webb_primitives::traits::vanchor::{VAnchorInspector, VAnchorInterface};

pub use pallet::*;
Expand All @@ -61,7 +61,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::without_storage_info]

pub struct Pallet<T, I = ()>(_);

#[pallet::config]
Expand Down Expand Up @@ -133,12 +133,6 @@ pub mod pallet {
fn build(&self) {}
}

#[pallet::storage]
#[pallet::getter(fn parameters)]
/// Details of the module's parameters
pub(super) type Parameters<T: Config<I>, I: 'static = ()> =
StorageValue<_, Vec<u8>, ValueQuery>;

#[pallet::storage]
#[pallet::getter(fn get_pool_weight)]
pub type PoolWeight<T: Config<I>, I: 'static = ()> = StorageValue<_, u64, ValueQuery>;
Expand All @@ -156,15 +150,14 @@ pub mod pallet {

#[pallet::error]
pub enum Error<T, I = ()> {
/// Parameters haven't been initialized
ParametersNotInitialized,
/// Error during hashing
HashError,
}

#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pallet::weight(0)]
#[pallet::call_index(0)]
pub fn swap(
origin: OriginFor<T>,
recipient: T::AccountId,
Expand Down
24 changes: 23 additions & 1 deletion pallets/anonymity-mining/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use super::*;
use crate::{self as pallet_anonymity_mining};
use codec::{Decode, Encode};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{parameter_types, traits::Nothing, PalletId};
use frame_system as system;
use orml_currencies::{BasicCurrencyAdapter, NativeCurrencyOf};
use sp_runtime::traits::ConstU32;
//pub use pallet_balances;
pub use pallet::*;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_core::H256;
use sp_runtime::{
Expand Down Expand Up @@ -157,6 +159,7 @@ parameter_types! {
scale_info::TypeInfo,
Serialize,
Deserialize,
MaxEncodedLen,
)]
pub struct Element([u8; 32]);

Expand All @@ -172,12 +175,21 @@ impl ElementTrait for Element {
}
}

parameter_types! {
#[derive(Debug, TypeInfo)]
pub const MaxEdges: u32 = 1000;
#[derive(Debug, TypeInfo)]
pub const MaxDefaultHashes: u32 = 1000;
}

impl pallet_mt::Config for Test {
type Currency = Balances;
type DataDepositBase = LeafDepositBase;
type DataDepositPerByte = LeafDepositPerByte;
type DefaultZeroElement = DefaultZeroElement;
type Element = Element;
type MaxEdges = MaxEdges;
type MaxDefaultHashes = MaxDefaultHashes;
type RuntimeEvent = RuntimeEvent;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type Hasher = HasherPallet;
Expand All @@ -199,12 +211,18 @@ parameter_types! {
pub const RegistryStringLimit: u32 = 10;
}

parameter_types! {
#[derive(Debug, TypeInfo, PartialEq, Clone, Eq)]
pub const MaxAssetIdInPool: u32 = 1000;
}

impl pallet_asset_registry::Config for Test {
type AssetId = webb_primitives::AssetId;
type AssetNativeLocation = ();
type Balance = Balance;
type RuntimeEvent = RuntimeEvent;
type NativeAssetId = NativeCurrencyId;
type MaxAssetIdInPool = MaxAssetIdInPool;
type RegistryOrigin = frame_system::EnsureRoot<AccountId>;
type StringLimit = RegistryStringLimit;
type WeightInfo = ();
Expand All @@ -226,13 +244,15 @@ parameter_types! {
impl pallet_vanchor_verifier::Config for Test {
type RuntimeEvent = RuntimeEvent;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type MaxParameterLength = ConstU32<1000>;
type Verifier = ArkworksVerifierBn254;
type WeightInfo = ();
}

impl pallet_hasher::Config for Test {
type RuntimeEvent = RuntimeEvent;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type MaxParameterLength = ConstU32<100>;
type Hasher = webb_primitives::hashing::ArkworksPoseidonHasherBn254;
type WeightInfo = ();
}
Expand Down Expand Up @@ -298,6 +318,8 @@ impl pallet_vanchor::Config for Test {

impl pallet_key_storage::Config for Test {
type RuntimeEvent = RuntimeEvent;
type MaxPubkeyLength = ConstU32<1000>;
type MaxPubKeyOwners = ConstU32<1000>;
type WeightInfo = ();
}

Expand Down
Loading