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

substrate proposals #275

Merged
merged 8 commits into from
Nov 10, 2022
Merged

substrate proposals #275

merged 8 commits into from
Nov 10, 2022

Conversation

salman01zp
Copy link
Contributor

@salman01zp salman01zp commented Nov 8, 2022

@salman01zp salman01zp marked this pull request as ready for review November 8, 2022 14:22
@salman01zp salman01zp requested review from 1xstj and drewstone November 8, 2022 14:22
Copy link
Contributor

@drewstone drewstone left a comment

Choose a reason for hiding this comment

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

Great work @salman01zp this is a good first go. There are some issues I've commented on but to recap.

We need to track proposal nonces for each resource being updated. For the token wrapper, the resources are the asset metadata (feeRecipient and rescueTokens). Therefore, I think we do still want a map that either maps from resource id or asset id to the nonce that tracks the updates incident on a particular asset. Let me know what you think.

In the Solidity we do have separate setups for each asset, and therefore separate feeRecipients and rescue tokens and proposal nonces for each different deployment.

Also don't forget to add tests of all extrinsics created here and update the benchmarks if possible.

@@ -29,7 +29,7 @@ use frame_support::traits::Currency;
use frame_system::RawOrigin;
use sp_runtime::traits::Bounded;
use webb_primitives::types::DepositDetails;
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::Event) {
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We have this function written 5 or so times, in the future @salman01zp please break it out and de-duplicate the code. Similar to what we are doing with webb.js/test-utils we should be doing something similar here. Creating a test-utils package that eventually lives and gets used by various substrate/rust projects (here it would be Substrate specific for example).

pallets/token-wrapper/src/lib.rs Outdated Show resolved Hide resolved
pallets/vanchor-handler/src/lib.rs Show resolved Hide resolved
@salman01zp
Copy link
Contributor Author

salman01zp commented Nov 9, 2022

We need to track proposal nonces for each resource being updated. For the token wrapper, the resources are the asset metadata (feeRecipient and rescueTokens). Therefore, I think we do still want a map that either maps from resource id or asset id to the nonce that tracks the updates incident on a particular asset. Let me know what you think.

In the Solidity we do have separate setups for each asset, and therefore separate feeRecipients and rescue tokens and proposal nonces for each different deployment.

Okay, so when we update FeeRecipient we update it for the particular Asset.
We can create a separate mapping of (AssetId ,FeeRecipient) and will revert back ProposalNonce to mapping

@drewstone
Copy link
Contributor

drewstone commented Nov 9, 2022 via email

@codecov-commenter
Copy link

Codecov Report

Base: 50.42% // Head: 50.14% // Decreases project coverage by -0.27% ⚠️

Coverage data is based on head (4d9aec2) compared to base (aff141e).
Patch coverage: 44.44% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
- Coverage   50.42%   50.14%   -0.28%     
==========================================
  Files          55       55              
  Lines        2013     2064      +51     
==========================================
+ Hits         1015     1035      +20     
- Misses        998     1029      +31     
Impacted Files Coverage Δ
pallets/hasher/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/key-storage/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/mixer/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/mt/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/relayer-registry/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/signature-bridge/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/token-wrapper-handler/src/lib.rs 40.00% <0.00%> (-26.67%) ⬇️
pallets/token-wrapper/src/benchmarking.rs 0.00% <0.00%> (ø)
pallets/vanchor-handler/src/lib.rs 55.00% <0.00%> (-16.74%) ⬇️
pallets/vanchor-verifier/src/benchmarking.rs 0.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@drewstone drewstone merged commit 78dfefd into main Nov 10, 2022
@drewstone drewstone deleted the salman/webb-proposals branch November 10, 2022 15:16
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.

[TASK] Implement unimplemented protocol-substrate proposals
3 participants