Skip to content

Conversation

@dvc94ch
Copy link
Contributor

@dvc94ch dvc94ch commented Aug 7, 2019

.expect("account nonce is a map")
.key(&account_id);
let client = (*self).clone();
self.fetch_or_default(account_nonce_key).map(|nonce| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also allow user supplied nonce to allow client side incrementing, as you originally suggested.

let mut rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(f)
#[derive(Clone, PartialEq, Eq)]
struct Runtime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for defining this test runtime? Types look mostly the same except Balances::OnFreeBalanceZero

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure that the only thing required for it to work is implementing srml_system::Trait and srml_balances::Trait. If we just use the Runtime, we might miss some other trait bounds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually only srml_system::Trait which is required.

srml_system::CheckEra<Runtime>,
srml_system::CheckNonce<Runtime>,
srml_system::CheckWeight<Runtime>,
srml_balances::TakeFees<Runtime>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we just used node_runtime::Runtime here we could at least not require the local srml_balances::Trait impl. Though I think I am missing why this is needed

}

impl StorageMetadata {
pub fn map(&self) -> Option<StorageMap> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename this storage_map or something. map says to me Functor

Copy link
Contributor

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But those are only minor things, overall LGTM

@ascjones ascjones merged commit 19604e8 into paritytech:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants