Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/plmc 412 on initialize benchmarks #159

Merged
merged 228 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 223 commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
e7cf200
feat(287): parachain information discovery and channel opening
JuaniRios Oct 9, 2023
b0e0258
first commit
JuaniRios Oct 26, 2023
01fbe0a
save
JuaniRios Oct 27, 2023
396e1c8
penpal local fork
JuaniRios Oct 30, 2023
8549be2
save
JuaniRios Oct 30, 2023
3fd4ee0
save
JuaniRios Oct 31, 2023
b272479
save
JuaniRios Nov 7, 2023
4aeb55e
HRMP establishment successfully mocked!
JuaniRios Nov 7, 2023
223c4cd
pallet-funding tests fixed
JuaniRios Nov 7, 2023
f96b048
migration check working
JuaniRios Nov 8, 2023
5713267
Merge branch 'main' into feature/plmc-288-receiver-pallet
JuaniRios Nov 8, 2023
3782ac6
fixes
JuaniRios Nov 8, 2023
85e817f
add cargo lock
JuaniRios Nov 8, 2023
f76ad0e
dmp fix
JuaniRios Nov 9, 2023
373345e
formatting
JuaniRios Nov 9, 2023
94f4229
small fixed
JuaniRios Nov 9, 2023
6801c51
fixes
JuaniRios Nov 9, 2023
25d5919
Merge branch 'main' into feature/plmc-290-xcm-instruction-that-reveal…
JuaniRios Nov 9, 2023
258746f
save
JuaniRios Nov 10, 2023
483dd10
compiling, unit converion to map
JuaniRios Nov 10, 2023
3c22eda
revert staking changes
JuaniRios Nov 13, 2023
308b955
saving now evaluation reward and move to u64 for migration
JuaniRios Nov 13, 2023
f1bae11
save
JuaniRios Nov 13, 2023
154ee8a
save
JuaniRios Nov 13, 2023
79adcc9
migration is successfully sent and reflected in the system
JuaniRios Nov 14, 2023
88eeb2a
vesting scheduling working in polimec-receiver
JuaniRios Nov 14, 2023
62adc46
save: starting to implement transact response, but we need to store a…
JuaniRios Nov 14, 2023
85bdfb9
save
JuaniRios Nov 15, 2023
1b4d8bb
Migration for a single user working fully and tested
JuaniRios Nov 15, 2023
7d27c36
Everything works!
JuaniRios Nov 15, 2023
26ae34e
pallet_funding test broken currently
JuaniRios Nov 15, 2023
5275f2f
bug found in evaluation unbonding by cleaner. Still an infinite loop …
JuaniRios Nov 16, 2023
41a3465
all bugs squashed B)
JuaniRios Nov 16, 2023
1888e79
Merge branch 'main' into feature/plmc-290-xcm-instruction-that-reveal…
JuaniRios Nov 16, 2023
a8e5dff
Merge branch 'feature/plmc-290-xcm-instruction-that-reveals-polimecs-…
JuaniRios Nov 16, 2023
0095a22
need to find a way to generate function from a new macro
JuaniRios Nov 16, 2023
f1c8bfa
need to find a way to generate function from a new macro
JuaniRios Nov 17, 2023
a87cff2
e2e tests successfully adapted to the xcm emulator
JuaniRios Nov 21, 2023
a65814a
Testnet now using Oracle, and e2e successfully passing.
JuaniRios Nov 21, 2023
9c0b29b
not all xcmp messages being received
JuaniRios Nov 21, 2023
bd07a48
save
JuaniRios Nov 22, 2023
901d741
cleanup
JuaniRios Nov 23, 2023
9c627a8
fmt
JuaniRios Nov 23, 2023
251882b
Merge branch 'main' into feature/plmc-291-extrinsic-that-does-one-mig…
JuaniRios Nov 23, 2023
d0b1827
fixes
JuaniRios Nov 23, 2023
1d72b75
Merge branch 'feature/plmc-291-extrinsic-that-does-one-migration' int…
JuaniRios Nov 23, 2023
c10f4d6
save
JuaniRios Nov 24, 2023
c0d2451
limiting 5 migrations per block works
JuaniRios Nov 28, 2023
899c258
Merge branch 'main' into feature/plmc-359-migrations-being-put-into-o…
JuaniRios Nov 28, 2023
c698ce8
fmt
JuaniRios Nov 28, 2023
5cb739f
save
JuaniRios Nov 28, 2023
4e0a6c3
back to normal migration without bundling per block, now works for so…
JuaniRios Nov 28, 2023
ad0bdc0
final commit
JuaniRios Nov 29, 2023
0780656
first commit
JuaniRios Nov 29, 2023
8a098bd
ct migration tests refactor
JuaniRios Nov 29, 2023
90558f0
stable
JuaniRios Nov 29, 2023
6b03214
using generate_accounts! macro in all integration tests
JuaniRios Nov 30, 2023
6401c3c
wip
JuaniRios Nov 30, 2023
e5a27e2
big refactor
JuaniRios Nov 30, 2023
18ec093
almost there
JuaniRios Nov 30, 2023
968c6e1
working
JuaniRios Dec 1, 2023
f5c51f3
Merge branch 'main' into feature/plmc-365-disallow-duplicated-migrati…
JuaniRios Dec 4, 2023
7c37160
final changes
JuaniRios Dec 4, 2023
80a14cf
tests passing
JuaniRios Dec 5, 2023
9a0a32d
multiple projects test passing.
JuaniRios Dec 5, 2023
ed61665
state machine intergration for releasing deposit
JuaniRios Dec 5, 2023
d978e06
starting to fix last tests
JuaniRios Dec 5, 2023
ab61caf
only evaluation automatic release working.
JuaniRios Dec 6, 2023
b80d50d
state machine fixed where it only worked on evaluations
JuaniRios Dec 6, 2023
98280ae
broken tests
JuaniRios Dec 6, 2023
9370b2c
save
JuaniRios Dec 7, 2023
fe2ba74
manual and automatic ct mint tests now passing. Removed the specific …
JuaniRios Dec 7, 2023
e9dd2b0
fixed most tests. Bid calculation function not working as intended now
JuaniRios Dec 11, 2023
2df11c1
benchmark tests passing
JuaniRios Dec 11, 2023
2b78c68
fmt. real benchmarks run successfully
JuaniRios Dec 11, 2023
d465582
fmt after merge
JuaniRios Dec 12, 2023
1a76ece
save
JuaniRios Dec 12, 2023
aaf9850
fixes
JuaniRios Dec 12, 2023
99f0c87
remove unnecessary time advancement in project creation
JuaniRios Dec 13, 2023
8b21bb2
MVP!
JuaniRios Dec 13, 2023
797c3ed
multiple community projects can be parallelized
JuaniRios Dec 14, 2023
963f027
all async creation functions working
JuaniRios Dec 14, 2023
aad3f8e
bid refund test not passing
JuaniRios Dec 14, 2023
7117d84
fixed
JuaniRios Dec 14, 2023
3607332
projects meeting together at the desired state (they start at differe…
JuaniRios Dec 15, 2023
5ca32f7
save
JuaniRios Dec 18, 2023
acb601b
fixed tests. they were failing due to debug durations not disabled
JuaniRios Dec 18, 2023
441bbed
traits broken :(
JuaniRios Dec 18, 2023
8a525ca
save
JuaniRios Dec 18, 2023
937a97f
conditionally adding genesis config
JuaniRios Jan 3, 2024
59dc6e8
Fixed the externalities issue by using the single threaded tokio runt…
JuaniRios Jan 3, 2024
c48caa5
removed conditional instantiator fields and conditional genesis confi…
JuaniRios Jan 4, 2024
b6f27fb
fixes
JuaniRios Jan 4, 2024
2544d0f
trying to remove Sync and Send traits
JuaniRios Jan 4, 2024
44861bf
trying to have one genesis config
JuaniRios Jan 4, 2024
8d60746
save
JuaniRios Jan 4, 2024
68fb714
save
JuaniRios Jan 4, 2024
574a8ac
save
JuaniRios Jan 4, 2024
dcf41d5
build-spec working but some logic in instantiator is failing bids
JuaniRios Jan 4, 2024
28da8b4
node instantiation confirmed to be working, and a test was written in…
JuaniRios Jan 5, 2024
df4390e
fix: fmt
JuaniRios Jan 8, 2024
a29c351
fix tests
JuaniRios Jan 8, 2024
ada8e8c
Merge remote-tracking branch 'origin/main' into feature/plmc-391-allo…
JuaniRios Jan 8, 2024
b8af2ad
merge fixes
JuaniRios Jan 8, 2024
89b3868
new test
JuaniRios Jan 8, 2024
92eaf58
remove testing-node feature
JuaniRios Jan 9, 2024
405cdf2
remove cargo-expand-visible feature and unused modular genesis_config.rs
JuaniRios Jan 9, 2024
6c8198e
remove unused mut https://github.com/Polimec/polimec-node/pull/130#di…
JuaniRios Jan 9, 2024
f9c3411
remove unused mut https://github.com/Polimec/polimec-node/pull/130#di…
JuaniRios Jan 9, 2024
dcba4f2
TODO added https://github.com/Polimec/polimec-node/pull/130#discussio…
JuaniRios Jan 9, 2024
9149b14
remove unused old genesis builder https://github.com/Polimec/polimec-…
JuaniRios Jan 10, 2024
13e97de
remove else statement https://github.com/Polimec/polimec-node/pull/13…
JuaniRios Jan 10, 2024
c60ad31
remove commented out lines https://github.com/Polimec/polimec-node/pu…
JuaniRios Jan 10, 2024
6775336
remove AccountList and use same pattern as other functions https://gi…
JuaniRios Jan 10, 2024
fba9d69
updated comment on Expendable reason
JuaniRios Jan 10, 2024
68f9e38
fix: could not compile pallet-funding alone due to missing `default =…
JuaniRios Jan 12, 2024
09ecb40
save
JuaniRios Jan 11, 2024
fc02b00
fix linear-release benchmarks
JuaniRios Jan 12, 2024
dab1d80
fix staking benchmarks and add optional compilation for externalities…
JuaniRios Jan 12, 2024
2ae3fec
pallet_funding benchmarks fixed.
JuaniRios Jan 15, 2024
e0c6466
uncommented integration-tests. Had to do it to compile workspace with…
JuaniRios Jan 15, 2024
9f02b4c
all benchmarks running to completion
JuaniRios Jan 15, 2024
dd83dd9
Merge branch 'main' into feature/plmc-391-allow-parallel-instantiaton…
JuaniRios Jan 15, 2024
797ebf6
Merge branch 'feature/plmc-391-allow-parallel-instantiaton-of-project…
JuaniRios Jan 15, 2024
c152e8f
save
JuaniRios Jan 15, 2024
1a60a77
fix testnet runtime, bad merge with main
JuaniRios Jan 15, 2024
03e916c
fix import
JuaniRios Jan 15, 2024
ff42fde
Merge branch 'feature/plmc-391-allow-parallel-instantiaton-of-project…
JuaniRios Jan 15, 2024
57516e2
fixed staking benchmarks
JuaniRios Jan 15, 2024
3d55eed
cleanup
JuaniRios Jan 15, 2024
e476f50
uncomment integration-tests
JuaniRios Jan 15, 2024
6daf6f9
remove pallet_funding dependency from linear-release
JuaniRios Jan 16, 2024
98e042b
write single test for each benchmark
JuaniRios Jan 16, 2024
17bff14
successfully added the async parallel instantiaton in a real benchmar…
JuaniRios Jan 16, 2024
7b43850
save
JuaniRios Jan 16, 2024
aed2701
save
JuaniRios Jan 16, 2024
c38d546
rename start_evaluation fn
JuaniRios Jan 17, 2024
5f12720
Merge branch 'main' into feature/plmc-267-add-complexity-parameters-t…
JuaniRios Jan 17, 2024
0a7a408
remove unnecessary parameters from `create` and `edit_metadata`
JuaniRios Jan 17, 2024
43b6fcc
fix testnet pallet config
JuaniRios Jan 17, 2024
d5c691c
changed add_to_update_store
JuaniRios Jan 17, 2024
31dee57
check tests pass, add new draft tests
JuaniRios Jan 17, 2024
8f959a6
add_to_update_store benchmark in start_evaluation
JuaniRios Jan 19, 2024
db3ffb9
new pr template
JuaniRios Jan 19, 2024
3d39384
only one pr template
JuaniRios Jan 19, 2024
7f1fefb
new ProjectToUpdate functions that return parameters for weight funct…
JuaniRios Jan 19, 2024
45417be
fixed eval start bench
JuaniRios Jan 22, 2024
3b1ae08
fix manual auction benchmark
JuaniRios Jan 22, 2024
285b4ed
english_start benchmarked
JuaniRios Jan 22, 2024
ccddcb7
trying to remove `z` and add automatic auction bench
JuaniRios Jan 22, 2024
bdb40db
finished automatic auction benchmark, now running it for real
JuaniRios Jan 22, 2024
4f51f36
new weight gen
JuaniRios Jan 22, 2024
d4ae47c
evaluation benchmarks. fix auction round extrinsic
JuaniRios Jan 23, 2024
b3bde81
save contributions extrinsic
JuaniRios Jan 24, 2024
b3c3c54
contribution logic split into separate functions
JuaniRios Jan 24, 2024
4adf124
all contribution bench branches coded. Missing single tests and using…
JuaniRios Jan 24, 2024
c568fab
contribute benches tested and passing. Missing real benchmarking and …
JuaniRios Jan 25, 2024
24debe6
contribution_over_limit_ends_round removed since that case never happens
JuaniRios Jan 26, 2024
b608009
abstracted away `ProjectsToUpdate` filling
JuaniRios Jan 26, 2024
0bf8c7a
weight gen v2
JuaniRios Jan 26, 2024
336bc3c
added weight returns on contribute()
JuaniRios Jan 26, 2024
3dd0467
all tests for benches rewritten so far are passing
JuaniRios Jan 26, 2024
5240041
added ct_deposit difference benchmarks for first contribution. Bench …
JuaniRios Jan 29, 2024
c5d4a17
weight generated. Seems off
JuaniRios Jan 29, 2024
87c731c
rename benches
JuaniRios Jan 29, 2024
10c0293
modify contribution function to return new bench fns
JuaniRios Jan 29, 2024
04b0bef
removed chance to bid over the limit by removing the lowest bid.
JuaniRios Jan 29, 2024
83519f1
bid benchmark abstracted for future complexity parametrization
JuaniRios Jan 29, 2024
7012669
complexity parameter `x` working (existing bids). Missing `y` for tim…
JuaniRios Jan 29, 2024
22ea003
new parameter "y" for amount of perform_bid calls on one extrinsic
JuaniRios Jan 29, 2024
20483f4
remove unused bucket helper function
JuaniRios Jan 29, 2024
4f634d6
ct deposit bid benchmark difference
JuaniRios Jan 30, 2024
19d0998
real weight returns added for bid extrinsic. Trying to update now pri…
JuaniRios Jan 30, 2024
b45d212
updated test, but still inaccurate. 11.1818 vs 11
JuaniRios Jan 30, 2024
da210f5
evaluation_unbond_for does not need complexity parameters
JuaniRios Jan 31, 2024
dff3c61
bug fixed in instantiator where multiple evaluations by same account …
JuaniRios Jan 31, 2024
1ad6042
real weight returns on evaluation reward payouts
JuaniRios Jan 31, 2024
1cd30e4
default weight on fn
JuaniRios Jan 31, 2024
cb6fd91
evaluation slash does not need complexity parameters or logic branches
JuaniRios Jan 31, 2024
661e684
test for bench now passing. had to modify the state machine, but we w…
JuaniRios Jan 31, 2024
37bb2ad
bid_ct_mint_for done
JuaniRios Jan 31, 2024
64eb4ec
contribution_ct_mint_for done
JuaniRios Jan 31, 2024
625a82f
contribution_ct_mint_for done
JuaniRios Jan 31, 2024
d4ebc0c
vesting schedule benchmarks (minimal changes)
JuaniRios Jan 31, 2024
20240ba
payouts benchmarks (minimal changes)
JuaniRios Jan 31, 2024
e5637ee
all benchmarks passing
JuaniRios Jan 31, 2024
32c48a9
price test was correct, fixed the expectation
JuaniRios Feb 1, 2024
b4c357e
save
JuaniRios Feb 1, 2024
809fb95
fix evaluator rewards test
JuaniRios Feb 1, 2024
4eba97d
fmt, remove draft tests
JuaniRios Feb 1, 2024
96076c3
remove unused tests. Add real weights on pallet-funding
JuaniRios Feb 2, 2024
21c8328
delete commented out code
JuaniRios Feb 2, 2024
04728d1
weight returns testing possible :)
JuaniRios Feb 2, 2024
fc30421
removed benchmark tests. we think they are not necessary
JuaniRios Feb 2, 2024
5c422cc
evaluation end both logic paths written
JuaniRios Feb 5, 2024
19c8b4f
unused var
JuaniRios Feb 5, 2024
258e450
weight generated look ok
JuaniRios Feb 5, 2024
33d13bb
candle phase done
JuaniRios Feb 5, 2024
fb82fc4
trying to make community
JuaniRios Feb 5, 2024
46efb8c
remove refund bid on bad math. we now use saturating_mul_int
JuaniRios Feb 5, 2024
bc50059
trying to add complexity params to community round transition
JuaniRios Feb 5, 2024
d58a932
weird allocation bug when running new params bench
JuaniRios Feb 5, 2024
c919475
benchmark taking forever when adding 50k bids. Maybe I should replace…
JuaniRios Feb 6, 2024
49ebe10
weight generated for new community funding success
JuaniRios Feb 6, 2024
0e30a5b
added generated weight to pallet weight file
JuaniRios Feb 6, 2024
2ffe584
weight generated on remainder
JuaniRios Feb 6, 2024
1825e08
project decision weights generated
JuaniRios Feb 6, 2024
2ed5f59
end_funding benches written. Missing complexity parameters
JuaniRios Feb 6, 2024
8aa8cb9
complexity params for funding end written. Advancing blocks taking fo…
JuaniRios Feb 7, 2024
5528f29
save trying to debug time increase
JuaniRios Feb 7, 2024
96917b3
all benches passing and BLAZING FAST 😎
JuaniRios Feb 7, 2024
b5879f1
comment out debug lines
JuaniRios Feb 7, 2024
3393fe3
debug weight generated for end_funding benchmarks
JuaniRios Feb 7, 2024
08ce8ef
BUGFIX: we now charge the issuer on project creation for the CT metad…
JuaniRios Feb 8, 2024
06a8994
fix warnings
JuaniRios Feb 8, 2024
0869767
fix tests
JuaniRios Feb 8, 2024
b875694
fix benchmark
JuaniRios Feb 8, 2024
edb763f
final weights generated
JuaniRios Feb 9, 2024
37e7848
replace weights.rs file
JuaniRios Feb 9, 2024
89de241
Merge branch 'main' into feature/plmc-412-on_initialize-benchmarks
JuaniRios Feb 9, 2024
b4bd740
fmt
JuaniRios Feb 9, 2024
4f49eb2
Merge branch 'main' into feature/plmc-412-on_initialize-benchmarks
JuaniRios Feb 13, 2024
a4a56c8
nightly fmt
JuaniRios Feb 13, 2024
ce5c5a1
update lock
JuaniRios Feb 13, 2024
e474500
assethub naming
JuaniRios Feb 13, 2024
633ee9d
fixes
JuaniRios Feb 13, 2024
7ebf339
remove advance_time performance measurement code
JuaniRios Feb 14, 2024
af9de40
remove unwrap_default for unwrap_or with worst case calculation of we…
JuaniRios Feb 14, 2024
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
111 changes: 56 additions & 55 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate"
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-debug-derive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
Expand Down
53 changes: 53 additions & 0 deletions debug_weight_gen.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

JuaniRios marked this conversation as resolved.
Show resolved Hide resolved
//! Autogenerated weights for `pallet_funding`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-02-08, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `Juans-MacBook-Pro.local`, CPU: `<UNKNOWN>`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("polimec-rococo-local")`, DB CACHE: 1024

// Executed Command:
// target/debug/polimec-parachain-node
// benchmark
// pallet
// --chain=polimec-rococo-local
// --steps=20
// --repeat=10
// --pallet=pallet_funding
// --extrinsic=start_settlement_funding_success,
// --output
// ./debug_weight_gen.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `pallet_funding`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_funding::WeightInfo for WeightInfo<T> {
/// Storage: `PolimecFunding::ProjectsDetails` (r:1 w:1)
/// Proof: `PolimecFunding::ProjectsDetails` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`)
/// Storage: `PolimecFunding::ProjectsMetadata` (r:1 w:0)
/// Proof: `PolimecFunding::ProjectsMetadata` (`max_values`: None, `max_size`: Some(334), added: 2809, mode: `MaxEncodedLen`)
/// Storage: `LocalAssets::Asset` (r:1 w:1)
/// Proof: `LocalAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `LocalAssets::Metadata` (r:1 w:1)
/// Proof: `LocalAssets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn start_settlement_funding_success() -> Weight {
// Proof Size summary in bytes:
// Measured: `970`
// Estimated: `3814`
// Minimum execution time: 542_000_000 picoseconds.
Weight::from_parts(549_000_000, 0)
.saturating_add(Weight::from_parts(0, 3814))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}
}
6 changes: 3 additions & 3 deletions pallets/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ pub mod pallet {
if let Some((ext_proposal, _)) = NextExternal::<T>::get() {
ensure!(proposal_hash == ext_proposal.hash(), Error::<T>::ProposalMissing);
} else {
return Err(Error::<T>::NoProposal.into())
return Err(Error::<T>::NoProposal.into());
}

let mut existing_vetoers = <Blacklist<T>>::get(&proposal_hash).map(|pair| pair.1).unwrap_or_default();
Expand Down Expand Up @@ -1482,7 +1482,7 @@ impl<T: Config> Pallet<T> {
Self::transfer_metadata(MetadataOwner::External, MetadataOwner::Referendum(ref_index));
Ok(())
} else {
return Err(Error::<T>::NoneWaiting.into())
return Err(Error::<T>::NoneWaiting.into());
}
}

