diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e4af366d..f67580d1ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client) [\#890](https://github.com/line/lbm-sdk/pull/890) Map Ostracon:ErrTxInMap to lbm-sdk:ErrTxInMempoolCache * (x/collection) [\#894](https://github.com/line/lbm-sdk/pull/894) Change the default params of x/collection * (ante) [\#895](https://github.com/line/lbm-sdk/pull/895) Remove max gas validation +* (x/collection,token) [\#900](https://github.com/line/lbm-sdk/pull/900) Add uri for MsgModify and deprecate the old ones ### Bug Fixes * (client) [\#817](https://github.com/line/lbm-sdk/pull/817) remove support for composite (BLS) type diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 96d4d5d701..0ac3e40abc 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -9694,7 +9694,7 @@ AttributeKey enumerates the valid attribute keys on x/collection. | ATTRIBUTE_KEY_OWNER | 5 | | | ATTRIBUTE_KEY_AMOUNT | 6 | | | ATTRIBUTE_KEY_DECIMALS | 7 | | -| ATTRIBUTE_KEY_BASE_IMG_URI | 8 | | +| ATTRIBUTE_KEY_BASE_IMG_URI | 8 | deprecated: use ATTRIBUTE_KEY_URI | | ATTRIBUTE_KEY_MINTABLE | 9 | | | ATTRIBUTE_KEY_TOKEN_TYPE | 10 | | | ATTRIBUTE_KEY_FROM | 11 | | @@ -9706,6 +9706,7 @@ AttributeKey enumerates the valid attribute keys on x/collection. | ATTRIBUTE_KEY_PROXY | 17 | | | ATTRIBUTE_KEY_OLD_ROOT_TOKEN_ID | 18 | | | ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID | 19 | | +| ATTRIBUTE_KEY_URI | 20 | | @@ -11003,7 +11004,7 @@ MsgModify is the Msg/Modify request type. | `owner` | [string](#string) | | the address of the grantee which must have modify permission. | | `token_type` | [string](#string) | | token type of the token. refer to TokenType for the definition. | | `token_index` | [string](#string) | | token index of the token. if index is empty, it would modify the corresponding token type. if index is not empty, it would modify the corresponding nft. Note: if token type is of FTs, the index cannot be empty. | -| `changes` | [Attribute](#lbm.collection.v1.Attribute) | repeated | changes to apply. possible attribute keys on modifying collection: name, base_img_uri, meta. possible attribute keys on modifying token type and token: name, meta. | +| `changes` | [Attribute](#lbm.collection.v1.Attribute) | repeated | changes to apply. possible attribute keys on modifying collection: name, uri, base_img_uri (deprecated), meta. possible attribute keys on modifying token type and token: name, meta. | @@ -13009,13 +13010,14 @@ AttributeKey enumerates the valid attribute keys on x/token. | ATTRIBUTE_KEY_OWNER | 5 | | | ATTRIBUTE_KEY_AMOUNT | 6 | | | ATTRIBUTE_KEY_DECIMALS | 7 | | -| ATTRIBUTE_KEY_IMG_URI | 8 | | +| ATTRIBUTE_KEY_IMG_URI | 8 | deprecated: use ATTRIBUTE_KEY_URI | | ATTRIBUTE_KEY_MINTABLE | 9 | | | ATTRIBUTE_KEY_FROM | 10 | | | ATTRIBUTE_KEY_TO | 11 | | | ATTRIBUTE_KEY_PERM | 12 | | | ATTRIBUTE_KEY_APPROVER | 13 | | | ATTRIBUTE_KEY_PROXY | 14 | | +| ATTRIBUTE_KEY_URI | 15 | | @@ -13644,7 +13646,7 @@ Signer: `owner` | ----- | ---- | ----- | ----------- | | `contract_id` | [string](#string) | | contract id associated with the contract. | | `owner` | [string](#string) | | the address of the grantee which must have modify permission. | -| `changes` | [Attribute](#lbm.token.v1.Attribute) | repeated | changes to apply. possible attribute keys are: name, img_uri, meta | +| `changes` | [Attribute](#lbm.token.v1.Attribute) | repeated | changes to apply. possible attribute keys are: name, uri, img_uri (deprecated), meta | diff --git a/go.mod b/go.mod index 8bd69d1c7d..415e965f34 100644 --- a/go.mod +++ b/go.mod @@ -102,7 +102,7 @@ require ( github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/onsi/gomega v1.20.0 // indirect + github.com/onsi/gomega v1.22.1 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -114,6 +114,7 @@ require ( github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.29.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect @@ -124,6 +125,7 @@ require ( golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + golang.org/x/tools v0.5.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 0815f75a53..74a5c5817c 100644 --- a/go.sum +++ b/go.sum @@ -873,8 +873,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.22.1 h1:pY8O4lBfsHKZHM/6nrxkhVPUznOlIu3quZcKP/M20KI= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1057,8 +1057,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= github.com/sivchari/tenv v1.5.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1334,8 +1335,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1557,6 +1558,7 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= @@ -1689,7 +1691,8 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/proto/lbm/collection/v1/event.proto b/proto/lbm/collection/v1/event.proto index 68085ad11e..523a8e0ca1 100644 --- a/proto/lbm/collection/v1/event.proto +++ b/proto/lbm/collection/v1/event.proto @@ -52,14 +52,15 @@ enum AttributeKey { option (gogoproto.goproto_enum_stringer) = false; option (gogoproto.goproto_enum_prefix) = false; - ATTRIBUTE_KEY_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "AttributeKeyUnspecified"]; - ATTRIBUTE_KEY_NAME = 1 [(gogoproto.enumvalue_customname) = "AttributeKeyName"]; - ATTRIBUTE_KEY_META = 2 [(gogoproto.enumvalue_customname) = "AttributeKeyMeta"]; - ATTRIBUTE_KEY_CONTRACT_ID = 3 [(gogoproto.enumvalue_customname) = "AttributeKeyContractID"]; - ATTRIBUTE_KEY_TOKEN_ID = 4 [(gogoproto.enumvalue_customname) = "AttributeKeyTokenID"]; - ATTRIBUTE_KEY_OWNER = 5 [(gogoproto.enumvalue_customname) = "AttributeKeyOwner"]; - ATTRIBUTE_KEY_AMOUNT = 6 [(gogoproto.enumvalue_customname) = "AttributeKeyAmount"]; - ATTRIBUTE_KEY_DECIMALS = 7 [(gogoproto.enumvalue_customname) = "AttributeKeyDecimals"]; + ATTRIBUTE_KEY_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "AttributeKeyUnspecified"]; + ATTRIBUTE_KEY_NAME = 1 [(gogoproto.enumvalue_customname) = "AttributeKeyName"]; + ATTRIBUTE_KEY_META = 2 [(gogoproto.enumvalue_customname) = "AttributeKeyMeta"]; + ATTRIBUTE_KEY_CONTRACT_ID = 3 [(gogoproto.enumvalue_customname) = "AttributeKeyContractID"]; + ATTRIBUTE_KEY_TOKEN_ID = 4 [(gogoproto.enumvalue_customname) = "AttributeKeyTokenID"]; + ATTRIBUTE_KEY_OWNER = 5 [(gogoproto.enumvalue_customname) = "AttributeKeyOwner"]; + ATTRIBUTE_KEY_AMOUNT = 6 [(gogoproto.enumvalue_customname) = "AttributeKeyAmount"]; + ATTRIBUTE_KEY_DECIMALS = 7 [(gogoproto.enumvalue_customname) = "AttributeKeyDecimals"]; + // deprecated: use ATTRIBUTE_KEY_URI ATTRIBUTE_KEY_BASE_IMG_URI = 8 [(gogoproto.enumvalue_customname) = "AttributeKeyBaseImgURI"]; ATTRIBUTE_KEY_MINTABLE = 9 [(gogoproto.enumvalue_customname) = "AttributeKeyMintable"]; ATTRIBUTE_KEY_TOKEN_TYPE = 10 [(gogoproto.enumvalue_customname) = "AttributeKeyTokenType"]; @@ -72,6 +73,7 @@ enum AttributeKey { ATTRIBUTE_KEY_PROXY = 17 [(gogoproto.enumvalue_customname) = "AttributeKeyProxy"]; ATTRIBUTE_KEY_OLD_ROOT_TOKEN_ID = 18 [(gogoproto.enumvalue_customname) = "AttributeKeyOldRoot"]; ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID = 19 [(gogoproto.enumvalue_customname) = "AttributeKeyNewRoot"]; + ATTRIBUTE_KEY_URI = 20 [(gogoproto.enumvalue_customname) = "AttributeKeyURI"]; } // EventSent is emitted when tokens are transferred. diff --git a/proto/lbm/collection/v1/tx.proto b/proto/lbm/collection/v1/tx.proto index 5cc2b9abc1..1a5985ab6c 100644 --- a/proto/lbm/collection/v1/tx.proto +++ b/proto/lbm/collection/v1/tx.proto @@ -466,7 +466,7 @@ message MsgModify { // Note: if token type is of FTs, the index cannot be empty. string token_index = 4; // changes to apply. - // possible attribute keys on modifying collection: name, base_img_uri, meta. + // possible attribute keys on modifying collection: name, uri, base_img_uri (deprecated), meta. // possible attribute keys on modifying token type and token: name, meta. repeated Attribute changes = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/lbm/token/v1/event.proto b/proto/lbm/token/v1/event.proto index 699f52b8d2..59e05aa414 100644 --- a/proto/lbm/token/v1/event.proto +++ b/proto/lbm/token/v1/event.proto @@ -42,13 +42,15 @@ enum AttributeKey { ATTRIBUTE_KEY_OWNER = 5 [(gogoproto.enumvalue_customname) = "AttributeKeyOwner"]; ATTRIBUTE_KEY_AMOUNT = 6 [(gogoproto.enumvalue_customname) = "AttributeKeyAmount"]; ATTRIBUTE_KEY_DECIMALS = 7 [(gogoproto.enumvalue_customname) = "AttributeKeyDecimals"]; - ATTRIBUTE_KEY_IMG_URI = 8 [(gogoproto.enumvalue_customname) = "AttributeKeyImageURI"]; - ATTRIBUTE_KEY_MINTABLE = 9 [(gogoproto.enumvalue_customname) = "AttributeKeyMintable"]; - ATTRIBUTE_KEY_FROM = 10 [(gogoproto.enumvalue_customname) = "AttributeKeyFrom"]; - ATTRIBUTE_KEY_TO = 11 [(gogoproto.enumvalue_customname) = "AttributeKeyTo"]; - ATTRIBUTE_KEY_PERM = 12 [(gogoproto.enumvalue_customname) = "AttributeKeyPerm"]; - ATTRIBUTE_KEY_APPROVER = 13 [(gogoproto.enumvalue_customname) = "AttributeKeyApprover"]; - ATTRIBUTE_KEY_PROXY = 14 [(gogoproto.enumvalue_customname) = "AttributeKeyProxy"]; + // deprecated: use ATTRIBUTE_KEY_URI + ATTRIBUTE_KEY_IMG_URI = 8 [(gogoproto.enumvalue_customname) = "AttributeKeyImageURI"]; + ATTRIBUTE_KEY_MINTABLE = 9 [(gogoproto.enumvalue_customname) = "AttributeKeyMintable"]; + ATTRIBUTE_KEY_FROM = 10 [(gogoproto.enumvalue_customname) = "AttributeKeyFrom"]; + ATTRIBUTE_KEY_TO = 11 [(gogoproto.enumvalue_customname) = "AttributeKeyTo"]; + ATTRIBUTE_KEY_PERM = 12 [(gogoproto.enumvalue_customname) = "AttributeKeyPerm"]; + ATTRIBUTE_KEY_APPROVER = 13 [(gogoproto.enumvalue_customname) = "AttributeKeyApprover"]; + ATTRIBUTE_KEY_PROXY = 14 [(gogoproto.enumvalue_customname) = "AttributeKeyProxy"]; + ATTRIBUTE_KEY_URI = 15 [(gogoproto.enumvalue_customname) = "AttributeKeyURI"]; } // EventSent is emitted when tokens are transferred. diff --git a/proto/lbm/token/v1/tx.proto b/proto/lbm/token/v1/tx.proto index 3348ca67c1..a5d6156907 100644 --- a/proto/lbm/token/v1/tx.proto +++ b/proto/lbm/token/v1/tx.proto @@ -274,7 +274,7 @@ message MsgModify { // the address of the grantee which must have modify permission. string owner = 2; // changes to apply. - // possible attribute keys are: name, img_uri, meta + // possible attribute keys are: name, uri, img_uri (deprecated), meta repeated Attribute changes = 3 [(gogoproto.nullable) = false]; } diff --git a/x/collection/event.pb.go b/x/collection/event.pb.go index f91b2b8e52..f53760bf56 100644 --- a/x/collection/event.pb.go +++ b/x/collection/event.pb.go @@ -142,6 +142,7 @@ const ( AttributeKeyOwner AttributeKey = 5 AttributeKeyAmount AttributeKey = 6 AttributeKeyDecimals AttributeKey = 7 + // deprecated: use ATTRIBUTE_KEY_URI AttributeKeyBaseImgURI AttributeKey = 8 AttributeKeyMintable AttributeKey = 9 AttributeKeyTokenType AttributeKey = 10 @@ -154,6 +155,7 @@ const ( AttributeKeyProxy AttributeKey = 17 AttributeKeyOldRoot AttributeKey = 18 AttributeKeyNewRoot AttributeKey = 19 + AttributeKeyURI AttributeKey = 20 ) var AttributeKey_name = map[int32]string{ @@ -177,6 +179,7 @@ var AttributeKey_name = map[int32]string{ 17: "ATTRIBUTE_KEY_PROXY", 18: "ATTRIBUTE_KEY_OLD_ROOT_TOKEN_ID", 19: "ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID", + 20: "ATTRIBUTE_KEY_URI", } var AttributeKey_value = map[string]int32{ @@ -200,6 +203,7 @@ var AttributeKey_value = map[string]int32{ "ATTRIBUTE_KEY_PROXY": 17, "ATTRIBUTE_KEY_OLD_ROOT_TOKEN_ID": 18, "ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID": 19, + "ATTRIBUTE_KEY_URI": 20, } func (AttributeKey) EnumDescriptor() ([]byte, []int) { @@ -1634,117 +1638,118 @@ func init() { func init() { proto.RegisterFile("lbm/collection/v1/event.proto", fileDescriptor_478cfab12ea1b00e) } var fileDescriptor_478cfab12ea1b00e = []byte{ - // 1748 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcb, 0x6f, 0xdb, 0x46, - 0x1a, 0x37, 0x2d, 0xd9, 0x92, 0xc7, 0x2f, 0x9a, 0x7e, 0xd1, 0xb4, 0xad, 0x30, 0xc2, 0x02, 0x6b, - 0x64, 0x37, 0xd6, 0xe6, 0xb5, 0x9b, 0x0d, 0xbc, 0xd9, 0xa5, 0x24, 0xca, 0x21, 0x6c, 0x91, 0x02, - 0x45, 0x25, 0xeb, 0xbd, 0x08, 0x94, 0x34, 0xb1, 0xb9, 0x96, 0x48, 0x81, 0xa4, 0x9c, 0x78, 0xcf, - 0x7b, 0x28, 0xd4, 0x4b, 0xd1, 0xa0, 0x3d, 0x14, 0xd0, 0xa5, 0x29, 0xd0, 0xfc, 0x1f, 0xbd, 0xe4, - 0x52, 0x20, 0xc7, 0x9e, 0x8a, 0x22, 0xf9, 0x47, 0x8a, 0x19, 0x92, 0xd2, 0x90, 0x54, 0x9a, 0xb8, - 0x4e, 0xda, 0x1b, 0x67, 0xf8, 0xfd, 0xbe, 0xef, 0x37, 0xdf, 0x73, 0x48, 0xb0, 0xdd, 0x6e, 0x74, - 0x72, 0x4d, 0xab, 0xdd, 0x86, 0x4d, 0xd7, 0xb0, 0xcc, 0xdc, 0xd9, 0x8d, 0x1c, 0x3c, 0x83, 0xa6, - 0xbb, 0xdb, 0xb5, 0x2d, 0xd7, 0x62, 0x96,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0xf4, 0xf1, 0x4b, 0x9d, 0x23, 0xfb, 0x65, 0x50, - 0xd6, 0x82, 0xeb, 0xea, 0xcd, 0x93, 0xcb, 0x26, 0xeb, 0x68, 0x0c, 0x27, 0x42, 0x63, 0x98, 0x05, - 0x29, 0xa7, 0xd7, 0xf8, 0x2f, 0x6c, 0xba, 0x7e, 0x6b, 0x0e, 0x96, 0x08, 0xe1, 0xea, 0xf6, 0x31, - 0x74, 0x7d, 0x2f, 0xfa, 0xab, 0xec, 0xb7, 0x01, 0xb1, 0x22, 0xfc, 0x7d, 0x88, 0xfd, 0x11, 0x2c, - 0x76, 0x6d, 0x78, 0x66, 0x58, 0x3d, 0xa7, 0xde, 0xd5, 0x6d, 0x68, 0x06, 0x0c, 0x17, 0x82, 0xed, - 0x0a, 0xde, 0xcd, 0x3a, 0x60, 0x09, 0x13, 0x55, 0x9e, 0x98, 0xd0, 0x2e, 0x60, 0xbf, 0xbe, 0x07, - 0x59, 0x32, 0xa2, 0x93, 0xb1, 0xc9, 0xfc, 0xae, 0xfb, 0x5c, 0xd6, 0xf6, 0x33, 0x4c, 0xb5, 0x2c, - 0xf7, 0x37, 0xb2, 0x79, 0xed, 0xff, 0xf3, 0xfe, 0x95, 0x15, 0xd7, 0xcf, 0x6d, 0xb0, 0x26, 0x3e, - 0x14, 0x65, 0xad, 0xae, 0x1d, 0x55, 0xc4, 0x7a, 0x4d, 0xae, 0x56, 0xc4, 0x82, 0x54, 0x92, 0xc4, - 0x22, 0x3d, 0xc1, 0xb1, 0xfd, 0x01, 0xbf, 0x32, 0x14, 0xad, 0x99, 0x4e, 0x17, 0x36, 0x71, 0x21, - 0x30, 0xff, 0x04, 0x5b, 0x04, 0xaa, 0xa0, 0x8a, 0x82, 0x26, 0xd6, 0x0b, 0xca, 0xe1, 0xa1, 0x58, - 0xd0, 0x24, 0x45, 0xa6, 0x29, 0x6e, 0xbb, 0x3f, 0xe0, 0x37, 0x86, 0x58, 0xef, 0xf2, 0x50, 0x18, - 0x26, 0x33, 0x73, 0x1d, 0x2c, 0x13, 0x0a, 0xa4, 0x6a, 0xb5, 0x26, 0xd6, 0x4b, 0x1a, 0x3d, 0xc9, - 0xad, 0xf4, 0x07, 0x3c, 0x3d, 0xc4, 0x49, 0x8e, 0xd3, 0x83, 0x25, 0x8d, 0xc9, 0x81, 0x95, 0x98, - 0xb8, 0x5c, 0xd2, 0xe8, 0x04, 0xb7, 0xda, 0x1f, 0xf0, 0x4b, 0x61, 0x79, 0x54, 0xa6, 0x7f, 0x02, - 0x0c, 0x01, 0x28, 0x4b, 0xb2, 0x86, 0xd4, 0x27, 0xb9, 0xe5, 0xfe, 0x80, 0x5f, 0x1c, 0x8a, 0xa3, - 0x71, 0x13, 0x13, 0xce, 0xd7, 0x54, 0x19, 0x09, 0x4f, 0x45, 0x84, 0xd1, 0x14, 0x28, 0x69, 0x11, - 0xe6, 0x58, 0x33, 0x62, 0x32, 0x1d, 0x61, 0x8e, 0x54, 0xcb, 0x31, 0x71, 0xac, 0x1b, 0x89, 0xa7, - 0x22, 0xe2, 0x48, 0x39, 0x12, 0xbf, 0x0d, 0xd6, 0xe3, 0x54, 0xea, 0x25, 0x55, 0x29, 0xd3, 0x69, - 0x6e, 0xbd, 0x3f, 0xe0, 0x97, 0x23, 0x7c, 0x4a, 0x28, 0xc4, 0x7f, 0x05, 0xec, 0x18, 0x23, 0x1e, - 0x6c, 0x26, 0x12, 0x46, 0xdf, 0x12, 0xc6, 0x85, 0xc3, 0x58, 0x56, 0x8a, 0x52, 0xe9, 0x88, 0x0c, - 0x23, 0x88, 0x84, 0x11, 0x37, 0xc2, 0x73, 0x22, 0x8c, 0xf7, 0xc7, 0x29, 0xd0, 0x94, 0x03, 0x51, - 0xc6, 0x3b, 0xf4, 0x2c, 0xb7, 0xd5, 0x1f, 0xf0, 0x6c, 0x44, 0x81, 0x36, 0xec, 0xde, 0x77, 0x42, - 0xc7, 0x25, 0xf1, 0xf4, 0x5c, 0x84, 0x37, 0x01, 0x65, 0x76, 0x43, 0x4e, 0xd5, 0x54, 0x41, 0xae, - 0x96, 0x44, 0x95, 0x9e, 0x8f, 0x64, 0x83, 0x66, 0xeb, 0xa6, 0xf3, 0x18, 0xda, 0xcc, 0xad, 0x50, - 0x92, 0x07, 0xf2, 0x28, 0xc8, 0x0b, 0x11, 0xa7, 0x06, 0x90, 0x92, 0x16, 0xe1, 0x36, 0x04, 0xa1, - 0xe8, 0x2d, 0x46, 0xb8, 0x05, 0x28, 0x14, 0xc1, 0x3d, 0xb0, 0x39, 0xde, 0x96, 0x17, 0x0e, 0x9a, - 0xdb, 0xec, 0x0f, 0xf8, 0xf5, 0x31, 0x06, 0x71, 0x44, 0xc2, 0x0e, 0x25, 0x8d, 0x7a, 0xf0, 0xa5, - 0x88, 0x43, 0x09, 0xcb, 0x7e, 0x26, 0xac, 0x12, 0xf8, 0x7d, 0x55, 0x90, 0xb5, 0x7a, 0x45, 0x54, - 0xcb, 0x34, 0x13, 0xb1, 0x8b, 0x6f, 0xcc, 0xe8, 0x92, 0xe8, 0x79, 0xf4, 0x6e, 0xc8, 0x43, 0xaa, - 0xf8, 0x50, 0x39, 0x10, 0x3d, 0xe0, 0x72, 0xc4, 0xa2, 0xf7, 0x4d, 0x37, 0x42, 0xe6, 0xc0, 0x12, - 0x81, 0x14, 0x34, 0x4d, 0x28, 0x3c, 0xa0, 0x57, 0x22, 0x0e, 0xf2, 0xc6, 0xd2, 0x38, 0x40, 0x51, - 0xc4, 0x80, 0xd5, 0x08, 0xc0, 0x1b, 0x17, 0x1e, 0x20, 0x1c, 0x3d, 0xcf, 0x82, 0xe7, 0x8d, 0xb5, - 0x48, 0xf4, 0x3c, 0x33, 0xd8, 0x11, 0x61, 0x90, 0x67, 0xc5, 0x03, 0xad, 0x47, 0x40, 0x9e, 0x29, - 0x0c, 0x12, 0xc0, 0x36, 0x69, 0xa9, 0x52, 0x51, 0x95, 0x87, 0xa1, 0xbe, 0xc6, 0x72, 0x99, 0xfe, - 0x80, 0xe7, 0x46, 0x06, 0xbb, 0x5d, 0xdb, 0x3a, 0x23, 0x1b, 0xdb, 0x3e, 0xe0, 0x49, 0xbb, 0x52, - 0x75, 0x8c, 0x96, 0x0d, 0xee, 0x6a, 0x7f, 0xc0, 0x6f, 0x8f, 0x18, 0x18, 0x8e, 0x1e, 0x53, 0xf4, - 0x00, 0x5c, 0x25, 0x14, 0x29, 0x15, 0x51, 0x15, 0x10, 0x38, 0x9c, 0x88, 0x5c, 0x44, 0x93, 0xf7, - 0xa5, 0x6d, 0x58, 0x26, 0x99, 0x91, 0xff, 0x0a, 0x9d, 0x6a, 0xa4, 0x69, 0xd8, 0x8c, 0x36, 0x23, - 0x65, 0x3e, 0xd4, 0x12, 0x74, 0xa5, 0xb7, 0x71, 0x51, 0x15, 0x45, 0xab, 0x17, 0x1e, 0x08, 0xf2, - 0xbe, 0x58, 0xa4, 0xb7, 0xde, 0xc6, 0x85, 0x18, 0x6e, 0x5c, 0xfa, 0x93, 0xe7, 0x99, 0x89, 0x17, - 0xdf, 0x64, 0x26, 0xae, 0x7d, 0x97, 0x06, 0x73, 0xc3, 0xfb, 0xcc, 0x01, 0x3c, 0x67, 0xee, 0x81, - 0x0d, 0x41, 0xd3, 0x54, 0x29, 0x5f, 0xd3, 0xc4, 0xfa, 0x81, 0x78, 0x14, 0x19, 0x46, 0x38, 0x7d, - 0x49, 0x00, 0x39, 0x8f, 0xfe, 0x0c, 0x98, 0x30, 0x56, 0x16, 0xca, 0x22, 0x4d, 0x79, 0x4d, 0x96, - 0x04, 0xa1, 0x8b, 0x5d, 0x5c, 0xba, 0x2c, 0x6a, 0x42, 0x30, 0x7b, 0x48, 0xe9, 0x32, 0xfa, 0x72, - 0xfe, 0x7b, 0x94, 0x57, 0x41, 0x91, 0x35, 0x55, 0x28, 0x68, 0x75, 0xa9, 0x48, 0x27, 0x38, 0xae, - 0x3f, 0xe0, 0xd7, 0x48, 0x50, 0x70, 0x1b, 0x97, 0x8a, 0x28, 0x09, 0xc3, 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, 0xc5, 0x78, 0x31, 0xa0, 0x83, 0x04, 0xe8, 0x98, 0xb3, 0xfd, 0x16, 0xa4, - 0xd2, 0x74, 0xdc, 0xd9, 0x7e, 0x07, 0xb3, 0xe3, 0x69, 0x57, 0x51, 0x95, 0x7f, 0x1f, 0xd1, 0x4b, - 0xf1, 0xb4, 0xab, 0xd8, 0xd6, 0xd3, 0x73, 0x66, 0x0f, 0x5c, 0x89, 0xa4, 0xe9, 0x61, 0xd1, 0x6b, - 0x08, 0x43, 0x9e, 0x4c, 0x3c, 0xc9, 0x95, 0x76, 0x0b, 0xb5, 0x83, 0x38, 0x5a, 0x16, 0x1f, 0x45, - 0xd0, 0xcb, 0x71, 0xb4, 0x0c, 0x9f, 0x20, 0xf4, 0xa8, 0x8b, 0xe4, 0xef, 0xbf, 0x7c, 0x9d, 0xa1, - 0x5e, 0xbd, 0xce, 0x50, 0x3f, 0xbd, 0xce, 0x50, 0x9f, 0xbd, 0xc9, 0x4c, 0xbc, 0x7a, 0x93, 0x99, - 0xf8, 0xe1, 0x4d, 0x66, 0xe2, 0x3f, 0x7f, 0x38, 0x36, 0xdc, 0x93, 0x5e, 0x63, 0xb7, 0x69, 0x75, - 0x72, 0x6d, 0xc3, 0x84, 0xb9, 0x76, 0xa3, 0x73, 0xdd, 0x69, 0x9d, 0xe6, 0x9e, 0x12, 0x7f, 0x71, - 0x1b, 0xd3, 0xf8, 0x37, 0xee, 0xad, 0x9f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x58, 0x97, 0xc4, 0x28, - 0x34, 0x16, 0x00, 0x00, + // 1767 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x41, 0x6f, 0xe3, 0xc6, + 0x15, 0x36, 0x2d, 0xd9, 0x92, 0xc7, 0xbb, 0x5e, 0x9a, 0x96, 0x6d, 0x9a, 0x5e, 0x6b, 0x19, 0xa1, + 0x40, 0x8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 0x30, 0xc6, 0x68, 0x0a, 0xd4, 0x2d, 0x86, 0x39, 0xf6, 0x8c, 0x98, 0xac, 0x32, 0xcc, 0x91, 0x6b, + 0x3d, 0x65, 0x8e, 0x7d, 0x23, 0xf3, 0x1c, 0x63, 0x8e, 0x9c, 0x23, 0xf3, 0x27, 0x60, 0x37, 0x4d, + 0xa5, 0x53, 0x37, 0x8d, 0x06, 0x9f, 0x97, 0x76, 0x27, 0x53, 0x79, 0x8b, 0xe1, 0x53, 0x47, 0x25, + 0xfe, 0x21, 0x10, 0x17, 0x04, 0x21, 0xb0, 0x35, 0xa6, 0x8c, 0x51, 0x24, 0x8c, 0x4b, 0x96, 0xb1, + 0x61, 0xd4, 0xb4, 0xfa, 0x39, 0x5d, 0x46, 0xc0, 0x94, 0x11, 0x0b, 0xe1, 0x0d, 0x55, 0xc6, 0x4f, + 0x16, 0x39, 0xb0, 0x8c, 0x53, 0x55, 0xc7, 0x3b, 0xfc, 0xba, 0xf4, 0x70, 0x32, 0x95, 0x45, 0xc6, + 0x81, 0x35, 0x53, 0xef, 0x0f, 0x13, 0xc7, 0xa5, 0xf1, 0xfc, 0x3d, 0x86, 0x37, 0x05, 0x15, 0x8e, + 0x12, 0x49, 0xb5, 0x4c, 0x45, 0x6f, 0xd5, 0x55, 0x93, 0xbf, 0xcf, 0x74, 0x83, 0xe5, 0xdb, 0x6e, + 0xf0, 0x1c, 0xfa, 0xc2, 0x07, 0x89, 0x26, 0x8f, 0xed, 0x51, 0x91, 0x37, 0x98, 0xa4, 0xc6, 0x90, + 0xba, 0xc5, 0x70, 0x9b, 0x81, 0x50, 0xf5, 0x1e, 0x30, 0xdc, 0x62, 0x14, 0xaa, 0xe0, 0x31, 0xd8, + 0x5f, 0x1c, 0x8b, 0x94, 0x83, 0x97, 0xf6, 0x27, 0x53, 0x79, 0x77, 0x41, 0x40, 0x5c, 0x91, 0x64, + 0x42, 0xe9, 0xa0, 0x04, 0xbe, 0xc9, 0x24, 0x94, 0x8a, 0x1c, 0x75, 0xc2, 0x36, 0x85, 0x3f, 0x31, + 0x15, 0xdd, 0xea, 0x34, 0x55, 0xb3, 0xc1, 0x0b, 0x4c, 0x5c, 0xfc, 0x62, 0x46, 0x8f, 0x44, 0x92, + 0xd1, 0x8f, 0x12, 0x19, 0x32, 0xd5, 0x67, 0xc6, 0xa9, 0x4a, 0x80, 0x5b, 0x4c, 0x44, 0xf2, 0x9b, + 0x6e, 0x8e, 0x2c, 0x83, 0x4d, 0x0a, 0xa9, 0x58, 0x96, 0x52, 0x7d, 0xca, 0x17, 0x98, 0x04, 0x91, + 0xb1, 0xb4, 0x08, 0x50, 0x53, 0x31, 0x60, 0x9b, 0x01, 0x90, 0x71, 0x41, 0x00, 0xc9, 0xea, 0x91, + 0x08, 0x24, 0x1b, 0x3b, 0x4c, 0xf5, 0x48, 0x18, 0x9c, 0x88, 0x24, 0x88, 0x44, 0x21, 0xa0, 0x5d, + 0x06, 0x44, 0x42, 0x61, 0x90, 0x02, 0x0e, 0xe8, 0x48, 0xcd, 0xa6, 0x69, 0x3c, 0x4b, 0xe8, 0x9a, + 0x28, 0x15, 0x27, 0x53, 0x59, 0x9a, 0x07, 0x1c, 0x8d, 0x7c, 0xef, 0x9a, 0x16, 0xb6, 0x13, 0x20, + 0xd3, 0x71, 0xb5, 0xd6, 0x02, 0x2f, 0x7b, 0xd2, 0x3b, 0x93, 0xa9, 0x7c, 0x30, 0x67, 0xe0, 0x04, + 0x76, 0xca, 0xd1, 0x53, 0xf0, 0x0e, 0xe5, 0xc8, 0x68, 0xaa, 0xa6, 0x82, 0xc0, 0xc9, 0x46, 0x94, + 0x18, 0x4f, 0xe4, 0x97, 0xb6, 0xe3, 0xb9, 0x74, 0x47, 0xfe, 0x2c, 0x71, 0xaa, 0xb9, 0xa7, 0x99, + 0x18, 0xed, 0x33, 0xd7, 0x7c, 0xe6, 0x25, 0x56, 0xa5, 0x6f, 0xe2, 0x62, 0x1a, 0x86, 0xd5, 0xa9, + 0x3e, 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0x54, + 0x98, 0x1a, 0x5f, 0x20, 0xef, 0xb5, 0x84, 0x44, 0x98, 0xda, 0x5c, 0x71, 0x2a, 0x9f, 0x7c, 0xfd, + 0xb2, 0xc8, 0xbd, 0x78, 0x59, 0xe4, 0xfe, 0xf9, 0xb2, 0xc8, 0xfd, 0xee, 0x55, 0x71, 0xe9, 0xc5, + 0xab, 0xe2, 0xd2, 0xdf, 0x5f, 0x15, 0x97, 0x7e, 0xf1, 0x9d, 0x0b, 0x27, 0xbc, 0x1c, 0x77, 0x8f, + 0x7a, 0xde, 0xb0, 0x3c, 0x70, 0x5c, 0x58, 0x1e, 0x74, 0x87, 0xef, 0x06, 0xfd, 0xab, 0xf2, 0xe7, + 0xd4, 0x3f, 0xbe, 0xdd, 0x55, 0xfc, 0x97, 0xef, 0x07, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x68, + 0x1b, 0x0b, 0xd5, 0x60, 0x16, 0x00, 0x00, } func (m *EventSent) Marshal() (dAtA []byte, err error) { diff --git a/x/collection/genesis.go b/x/collection/genesis.go index a54d10f4b0..a722f441e7 100644 --- a/x/collection/genesis.go +++ b/x/collection/genesis.go @@ -26,7 +26,7 @@ func ValidateGenesis(data GenesisState) error { if err := validateName(contract.Name); err != nil { return err } - if err := validateBaseImgURI(contract.Uri); err != nil { + if err := validateURI(contract.Uri); err != nil { return err } if err := validateMeta(contract.Meta); err != nil { diff --git a/x/collection/keeper/msg_server.go b/x/collection/keeper/msg_server.go index 0daa96b3d6..e06cda71b6 100644 --- a/x/collection/keeper/msg_server.go +++ b/x/collection/keeper/msg_server.go @@ -615,6 +615,8 @@ func (s msgServer) OperatorBurnNFT(c context.Context, req *collection.MsgOperato func (s msgServer) Modify(c context.Context, req *collection.MsgModify) (*collection.MsgModifyResponse, error) { ctx := sdk.UnwrapSDKContext(c) + collection.UpdateMsgModify(req) + if err := ValidateLegacyContract(s.keeper, ctx, req.ContractId); err != nil { return nil, err } diff --git a/x/collection/keeper/supply.go b/x/collection/keeper/supply.go index 2ca870efda..25c119d5e9 100644 --- a/x/collection/keeper/supply.go +++ b/x/collection/keeper/supply.go @@ -325,7 +325,7 @@ func (k Keeper) ModifyContract(ctx sdk.Context, contractID string, operator sdk. collection.AttributeKeyName: func(name string) { contract.Name = name }, - collection.AttributeKeyBaseImgURI: func(uri string) { + collection.AttributeKeyURI: func(uri string) { contract.Uri = uri }, collection.AttributeKeyMeta: func(meta string) { diff --git a/x/collection/keeper/supply_test.go b/x/collection/keeper/supply_test.go index 872f46c179..dd5cb407fe 100644 --- a/x/collection/keeper/supply_test.go +++ b/x/collection/keeper/supply_test.go @@ -175,7 +175,7 @@ func (s *KeeperTestSuite) TestModifyContract() { } changes := []collection.Attribute{ {Key: collection.AttributeKeyName.String(), Value: "fox"}, - {Key: collection.AttributeKeyBaseImgURI.String(), Value: "file:///fox.png"}, + {Key: collection.AttributeKeyURI.String(), Value: "file:///fox.png"}, {Key: collection.AttributeKeyMeta.String(), Value: "Fox"}, } diff --git a/x/collection/msgs.go b/x/collection/msgs.go index 719b11994e..e18cff19f4 100644 --- a/x/collection/msgs.go +++ b/x/collection/msgs.go @@ -13,10 +13,10 @@ import ( const ( lengthClassID = 8 - nameLengthLimit = 20 - baseImgURILengthLimit = 1000 - metaLengthLimit = 1000 - changesLimit = 100 + nameLengthLimit = 20 + uriLengthLimit = 1000 + metaLengthLimit = 1000 + changesLimit = 100 ) var ( @@ -153,8 +153,8 @@ func validateName(name string) error { return nil } -func validateBaseImgURI(baseImgURI string) error { - if err := validateStringSize(baseImgURI, baseImgURILengthLimit, "base_img_uri"); err != nil { +func validateURI(uri string) error { + if err := validateStringSize(uri, uriLengthLimit, "uri"); err != nil { return ErrInvalidBaseImgURILength.Wrap(err.Error()) } @@ -197,8 +197,9 @@ func ValidatePermission(permission Permission) error { func validateContractChange(change Attribute) error { validators := map[string]func(string) error{ AttributeKeyName.String(): validateName, - AttributeKeyBaseImgURI.String(): validateBaseImgURI, + AttributeKeyBaseImgURI.String(): validateURI, AttributeKeyMeta.String(): validateMeta, + AttributeKeyURI.String(): validateURI, } return validateChange(change, validators) @@ -221,6 +222,16 @@ func validateChange(change Attribute, validators map[string]func(string) error) return validator(change.Value) } +func canonicalKey(key string) string { + convert := map[string]string{ + AttributeKeyBaseImgURI.String(): AttributeKeyURI.String(), + } + if converted, ok := convert[key]; ok { + return converted + } + return key +} + var _ sdk.Msg = (*MsgSendFT)(nil) // ValidateBasic implements Msg. @@ -507,7 +518,7 @@ func (m MsgCreateContract) ValidateBasic() error { return err } - if err := validateBaseImgURI(m.Uri); err != nil { + if err := validateURI(m.Uri); err != nil { return err } @@ -926,6 +937,8 @@ var _ sdk.Msg = (*MsgModify)(nil) // ValidateBasic implements Msg. func (m MsgModify) ValidateBasic() error { + UpdateMsgModify(&m) + if err := ValidateContractID(m.ContractId); err != nil { return err } @@ -967,10 +980,11 @@ func (m MsgModify) ValidateBasic() error { } seenKeys := map[string]bool{} for _, change := range m.Changes { - if seenKeys[change.Key] { + key := change.Key + if seenKeys[key] { return ErrDuplicateChangesField.Wrapf("duplicate keys: %s", change.Key) } - seenKeys[change.Key] = true + seenKeys[key] = true attribute := Attribute{ Key: change.Key, @@ -984,6 +998,16 @@ func (m MsgModify) ValidateBasic() error { return nil } +func UpdateMsgModify(msg *MsgModify) { + for i, change := range msg.Changes { + key := change.Key + converted := canonicalKey(key) + if converted != key { + msg.Changes[i].Key = converted + } + } +} + // GetSigners implements Msg func (m MsgModify) GetSigners() []sdk.AccAddress { signer, _ := sdk.AccAddressFromBech32(m.Owner) diff --git a/x/collection/msgs_test.go b/x/collection/msgs_test.go index 2c1fdcc044..a49f48925c 100644 --- a/x/collection/msgs_test.go +++ b/x/collection/msgs_test.go @@ -1281,8 +1281,11 @@ func TestMsgModify(t *testing.T) { "duplicated changes": { contractID: "deadbeef", owner: addrs[0], - changes: []collection.Attribute{changes[0], changes[0]}, - err: collection.ErrDuplicateChangesField, + changes: []collection.Attribute{ + {Key: collection.AttributeKeyBaseImgURI.String(), Value: "hello"}, + {Key: collection.AttributeKeyURI.String(), Value: "world"}, + }, + err: collection.ErrDuplicateChangesField, }, } diff --git a/x/collection/tx.pb.go b/x/collection/tx.pb.go index fa5631e93e..edb9910e1b 100644 --- a/x/collection/tx.pb.go +++ b/x/collection/tx.pb.go @@ -1835,7 +1835,7 @@ type MsgModify struct { // Note: if token type is of FTs, the index cannot be empty. TokenIndex string `protobuf:"bytes,4,opt,name=token_index,json=tokenIndex,proto3" json:"token_index,omitempty"` // changes to apply. - // possible attribute keys on modifying collection: name, base_img_uri, meta. + // possible attribute keys on modifying collection: name, uri, base_img_uri (deprecated), meta. // possible attribute keys on modifying token type and token: name, meta. Changes []Attribute `protobuf:"bytes,5,rep,name=changes,proto3" json:"changes"` } diff --git a/x/token/event.pb.go b/x/token/event.pb.go index cb529d4943..e192477e1b 100644 --- a/x/token/event.pb.go +++ b/x/token/event.pb.go @@ -87,13 +87,15 @@ const ( AttributeKeyOwner AttributeKey = 5 AttributeKeyAmount AttributeKey = 6 AttributeKeyDecimals AttributeKey = 7 - AttributeKeyImageURI AttributeKey = 8 - AttributeKeyMintable AttributeKey = 9 - AttributeKeyFrom AttributeKey = 10 - AttributeKeyTo AttributeKey = 11 - AttributeKeyPerm AttributeKey = 12 - AttributeKeyApprover AttributeKey = 13 - AttributeKeyProxy AttributeKey = 14 + // deprecated: use ATTRIBUTE_KEY_URI + AttributeKeyImageURI AttributeKey = 8 + AttributeKeyMintable AttributeKey = 9 + AttributeKeyFrom AttributeKey = 10 + AttributeKeyTo AttributeKey = 11 + AttributeKeyPerm AttributeKey = 12 + AttributeKeyApprover AttributeKey = 13 + AttributeKeyProxy AttributeKey = 14 + AttributeKeyURI AttributeKey = 15 ) var AttributeKey_name = map[int32]string{ @@ -112,6 +114,7 @@ var AttributeKey_name = map[int32]string{ 12: "ATTRIBUTE_KEY_PERM", 13: "ATTRIBUTE_KEY_APPROVER", 14: "ATTRIBUTE_KEY_PROXY", + 15: "ATTRIBUTE_KEY_URI", } var AttributeKey_value = map[string]int32{ @@ -130,6 +133,7 @@ var AttributeKey_value = map[string]int32{ "ATTRIBUTE_KEY_PERM": 12, "ATTRIBUTE_KEY_APPROVER": 13, "ATTRIBUTE_KEY_PROXY": 14, + "ATTRIBUTE_KEY_URI": 15, } func (AttributeKey) EnumDescriptor() ([]byte, []int) { @@ -820,78 +824,79 @@ func init() { func init() { proto.RegisterFile("lbm/token/v1/event.proto", fileDescriptor_d7505f4c4cdec18e) } var fileDescriptor_d7505f4c4cdec18e = []byte{ - // 1121 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x34, 0x49, 0xa7, 0xdd, 0x62, 0xbc, 0x69, 0xeb, 0x35, 0x28, 0x35, 0x3d, 0x95, - 0x85, 0x4d, 0xd8, 0x1f, 0xc0, 0x2e, 0x37, 0xa7, 0x71, 0x2b, 0xab, 0xb5, 0x1d, 0x4d, 0x9c, 0x42, - 0xb9, 0x44, 0x4e, 0x32, 0x4d, 0xad, 0xc6, 0x9e, 0xc8, 0x76, 0xca, 0x86, 0xfb, 0x4a, 0x28, 0xe2, - 0xc0, 0x3f, 0xe0, 0x03, 0x82, 0x03, 0x37, 0xfe, 0x8d, 0x3d, 0xae, 0x90, 0x90, 0x10, 0x87, 0x15, - 0x6a, 0xff, 0x11, 0x34, 0xe3, 0xd8, 0xb5, 0xe3, 0xc2, 0xb2, 0x2c, 0xdc, 0x66, 0x3c, 0xdf, 0x37, - 0xef, 0x7b, 0xf3, 0xbe, 0x37, 0x63, 0xc0, 0x8f, 0x7a, 0x76, 0xdd, 0xc7, 0xe7, 0xc8, 0xa9, 0x5f, - 0xdc, 0xaf, 0xa3, 0x0b, 0xe4, 0xf8, 0xb5, 0xb1, 0x8b, 0x7d, 0xcc, 0xad, 0x8d, 0x7a, 0x76, 0x8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, 0x56, 0xfb, - 0xdc, 0xe4, 0x90, 0xbd, 0x95, 0xd5, 0x3e, 0xb7, 0xb8, 0x9b, 0x2d, 0x5f, 0x0b, 0xea, 0x5f, 0x9c, - 0xb0, 0xeb, 0xd9, 0xf2, 0xb5, 0x5c, 0xfc, 0x74, 0x7a, 0xdd, 0x0e, 0x8d, 0x27, 0xcf, 0x2f, 0xab, - 0xcc, 0x8b, 0xcb, 0x2a, 0xf3, 0xc7, 0x65, 0x95, 0xf9, 0xee, 0xaa, 0x9a, 0x7b, 0x71, 0x55, 0xcd, - 0xfd, 0x76, 0x55, 0xcd, 0x7d, 0xb9, 0xfd, 0x57, 0x6f, 0xc6, 0xd3, 0xf0, 0xff, 0xb7, 0x57, 0xa4, - 0x3f, 0xc0, 0x0f, 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x79, 0xb4, 0xa4, 0xdb, 0x5a, 0x0b, 0x00, - 0x00, + // 1140 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0x8e, 0x9b, 0x34, 0x49, 0xa7, 0xdd, 0x76, 0xd6, 0x4d, 0x5b, 0xaf, 0x41, 0xa9, 0xe9, 0xa9, + 0x14, 0x36, 0x61, 0x3f, 0x80, 0x5d, 0x6e, 0x4e, 0xe3, 0x56, 0x56, 0x6b, 0x3b, 0x9a, 0x38, 0x85, + 0x72, 0x89, 0xf2, 0x31, 0x4d, 0xad, 0xc6, 0x9e, 0xc8, 0x71, 0xca, 0x86, 0xfb, 0x4a, 0x28, 0x27, + 0xfe, 0x80, 0x0f, 0x08, 0x0e, 0xdc, 0xb8, 0xf2, 0x13, 0xf6, 0xb8, 0x42, 0x42, 0x42, 0x1c, 0x56, + 0xa8, 0xfd, 0x23, 0x68, 0xc6, 0x71, 0x6a, 0xc7, 0x85, 0x65, 0x59, 0xb8, 0xcd, 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88, + 0x9b, 0x13, 0x5f, 0xe2, 0x67, 0x68, 0x6a, 0xac, 0xdb, 0xc0, 0x95, 0x06, 0xd2, 0x61, 0x7a, 0x0e, + 0x4c, 0xab, 0x1c, 0x80, 0x1f, 0x83, 0xc2, 0x1c, 0xb8, 0x79, 0x80, 0x0c, 0x0d, 0x66, 0x44, 0x71, + 0xe2, 0x4b, 0x9b, 0x49, 0xc6, 0x01, 0xad, 0xe6, 0xc7, 0x60, 0x2b, 0xaa, 0xc7, 0xa8, 0xaa, 0x07, + 0xa7, 0x4d, 0xd3, 0x38, 0x52, 0x74, 0xb8, 0x38, 0x97, 0x35, 0x2b, 0xd6, 0x38, 0x08, 0x56, 0x02, + 0xeb, 0x11, 0x9a, 0x89, 0x64, 0xbd, 0x7e, 0xa0, 0x20, 0x98, 0x15, 0x37, 0x26, 0xbe, 0x74, 0x77, + 0x46, 0x31, 0xdd, 0x96, 0x33, 0x3c, 0xc3, 0xb4, 0x44, 0xc2, 0x2d, 0xf8, 0x40, 0x60, 0x4e, 0xbc, + 0x37, 0xf1, 0xa5, 0x8d, 0x04, 0x89, 0xe9, 0xfb, 0x04, 0x6c, 0x44, 0x88, 0x87, 0x48, 0xd6, 0xcd, + 0x66, 0x4d, 0x41, 0x1a, 0xcc, 0x8b, 0xef, 0x4c, 0x7c, 0x69, 0x6b, 0xc6, 0x62, 0xd7, 0x16, 0xed, + 0xd9, 0x40, 0xe0, 0x93, 0x58, 0x31, 0x91, 0x72, 0x62, 0x1c, 0x29, 0x01, 0x71, 0x49, 0x7c, 0x77, + 0xe2, 0x4b, 0xc2, 0x8c, 0x18, 0x3c, 0x19, 0x37, 0xcc, 0xb8, 0x54, 0xb9, 0x56, 0x43, 0xc6, 0x89, + 0x32, 0x3d, 0x12, 0x30, 0x27, 0x55, 0x1e, 0x0c, 0x5c, 0x72, 0x19, 0x94, 0x56, 0xcc, 0x7f, 0xf3, + 0x7d, 0x31, 0xf5, 0xe3, 0x0f, 0xc5, 0xd4, 0xde, 0xcf, 0x59, 0xb0, 0x32, 0x33, 0xdd, 0x11, 0x1e, + 0xf3, 0x9f, 0x81, 0x7b, 0xb2, 0x69, 0x22, 0xb5, 0xd2, 0x30, 0x95, 0xe6, 0x91, 0x72, 0x3a, 0xe7, + 0x2e, 0x96, 0x49, 0x94, 0x10, 0x35, 0xd8, 0x87, 0x80, 0x8f, 0x73, 0x75, 0x59, 0xa3, 0x16, 0x2b, + 0x4c, 0x7c, 0x09, 0x46, 0x49, 0x3a, 0x7d, 0x3c, 0x3e, 0x02, 0x85, 0x38, 0xba, 0x7e, 0xaa, 0x55, + 0x8c, 0xe3, 0xd0, 0x64, 0x51, 0x7c, 0x3d, 0x78, 0x56, 0x12, 0xfb, 0x6b, 0x8a, 0x29, 0xc3, 0x74, + 0x72, 0x7f, 0x8d, 0x3e, 0x2f, 0x4f, 0xe7, 0x33, 0xd9, 0x37, 0x74, 0x13, 0xc9, 0xfb, 0x66, 0x53, + 0xad, 0x86, 0x56, 0x8b, 0x92, 0xf6, 0xc3, 0x16, 0xae, 0x52, 0xcf, 0xc4, 0xa9, 0xc6, 0xe7, 0xba, + 0x82, 0xe0, 0x62, 0xe0, 0x99, 0x28, 0xc9, 0xf8, 0xca, 0xc1, 0x6e, 0x32, 0x15, 0x59, 0x33, 0x1a, + 0xba, 0x09, 0xb3, 0xc9, 0x54, 0x64, 0x76, 0xaf, 0xd0, 0x0e, 0x8e, 0x33, 0xaa, 0xca, 0xbe, 0xaa, + 0xc9, 0xc7, 0x75, 0x98, 0x0b, 0xbc, 0x1c, 0xe5, 0x54, 0xc3, 0x57, 0xf1, 0x11, 0xd8, 0x88, 0xb3, + 0x54, 0xed, 0xb0, 0xd9, 0x40, 0x2a, 0xcc, 0x27, 0x49, 0xaa, 0xdd, 0xea, 0xe1, 0x06, 0x52, 0x93, + 0xa1, 0x68, 0x2b, 0xcb, 0x95, 0x63, 0x05, 0x2e, 0x25, 0x59, 0xda, 0xf4, 0x91, 0x4d, 0x9e, 0x35, + 0x6b, 0x00, 0x90, 0x3c, 0x6b, 0xe6, 0xfd, 0x5d, 0x00, 0xe3, 0x68, 0xd3, 0x80, 0xcb, 0x22, 0x3f, + 0xf1, 0xa5, 0xd5, 0x28, 0xd6, 0x24, 0xc9, 0x7d, 0x99, 0xd3, 0x57, 0x92, 0xfb, 0x52, 0x9b, 0x27, + 0xb5, 0x4f, 0x4d, 0x8e, 0xe0, 0x9d, 0xa4, 0xf6, 0xa9, 0xc5, 0xdd, 0x64, 0xf9, 0x6a, 0xc8, 0xf8, + 0xe2, 0x14, 0xae, 0x26, 0xcb, 0x57, 0x73, 0xc9, 0xb3, 0x31, 0xbf, 0x07, 0xee, 0xce, 0x79, 0x1e, + 0xa9, 0x70, 0x4d, 0x5c, 0x9f, 0xf8, 0xd2, 0x5a, 0xcc, 0xeb, 0x48, 0xbd, 0x69, 0x9d, 0xca, 0xd3, + 0x17, 0x57, 0x45, 0xee, 0xe5, 0x55, 0x91, 0xfb, 0xe3, 0xaa, 0xc8, 0x7d, 0x7b, 0x5d, 0x4c, 0xbd, + 0xbc, 0x2e, 0xa6, 0x7e, 0xbb, 0x2e, 0xa6, 0xbe, 0xdc, 0xfe, 0xab, 0xf7, 0xe5, 0x59, 0xf0, 0xaf, + 0xdc, 0xce, 0xb2, 0x9f, 0xe5, 0x47, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x70, 0x77, 0xd2, 0xf6, + 0x86, 0x0b, 0x00, 0x00, } func (m *EventSent) Marshal() (dAtA []byte, err error) { diff --git a/x/token/genesis.go b/x/token/genesis.go index 58fcfb3996..8dc79d6df0 100644 --- a/x/token/genesis.go +++ b/x/token/genesis.go @@ -43,7 +43,7 @@ func ValidateGenesis(data GenesisState) error { if err := validateSymbol(c.Symbol); err != nil { return err } - if err := validateImageURI(c.Uri); err != nil { + if err := validateURI(c.Uri); err != nil { return err } if err := validateMeta(c.Meta); err != nil { diff --git a/x/token/keeper/msg_server.go b/x/token/keeper/msg_server.go index 5a32d9545f..55fb1bdd24 100644 --- a/x/token/keeper/msg_server.go +++ b/x/token/keeper/msg_server.go @@ -270,6 +270,8 @@ func (s msgServer) OperatorBurn(c context.Context, req *token.MsgOperatorBurn) ( func (s msgServer) Modify(c context.Context, req *token.MsgModify) (*token.MsgModifyResponse, error) { ctx := sdk.UnwrapSDKContext(c) + token.UpdateMsgModify(req) + if err := ValidateLegacyContract(s.keeper, ctx, req.ContractId); err != nil { return nil, err } diff --git a/x/token/keeper/supply.go b/x/token/keeper/supply.go index 8361d554f8..52139f8d8a 100644 --- a/x/token/keeper/supply.go +++ b/x/token/keeper/supply.go @@ -292,7 +292,7 @@ func (k Keeper) modify(ctx sdk.Context, contractID string, changes []token.Attri token.AttributeKeyName: func(name string) { class.Name = name }, - token.AttributeKeyImageURI: func(uri string) { + token.AttributeKeyURI: func(uri string) { class.Uri = uri }, token.AttributeKeyMeta: func(meta string) { diff --git a/x/token/keeper/supply_test.go b/x/token/keeper/supply_test.go index eb4f973779..4373e63d93 100644 --- a/x/token/keeper/supply_test.go +++ b/x/token/keeper/supply_test.go @@ -136,7 +136,7 @@ func (s *KeeperTestSuite) TestOperatorBurn() { func (s *KeeperTestSuite) TestModify() { changes := []token.Attribute{ {Key: token.AttributeKeyName.String(), Value: "new name"}, - {Key: token.AttributeKeyImageURI.String(), Value: "new uri"}, + {Key: token.AttributeKeyURI.String(), Value: "new uri"}, {Key: token.AttributeKeyMeta.String(), Value: "new meta"}, } diff --git a/x/token/msgs.go b/x/token/msgs.go index c82a9a4e75..6eae197eb1 100644 --- a/x/token/msgs.go +++ b/x/token/msgs.go @@ -201,7 +201,7 @@ func (m MsgIssue) ValidateBasic() error { return err } - if err := validateImageURI(m.Uri); err != nil { + if err := validateURI(m.Uri); err != nil { return err } @@ -453,6 +453,8 @@ var _ sdk.Msg = (*MsgModify)(nil) // ValidateBasic implements Msg. func (m MsgModify) ValidateBasic() error { + UpdateMsgModify(&m) + if err := ValidateContractID(m.ContractId); err != nil { return err } @@ -462,10 +464,11 @@ func (m MsgModify) ValidateBasic() error { seenKeys := map[string]bool{} for _, change := range m.Changes { - if seenKeys[change.Key] { + key := change.Key + if seenKeys[key] { return ErrDuplicateChangesField.Wrapf("duplicate fields: %s", change.Key) } - seenKeys[change.Key] = true + seenKeys[key] = true if err := validateChange(change); err != nil { return err @@ -478,6 +481,16 @@ func (m MsgModify) ValidateBasic() error { return nil } +func UpdateMsgModify(msg *MsgModify) { + for i, change := range msg.Changes { + key := change.Key + converted := canonicalKey(key) + if converted != key { + msg.Changes[i].Key = converted + } + } +} + // GetSigners implements Msg func (m MsgModify) GetSigners() []sdk.AccAddress { signer, _ := sdk.AccAddressFromBech32(m.Owner) diff --git a/x/token/msgs_test.go b/x/token/msgs_test.go index 34d9c209d5..bcea2eba95 100644 --- a/x/token/msgs_test.go +++ b/x/token/msgs_test.go @@ -651,8 +651,8 @@ func TestMsgModify(t *testing.T) { contractID: "deadbeef", grantee: addrs[0], changes: []token.Attribute{ - {Key: token.AttributeKeyName.String(), Value: "hello"}, - {Key: token.AttributeKeyName.String(), Value: "world"}, + {Key: token.AttributeKeyImageURI.String(), Value: "hello"}, + {Key: token.AttributeKeyURI.String(), Value: "world"}, }, err: token.ErrDuplicateChangesField, }, diff --git a/x/token/tx.pb.go b/x/token/tx.pb.go index 0a10aba133..7f365d374a 100644 --- a/x/token/tx.pb.go +++ b/x/token/tx.pb.go @@ -888,7 +888,7 @@ type MsgModify struct { // the address of the grantee which must have modify permission. Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` // changes to apply. - // possible attribute keys are: name, img_uri, meta + // possible attribute keys are: name, uri, img_uri (deprecated), meta Changes []Attribute `protobuf:"bytes,3,rep,name=changes,proto3" json:"changes"` } diff --git a/x/token/validation.go b/x/token/validation.go index 1d4deaeca2..1b92d7fc6f 100644 --- a/x/token/validation.go +++ b/x/token/validation.go @@ -11,9 +11,9 @@ import ( ) const ( - maxName = 20 - maxImageURI = 1000 - maxMeta = 1000 + maxName = 20 + maxURI = 1000 + maxMeta = 1000 ) var ( @@ -41,9 +41,9 @@ func validateSymbol(symbol string) error { return nil } -func validateImageURI(uri string) error { - if !stringInSize(uri, maxImageURI) { - return ErrInvalidImageURILength.Wrapf("image_uri cannot be longer than %d", maxImageURI) +func validateURI(uri string) error { + if !stringInSize(uri, maxURI) { + return ErrInvalidImageURILength.Wrapf("uri cannot be longer than %d", maxURI) } return nil } @@ -83,8 +83,9 @@ func ValidatePermission(permission Permission) error { func validateChange(change Attribute) error { validators := map[string]func(string) error{ AttributeKeyName.String(): validateName, - AttributeKeyImageURI.String(): validateImageURI, + AttributeKeyImageURI.String(): validateURI, AttributeKeyMeta.String(): validateMeta, + AttributeKeyURI.String(): validateURI, } validator, ok := validators[change.Key] @@ -97,3 +98,13 @@ func validateChange(change Attribute) error { func ValidateContractID(id string) error { return class.ValidateID(id) } + +func canonicalKey(key string) string { + convert := map[string]string{ + AttributeKeyImageURI.String(): AttributeKeyURI.String(), + } + if converted, ok := convert[key]; ok { + return converted + } + return key +}