Skip to content
Snippets Groups Projects
Unverified Commit 675b55c3 authored by bgallois's avatar bgallois
Browse files

fix review errors

parent 57882bd5
No related branches found
No related tags found
No related merge requests found
Pipeline #35713 waiting for manual action
......@@ -201,7 +201,7 @@ pub async fn run(
{
members.insert(member_idty, 0);
}
//HERE
let min_certs_for_referee = (members.len() as f32).powf(1. / (max_depth as f32)).ceil() as u32;
// idty -> received certs
......
......@@ -4,6 +4,7 @@ Feature: Oneshot account
When charlie sends 7 ĞD to dave
# Cover the oneshot calls fees
When alice sends 7 ĞD to oneshot dave
# Alice is treasury funder for 1 ĞD and pays fees
Then alice should have 200 cĞD
Then dave should have oneshot 7 ĞD
When oneshot dave consumes into account bob
......
......@@ -248,20 +248,6 @@ where
})
.transpose()?;
/*let heap_pages = config
.default_heap_pages
.map_or(sc_executor::DEFAULT_HEAP_ALLOC_STRATEGY, |h| sc_executor::HeapAllocStrategy::Static {
extra_pages: h as _,
});
let executor = WasmExecutor::<HostFunctions>::builder()
.with_execution_method(config.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.build();*/
let executor = sc_service::new_wasm_executor(config);
let (client, backend, keystore_container, task_manager) =
......
......@@ -490,6 +490,7 @@ impl sc_client_api::StorageProvider<Block, super::FullBackend> for Client {
match_client!(self, child_storage_hash(hash, child_info, key))
}
// Given a block's hash and a key, return the closest merkle value.
fn closest_merkle_value(
&self,
hash: <Block as BlockT>::Hash,
......@@ -498,6 +499,7 @@ impl sc_client_api::StorageProvider<Block, super::FullBackend> for Client {
match_client!(self, closest_merkle_value(hash, key))
}
// Given a block's hash and a key and a child storage key, return the closest merkle value.
fn child_closest_merkle_value(
&self,
hash: <Block as BlockT>::Hash,
......
......@@ -491,6 +491,12 @@ type RuntimeFreezeReason = ();
type WeightInfo = common_runtime::weights::pallet_identity::WeightInfo<Runtime>;
}
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>;
}
impl pallet_membership::Config for Runtime {
type CheckMembershipOpAllowed = Wot;
type IdtyId = IdtyIndex;
......
......@@ -233,67 +233,62 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType {
}
}
common_runtime::pallets_config! {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>;
}
}
// Configure pallets to include in runtime.
common_runtime::pallets_config! {}
// Create the runtime by composing the pallets that were previously configured.
construct_runtime!(
pub enum Runtime
{
// Basic stuff
System: frame_system,
Account: pallet_duniter_account,
Scheduler: pallet_scheduler,
System: frame_system = 0,
Account: pallet_duniter_account = 1,
Scheduler: pallet_scheduler = 2,
// Block creation
Babe: pallet_babe,
Timestamp: pallet_timestamp,
Babe: pallet_babe = 3,
Timestamp: pallet_timestamp = 4,
// Money management
Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment,
OneshotAccount: pallet_oneshot_account,
Quota: pallet_quota,
Balances: pallet_balances = 6,
TransactionPayment: pallet_transaction_payment = 32,
OneshotAccount: pallet_oneshot_account = 7,
Quota: pallet_quota = 66,
// Consensus support.
SmithMembers: pallet_smith_members,
AuthorityMembers: pallet_authority_members,
Authorship: pallet_authorship,
Offences: pallet_offences,
Historical: session_historical,
Session: pallet_session,
Grandpa: pallet_grandpa,
ImOnline: pallet_im_online,
AuthorityDiscovery: pallet_authority_discovery,
// Consensus support
SmithMembers: pallet_smith_members = 10,
AuthorityMembers: pallet_authority_members = 11,
Authorship: pallet_authorship = 12,
Offences: pallet_offences = 13,
Historical: session_historical = 14,
Session: pallet_session = 15,
Grandpa: pallet_grandpa= 16,
ImOnline: pallet_im_online = 17,
AuthorityDiscovery: pallet_authority_discovery = 18,
// Governance stuff.
Sudo: pallet_sudo,
UpgradeOrigin: pallet_upgrade_origin,
Preimage: pallet_preimage,
TechnicalCommittee: pallet_collective::<Instance2>,
// Governance stuff
Sudo: pallet_sudo = 20,
UpgradeOrigin: pallet_upgrade_origin = 21,
Preimage: pallet_preimage = 22,
TechnicalCommittee: pallet_collective::<Instance2> = 23,
// Universal dividend
UniversalDividend: pallet_universal_dividend,
UniversalDividend: pallet_universal_dividend = 30,
// Web Of Trust
Wot: pallet_duniter_wot,
Identity: pallet_identity,
Membership: pallet_membership,
Certification: pallet_certification,
Distance: pallet_distance,
Wot: pallet_duniter_wot = 40,
Identity: pallet_identity = 41,
Membership: pallet_membership = 42,
Certification: pallet_certification = 43,
Distance: pallet_distance = 44,
// Utilities
AtomicSwap: pallet_atomic_swap,
Multisig: pallet_multisig,
ProvideRandomness: pallet_provide_randomness,
Proxy: pallet_proxy,
Utility: pallet_utility,
Treasury: pallet_treasury,
AtomicSwap: pallet_atomic_swap = 50,
Multisig: pallet_multisig = 51,
ProvideRandomness: pallet_provide_randomness = 52,
Proxy: pallet_proxy = 53,
Utility: pallet_utility = 54,
Treasury: pallet_treasury = 55,
}
);
......
......@@ -276,70 +276,63 @@ common_runtime::pallets_config! {
type PeriodCount = Balance;
type SessionCount = u32;
}
// TO DO MOVE TO COMMON
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>;
}
}
// Create the runtime by composing the pallets that were previously configured.
construct_runtime!(
pub enum Runtime {
// Basic stuff
System: frame_system,
Account: pallet_duniter_account,
Scheduler: pallet_scheduler,
System: frame_system = 0,
Account: pallet_duniter_account = 1,
Scheduler: pallet_scheduler = 2,
// Block creation
Babe: pallet_babe,
Timestamp: pallet_timestamp,
Babe: pallet_babe = 3,
Timestamp: pallet_timestamp = 4,
// Test parameters
Parameters: pallet_duniter_test_parameters,
Parameters: pallet_duniter_test_parameters = 5,
// Money management
Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment,
OneshotAccount: pallet_oneshot_account,
Quota: pallet_quota,
Balances: pallet_balances = 6,
TransactionPayment: pallet_transaction_payment = 32,
OneshotAccount: pallet_oneshot_account = 7,
Quota: pallet_quota = 66,
// Consensus support
SmithMembers: pallet_smith_members,
AuthorityMembers: pallet_authority_members,
Authorship: pallet_authorship,
Offences: pallet_offences,
Historical: session_historical,
Session: pallet_session,
Grandpa: pallet_grandpa,
ImOnline: pallet_im_online,
AuthorityDiscovery: pallet_authority_discovery,
SmithMembers: pallet_smith_members = 10,
AuthorityMembers: pallet_authority_members = 11,
Authorship: pallet_authorship = 12,
Offences: pallet_offences = 13,
Historical: session_historical = 14,
Session: pallet_session = 15,
Grandpa: pallet_grandpa= 16,
ImOnline: pallet_im_online = 17,
AuthorityDiscovery: pallet_authority_discovery = 18,
// Governance stuff
Sudo: pallet_sudo,
UpgradeOrigin: pallet_upgrade_origin,
Preimage: pallet_preimage,
TechnicalCommittee: pallet_collective::<Instance2>,
Sudo: pallet_sudo = 20,
UpgradeOrigin: pallet_upgrade_origin = 21,
Preimage: pallet_preimage = 22,
TechnicalCommittee: pallet_collective::<Instance2> = 23,
// Universal dividend
UniversalDividend: pallet_universal_dividend,
UniversalDividend: pallet_universal_dividend = 30,
// Web Of Trust
Wot: pallet_duniter_wot,
Identity: pallet_identity,
Membership: pallet_membership,
Certification: pallet_certification,
Distance: pallet_distance,
Wot: pallet_duniter_wot = 40,
Identity: pallet_identity = 41,
Membership: pallet_membership = 42,
Certification: pallet_certification = 43,
Distance: pallet_distance = 44,
// Utilities
AtomicSwap: pallet_atomic_swap,
Multisig: pallet_multisig,
ProvideRandomness: pallet_provide_randomness,
Proxy: pallet_proxy,
Utility: pallet_utility,
Treasury: pallet_treasury,
AtomicSwap: pallet_atomic_swap = 50,
Multisig: pallet_multisig = 51,
ProvideRandomness: pallet_provide_randomness = 52,
Proxy: pallet_proxy = 53,
Utility: pallet_utility = 54,
Treasury: pallet_treasury = 55,
}
);
......
......@@ -160,6 +160,7 @@ mod benches {
[pallet_multisig, Multisig]
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_sudo, Sudo]
[pallet_scheduler, Scheduler]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
......@@ -239,68 +240,61 @@ impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType {
}
// Configure pallets to include in runtime.
common_runtime::pallets_config! {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = common_runtime::weights::pallet_sudo::WeightInfo<Runtime>;
}
}
common_runtime::pallets_config! {}
// Create the runtime by composing the pallets that were previously configured.
construct_runtime!(
pub enum Runtime
{
// Basic stuff
System: frame_system,
Account: pallet_duniter_account,
Scheduler: pallet_scheduler,
System: frame_system = 0,
Account: pallet_duniter_account = 1,
Scheduler: pallet_scheduler = 2,
// Block creation
Babe: pallet_babe,
Timestamp: pallet_timestamp,
Babe: pallet_babe = 3,
Timestamp: pallet_timestamp = 4,
// Money management
Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment,
OneshotAccount: pallet_oneshot_account,
Quota: pallet_quota,
Balances: pallet_balances = 6,
TransactionPayment: pallet_transaction_payment = 32,
OneshotAccount: pallet_oneshot_account = 7,
Quota: pallet_quota = 66,
// Consensus support
SmithMembers: pallet_smith_members,
AuthorityMembers: pallet_authority_members,
Authorship: pallet_authorship,
Offences: pallet_offences,
Historical: session_historical,
Session: pallet_session,
Grandpa: pallet_grandpa,
ImOnline: pallet_im_online,
AuthorityDiscovery: pallet_authority_discovery,
SmithMembers: pallet_smith_members = 10,
AuthorityMembers: pallet_authority_members = 11,
Authorship: pallet_authorship = 12,
Offences: pallet_offences = 13,
Historical: session_historical = 14,
Session: pallet_session = 15,
Grandpa: pallet_grandpa= 16,
ImOnline: pallet_im_online = 17,
AuthorityDiscovery: pallet_authority_discovery = 18,
// Governance stuff
Sudo: pallet_sudo,
UpgradeOrigin: pallet_upgrade_origin,
Preimage: pallet_preimage,
TechnicalCommittee: pallet_collective::<Instance2>,
Sudo: pallet_sudo = 20,
UpgradeOrigin: pallet_upgrade_origin = 21,
Preimage: pallet_preimage = 22,
TechnicalCommittee: pallet_collective::<Instance2> = 23,
// Universal dividend
UniversalDividend: pallet_universal_dividend,
UniversalDividend: pallet_universal_dividend = 30,
// Web Of Trust
Wot: pallet_duniter_wot,
Identity: pallet_identity,
Membership: pallet_membership,
Certification: pallet_certification,
Distance: pallet_distance,
Wot: pallet_duniter_wot = 40,
Identity: pallet_identity = 41,
Membership: pallet_membership = 42,
Certification: pallet_certification = 43,
Distance: pallet_distance = 44,
// Utilities
AtomicSwap: pallet_atomic_swap,
Multisig: pallet_multisig,
ProvideRandomness: pallet_provide_randomness,
Proxy: pallet_proxy,
Utility: pallet_utility,
Treasury: pallet_treasury,
AtomicSwap: pallet_atomic_swap = 50,
Multisig: pallet_multisig = 51,
ProvideRandomness: pallet_provide_randomness = 52,
Proxy: pallet_proxy = 53,
Utility: pallet_utility = 54,
Treasury: pallet_treasury = 55,
}
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment