Conversation
xlc
left a comment
There was a problem hiding this comment.
Should have some more tests for imbalance creation (via withdraw / deposit) and non-trivial Currency method implementation.
shaunxw
left a comment
There was a problem hiding this comment.
Some nitpicks. And could you add a unit test for the pallet currency adapter, just a basic transfer should be fine.
tokens/src/lib.rs
Outdated
| fn slash(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> Self::Balance { | ||
| if amount.is_zero() { | ||
| return amount; | ||
| return Zero::zero(); |
There was a problem hiding this comment.
Hmm, why creating a new Zero value instead of just return amount as zero?
There was a problem hiding this comment.
https://github.com/paritytech/substrate/blob/master/frame/balances/src/lib.rs#L1037
Refer here. You are right, I'll recover it.
| } | ||
|
|
||
| type AccountId = u128; | ||
| type AccountId = u64; |
There was a problem hiding this comment.
impl Contains<u64> for TenToFourteen {
Other defines are u64, it is more convenient to modify here
| type KickedMember = (); | ||
| type BadReport = (); | ||
| type WeightInfo = (); | ||
| } |
There was a problem hiding this comment.
Maybe I missed something, but didn't see any usage for the new added mocks.
There was a problem hiding this comment.
Because pallet_elections_phragmen and pallet_treasury module dispatch is private function. Maybe I can test it from genesis config.
Closes: #247