This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contracts: runtime_call and storage_deposit #13990
Contracts: runtime_call and storage_deposit #13990
Changes from 8 commits
909cbae
fb0cc68
81859b6
0ccd804
a5a63da
21e2fc1
c81bde4
60c2bf4
cd177fc
672070b
ead8ba3
826bfa7
faf1b12
ec43399
fe79901
2bed075
e68423d
badc93c
22cea6e
05c9f8c
45aae4d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
docs above this line could be improved a bit to reflect the fact this is now a fallible fn
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.
would be nice to test that the transaction gas were actually charge to the user, but I am not too sure how this can be done within our test framework
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.
can't you just check that Alice's balance became lower than it was before the tx?
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.
Updated the test, so we can validate that the fees are the same whether the transaction fails (because the payment failed) or not.
I don't think we can test Alice's balance because as far as I know, this would be done in the pre/post hook of the transaction_payment pallet that does not exist in the Test config
for reference
substrate/frame/transaction-payment/src/lib.rs
Lines 816 to 842 in ec43399
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.
You can check the events emitted during execution. We do that in other tests. There is a event for transaction fee payment.
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.
we would need the transaction_payment pallet for this in test, I don't think we have it 🤔 might have overlooked, will check again
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.
Ahh yeah. You are right. We didn't set this up in tests. It is fine. We don't really need to test this.