-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add total contract deposit #1347
Conversation
crates/extrinsics/src/lib.rs
Outdated
// From contracts pallet version 10 deposit calculation has changed. | ||
if contract_pallet_version >= 10 { | ||
let existential_deposit_address = | ||
api::constants().balances().existential_deposit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call introduces a dependency on the Balances pallet. The drawback is that we now have an additional dependency in the metadata, which has caused its size to grow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no problem with that. We are not particularly concerned with the binary sized of cargo-contract
crates/extrinsics/src/lib.rs
Outdated
|
||
let version = client | ||
.rpc() | ||
.storage(key.as_slice(), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raw access to the storage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there an RPC method to fetch a pallet version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found it
crates/extrinsics/src/lib.rs
Outdated
.saturating_add(storage_byte_deposit); | ||
|
||
// From contracts pallet version 10 deposit calculation has changed. | ||
if contract_pallet_version >= 10 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to display an error to the user otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the pallet-contracts version >=8, it works. The issue may arise for pallets-contract versions <8, as it will result in an error during the scale decoding of ContractInfo struct, which has changed at this time. It's important to note that this limitation is not introduced by this commit.
Summary
Closes #1035
ink
orpallet-contracts
?Add total contract deposit
Description
Added functionality to contract info command, which calculates and displays storage total deposit:
Old
Storage Deposit
(which displayed contract_info.storage_item_deposit) has been renamed to theStorage Items Deposit
This change depends on pallet-contracts, it should work with the versions
>=8
The metadata has been extended by the
Pallet Balances
, and it now includes the palletsContracts
andBalances
Checklist before requesting a review
CHANGELOG.md