Expand Down Expand Up @@ -1512,7 +1512,7 @@ impl<T: Config> Pallet<T> {
}
Ok(())
} else {
return Err(Error::<T>::NoneWaiting.into())
return Err(Error::<T>::NoneWaiting.into());
}
}

Expand Down
10 changes: 5 additions & 5 deletions pallets/democracy/src/vote_threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ fn compare_rationals<T: Zero + Mul<T, Output = T> + Div<T, Output = T> + Rem<T,
let q1 = n1 / d1;
let q2 = n2 / d2;
if q1 < q2 {
return true
return true;
}
if q2 < q1 {
return false
return false;
}
let r1 = n1 % d1;
let r2 = n2 % d2;
if r2.is_zero() {
return false
return false;
}
if r1.is_zero() {
return true
return true;
}
n1 = d2;
n2 = d1;
Expand All @@ -85,7 +85,7 @@ impl<
let sqrt_voters = tally.turnout.integer_sqrt();
let sqrt_electorate = electorate.integer_sqrt();
if sqrt_voters.is_zero() {
return false
return false;
}
match *self {
VoteThreshold::SuperMajorityApprove =>
Expand Down
4 changes: 2 additions & 2 deletions pallets/elections-phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ impl<T: Config> Pallet<T> {

if candidates_and_deposit.len().is_zero() {
Self::deposit_event(Event::EmptyTerm);
return T::DbWeight::get().reads(3)
return T::DbWeight::get().reads(3);
}

// All of the new winners that come out of phragmen will thus have a deposit recorded.
Expand Down Expand Up @@ -921,7 +921,7 @@ impl<T: Config> Pallet<T> {
"Failed to run election. Number of voters exceeded",
);
Self::deposit_event(Event::ElectionError);
return T::DbWeight::get().reads(3 + max_voters as u64)
return T::DbWeight::get().reads(3 + max_voters as u64);
},
}

Expand Down
Loading