-
Notifications
You must be signed in to change notification settings - Fork 282
[fix] #1845: Non-mintable assets can be minted once only. #2044
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
[fix] #1845: Non-mintable assets can be minted once only. #2044
Conversation
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2044 +/- ##
==============================================
- Coverage 77.27% 0 -77.28%
==============================================
Files 176 0 -176
Lines 24216 0 -24216
==============================================
- Hits 18713 0 -18713
+ Misses 5503 0 -5503 Continue to review full report at Codecov.
|
0e989da to
cf03236
Compare
f70a616 to
4441696
Compare
4441696 to
4560d49
Compare
fd5fcc7 to
fe773b6
Compare
6c2f30b to
e4de7b1
Compare
e4de7b1 to
882d78f
Compare
| // However, this will fail | ||
| assert!(test_client | ||
| .poll_request(client::asset::by_account_id(account_id), |result| { | ||
| result.iter().any(|asset| { | ||
| asset.id().definition_id == asset_definition_id | ||
| && *asset.value() == AssetValue::Quantity(400_u32) | ||
| }) | ||
| }) | ||
| .is_err()); |
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.
Just a suggestion,
one of more explicit ways than waiting timeout would be to submit_blocking and query the rejected transaction and assert the rejection reason
data_model/src/asset.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl From<(<AssetDefinition as Identifiable>::Id, AssetValueType, bool)> for AssetDefinition { |
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 thing looks a little bit strange for me
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 would remove it as well. I think the given constructors are sufficient and this one would be unexpected to use. But I wouldn't be against implementing the following destructuring conversion:
impl From<AssetDefinition> for (<AssetDefinition as Identifiable>::Id, AssetValueType, bool)
93d8165
882d78f to
93d8165
Compare
data_model/src/asset.rs
Outdated
| } | ||
| } | ||
|
|
||
| impl From<(<AssetDefinition as Identifiable>::Id, AssetValueType, bool)> for AssetDefinition { |
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 would remove it as well. I think the given constructors are sufficient and this one would be unexpected to use. But I wouldn't be against implementing the following destructuring conversion:
impl From<AssetDefinition> for (<AssetDefinition as Identifiable>::Id, AssetValueType, bool)
93d8165 to
eae4993
Compare
eae4993 to
5aec46c
Compare
5aec46c to
dc1373c
Compare
…only. Signed-off-by: Aleksandr Petrosyan <[email protected]>
Signed-off-by: Aleksandr Petrosyan <[email protected]>
Signed-off-by: Aleksandr Petrosyan <[email protected]>
dc1373c to
a264c90
Compare
Signed-off-by: Aleksandr Petrosyan [email protected]
Description of the Change
Non-mintable assets are now registered as
Mintable::Onceand can be minted precisely once.Issue
Closes #1845
Benefits
Non-mintable assets are now functional.
Possible Drawbacks
None
Usage examples/tests
client/integration/non_mintable.rs