diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e9ea758a..f0ab927712 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,8 +53,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (ledger) [\#1040](https://github.com/Finschia/finschia-sdk/pull/1040) Fix a bug(unable to connect nano S plus ledger on ubuntu) * (x/foundation) [\#1053](https://github.com/Finschia/finschia-sdk/pull/1053) Make x/foundation MsgExec propagate events -* (baseapp) [\#1091](https://github.com/cosmos/cosmos-sdk/pull/1091) Add `events.GetAttributes` and `event.GetAttribute` methods to simplify the retrieval of an attribute from event(s) (backport #1075) -* (baseapp) [\#1092](https://github.com/cosmos/cosmos-sdk/pull/1092) Do not add `module` attribute in case of ibc messages (backport #1079) +* (baseapp) [\#1091](https://github.com/finschia/finschia-sdk/pull/1091) Add `events.GetAttributes` and `event.GetAttribute` methods to simplify the retrieval of an attribute from event(s) (backport #1075) +* (baseapp) [\#1092](https://github.com/finschia/finschia-sdk/pull/1092) Do not add `module` attribute in case of ibc messages (backport #1079) ### Removed @@ -63,6 +63,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (refactor) [\#1090](https://github.com/Finschia/finschia-sdk/pull/1090) Automate EventTypeMessage inclusion in every message execution (backport #1063) * (x/bank) [#1093](https://github.com/Finschia/finschia-sdk/pull/1093) Remove message events including `sender` attribute whose information is already present in the relevant events (backport #1066) * (ostracon) [\#1099](https://github.com/Finschia/finschia-sdk/pull/1099) feat!: remove libsodium vrf library. +* (x/collection) [\#1102](https://github.com/finschia/finschia-sdk/pull/1102) Reject modifying NFT class with token index filled in MsgModify ### Build, CI * (build,ci) [\#1043](https://github.com/Finschia/finschia-sdk/pull/1043) Update golang version to 1.20 diff --git a/x/collection/msgs.go b/x/collection/msgs.go index 8cec98f884..71f3c2ec9e 100644 --- a/x/collection/msgs.go +++ b/x/collection/msgs.go @@ -962,6 +962,10 @@ func (m MsgModify) ValidateBasic() error { if err := ValidateTokenID(tokenID); err != nil { return ErrInvalidTokenIndex.Wrap(err.Error()) } + // reject modifying nft class with token index filled (daphne compat.) + if ValidateLegacyNFTID(tokenID) == nil && ValidateFTID(tokenID) == nil { + return ErrInvalidTokenIndex.Wrap("cannot modify nft class with index filled") + } } validator := validateTokenClassChange diff --git a/x/collection/msgs_test.go b/x/collection/msgs_test.go index 2ed8c4b187..254d82eac4 100644 --- a/x/collection/msgs_test.go +++ b/x/collection/msgs_test.go @@ -1238,6 +1238,14 @@ func TestMsgModify(t *testing.T) { owner: addrs[0], changes: changes, }, + "invalid nft class modification": { + contractID: "deadbeef", + tokenType: "deadbeef", + tokenIndex: "00000000", + owner: addrs[0], + changes: changes, + err: collection.ErrInvalidTokenIndex, + }, "valid nft modification": { contractID: "deadbeef", tokenType: "deadbeef",