Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Show changes
Commits on Source (4)
Showing
with 741 additions and 1091 deletions
This diff is collapsed.
......@@ -3,8 +3,7 @@ runtime-benchmarks = ['gdev-runtime/runtime-benchmarks']
[build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[package]
authors = ['Axiom-Team Developers <https://axiom-team.fr>']
......@@ -34,190 +33,158 @@ structopt = '0.3.8'
[dependencies.frame-benchmarking]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.1.0'
tag = 'monthly-2021-08'
[dependencies.frame-benchmarking-cli]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.pallet-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-chain-spec]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-cli]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-consensus-manual-seal]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-keystore]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-service]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sc-telemetry]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sc-transaction-pool-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
[dependencies.serde_json]
version = '1.0.64'
[dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '0.9.0'
tag = 'monthly-2021-08'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-offchain]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-session]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-storage]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-timestamp]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-trie]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[[bin]]
name = 'lc-core'
......@@ -26,10 +26,10 @@ pub use sc_rpc_api::DenyUnsafe;
use common_runtime::Block;
use common_runtime::{AccountId, Balance, Index};
use sc_consensus_manual_seal::rpc::{ManualSeal, ManualSealApi};
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use sp_transaction_pool::TransactionPool;
use std::sync::Arc;
/// Full client dependencies.
......
......@@ -95,7 +95,7 @@ pub fn new_chain_ops(
(
Arc<Client>,
Arc<FullBackend>,
sp_consensus::import_queue::BasicQueue<Block, sp_trie::PrefixedMemoryDB<BlakeTwo256>>,
sc_consensus::BasicQueue<Block, sp_trie::PrefixedMemoryDB<BlakeTwo256>>,
TaskManager,
),
ServiceError,
......@@ -144,7 +144,7 @@ pub fn new_partial<RuntimeApi, Executor>(
FullClient<RuntimeApi, Executor>,
FullBackend,
FullSelectChain,
sp_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, Executor>>,
sc_consensus::DefaultImportQueue<Block, FullClient<RuntimeApi, Executor>>,
sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, Executor>>,
(
sc_finality_grandpa::GrandpaBlockImport<
......@@ -386,7 +386,7 @@ where
block_import,
env: proposer_factory,
client: client.clone(),
pool: transaction_pool.pool().clone(),
pool: transaction_pool.clone(),
commands_stream,
select_chain,
consensus_data_provider: None,
......
......@@ -199,6 +199,23 @@ impl sc_client_api::StorageProvider<Block, super::FullBackend> for Client {
}
}
fn child_storage_keys_iter<'a>(
&self,
id: &BlockId<Block>,
child_info: ChildInfo,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
KeyIterator<'a, <super::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
match self {
Self::GTest(client) => {
client.child_storage_keys_iter(id, child_info, prefix, start_key)
}
Self::GDev(client) => client.child_storage_keys_iter(id, child_info, prefix, start_key),
}
}
fn child_storage_hash(
&self,
id: &BlockId<Block>,
......
......@@ -6,7 +6,7 @@ homepage = 'https://substrate.dev'
license = 'AGPL-3.0'
name = 'pallet-certification'
readme = 'README.md'
repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate'
repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate'
version = '3.0.0'
[features]
......@@ -28,23 +28,23 @@ try-runtime = ['frame-support/try-runtime']
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '2.1.0'
version = '2.2.0'
[dependencies.frame-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.serde]
version = "1.0.101"
......@@ -54,17 +54,17 @@ features = ["derive"]
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
### DOC ###
......@@ -81,4 +81,4 @@ version = '1.0.2'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
......@@ -17,7 +17,7 @@
use crate::{self as pallet_certification};
use frame_support::{
parameter_types,
traits::{OnFinalize, OnInitialize},
traits::{AllowAll, OnFinalize, OnInitialize},
};
use frame_system as system;
use sp_core::H256;
......@@ -51,7 +51,7 @@ parameter_types! {
}
impl system::Config for Test {
type BaseCallFilter = ();
type BaseCallFilter = AllowAll;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
......
......@@ -28,23 +28,23 @@ try-runtime = ['frame-support/try-runtime']
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '2.1.0'
version = '2.2.0'
[dependencies.frame-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.serde]
version = "1.0.101"
......@@ -54,17 +54,17 @@ features = ["derive"]
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
### DOC ###
......@@ -78,4 +78,4 @@ version = '1.0.119'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
......@@ -19,7 +19,7 @@ use crate::{self as pallet_identity};
use frame_support::{
codec::{Decode, Encode},
parameter_types,
traits::{OnFinalize, OnInitialize},
traits::{AllowAll, OnFinalize, OnInitialize},
RuntimeDebug,
};
use frame_system as system;
......@@ -74,7 +74,7 @@ parameter_types! {
}
impl system::Config for Test {
type BaseCallFilter = ();
type BaseCallFilter = AllowAll;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
......
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>', 'tuxmain <tuxmain@zettascript.org>']
description = 'FRAME pallet template for defining custom runtime logic.'
edition = '2018'
homepage = 'https://substrate.dev'
license = 'AGPL v3'
name = 'pallet-template'
readme = 'README.md'
repository = 'https://forge.tedomum.net/axiom-team/substrate-libre-currency'
version = '3.0.0'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
[dependencies]
# external dependencies
codec = {default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '2.0.0'}
# Substrate dependencies
frame-benchmarking = {default-features = false, optional = true, version = '3.1.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
frame-support = {default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
frame-system = {default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
[dev-dependencies]
serde = '1.0.119'
sp-core = {default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
sp-io = {default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
sp-runtime = {default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'}
[features]
default = ['std']
runtime-benchmarks = ['frame-benchmarking']
std = [
'codec/std',
'frame-support/std',
'frame-system/std',
'frame-benchmarking/std',
]
try-runtime = ['frame-support/try-runtime']
License: GNU AGPL v3
\ No newline at end of file
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
//! Benchmarking setup for pallet-template
use super::*;
#[allow(unused)]
use crate::Pallet as Template;
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
use frame_system::RawOrigin;
benchmarks! {
do_something {
let s in 0 .. 100;
let caller: T::AccountId = whitelisted_caller();
}: _(RawOrigin::Signed(caller), s)
verify {
assert_eq!(Something::<T>::get(), Some(s));
}
}
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test,);
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// <https://substrate.dev/docs/en/knowledgebase/runtime/frame>
pub use pallet::*;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
#[frame_support::pallet]
pub mod pallet {
use frame_support::{dispatch::DispatchResult, pallet_prelude::*};
use frame_system::pallet_prelude::*;
/// Configure the pallet by specifying the parameters and types on which it depends.
#[pallet::config]
pub trait Config: frame_system::Config {
/// Because this pallet emits events, it depends on the runtime's definition of an event.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
}
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);
// The pallet's runtime storage items.
// https://substrate.dev/docs/en/knowledgebase/runtime/storage
#[pallet::storage]
#[pallet::getter(fn something)]
// Learn more about declaring storage items:
// https://substrate.dev/docs/en/knowledgebase/runtime/storage#declaring-storage-items
pub type Something<T> = StorageValue<_, u32>;
// Pallets use events to inform users when important changes are made.
// https://substrate.dev/docs/en/knowledgebase/runtime/events
#[pallet::event]
#[pallet::metadata(T::AccountId = "AccountId")]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// Event documentation should end with an array that provides descriptive names for event
/// parameters. [something, who]
SomethingStored(u32, T::AccountId),
}
// Errors inform users that something went wrong.
#[pallet::error]
pub enum Error<T> {
/// Error names should be descriptive.
NoneValue,
/// Errors should have helpful documentation associated with them.
StorageOverflow,
}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
// Dispatchable functions allows users to interact with the pallet and invoke state changes.
// These functions materialize as "extrinsics", which are often compared to transactions.
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
#[pallet::call]
impl<T: Config> Pallet<T> {
/// An example dispatchable that takes a singles value as a parameter, writes the value to
/// storage and emits an event. This function must be dispatched by a signed extrinsic.
#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
// Check that the extrinsic was signed and get the signer.
// This function will return an error if the extrinsic is not signed.
// https://substrate.dev/docs/en/knowledgebase/runtime/origin
let who = ensure_signed(origin)?;
// Update storage.
<Something<T>>::put(something);
// Emit an event.
Self::deposit_event(Event::SomethingStored(something, who));
// Return a successful DispatchResultWithPostInfo
Ok(())
}
/// An example dispatchable that may throw a custom error.
#[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
pub fn cause_error(origin: OriginFor<T>) -> DispatchResult {
let _who = ensure_signed(origin)?;
// Read a value from storage.
match <Something<T>>::get() {
// Return an error if the value has not been set.
None => Err(Error::<T>::NoneValue)?,
Some(old) => {
// Increment the value read from storage; will error in the event of overflow.
let new = old.checked_add(1).ok_or(Error::<T>::StorageOverflow)?;
// Update the value in storage with the incremented result.
<Something<T>>::put(new);
Ok(())
}
}
}
}
}
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
use crate as pallet_template;
use frame_support::parameter_types;
use frame_system as system;
use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
};
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
// Configure a mock runtime to test the pallet.
frame_support::construct_runtime!(
pub enum Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
TemplateModule: pallet_template::{Pallet, Call, Storage, Event<T>},
}
);
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const SS58Prefix: u8 = 42;
}
impl system::Config for Test {
type BaseCallFilter = ();
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = SS58Prefix;
type OnSetCode = ();
}
impl pallet_template::Config for Test {
type Event = Event;
}
// Build genesis storage according to the mock runtime.
pub fn new_test_ext() -> sp_io::TestExternalities {
system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap()
.into()
}
// Copyright 2021 Axiom-Team
//
// This file is part of Substrate-Libre-Currency.
//
// Substrate-Libre-Currency is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Substrate-Libre-Currency 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
use crate::{mock::*, Error};
use frame_support::{assert_noop, assert_ok};
#[test]
fn it_works_for_default_value() {
new_test_ext().execute_with(|| {
// Dispatch a signed extrinsic.
assert_ok!(TemplateModule::do_something(Origin::signed(1), 42));
// Read pallet storage and assert an expected result.
assert_eq!(TemplateModule::something(), Some(42));
});
}
#[test]
fn correct_error_for_none_value() {
new_test_ext().execute_with(|| {
// Ensure the expected error is thrown when no value is present.
assert_noop!(
TemplateModule::cause_error(Origin::signed(1)),
Error::<Test>::NoneValue
);
});
}
......@@ -25,28 +25,28 @@ try-runtime = ['frame-support/try-runtime']
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '2.1.0'
version = '2.2.0'
[dependencies.frame-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
### DOC ###
......@@ -60,19 +60,19 @@ version = '1.0.119'
[dev-dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
......@@ -26,38 +26,38 @@ try-runtime = ['frame-support/try-runtime']
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '2.1.0'
version = '2.2.0'
[dependencies.frame-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-arithmetic]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
### DOC ###
......@@ -70,7 +70,7 @@ targets = ['x86_64-unknown-linux-gnu']
[dev-dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.serde]
features = ["derive"]
......@@ -79,14 +79,14 @@ version = '1.0.119'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
tag = 'monthly-2021-08'
......@@ -175,7 +175,7 @@ pub mod pallet {
// https://substrate.dev/docs/en/knowledgebase/runtime/events
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pallet::metadata(T::AccountId = "AccountId")]
#[pallet::metadata(T::AccountId = "AccountId", BalanceOf<T> = "Balance")]
pub enum Event<T: Config> {
/// A new universal dividend is created
/// [ud_amout, members_count]
......
......@@ -18,7 +18,7 @@ use super::*;
use crate::{self as pallet_universal_dividend};
use frame_support::{
parameter_types,
traits::{Get, OnFinalize, OnInitialize},
traits::{AllowAll, Get, OnFinalize, OnInitialize},
};
use frame_system as system;
use sp_core::H256;
......@@ -52,7 +52,7 @@ parameter_types! {
}
impl system::Config for Test {
type BaseCallFilter = ();
type BaseCallFilter = AllowAll;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
......
......@@ -39,19 +39,17 @@ smallvec = "1.6.1"
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '2.1.0'
version = '2.2.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.serde]
version = "1.0.101"
......@@ -61,23 +59,19 @@ features = ["derive"]
[dependencies.sp-arithmetic]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-07'
version = '3.0.0'
tag = 'monthly-2021-08'