diff --git a/.goreleaser.yml b/.goreleaser.yml index 92433837..649bd6ac 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,7 +6,7 @@ env: before: hooks: - - go mod tidy -compat=1.20 + - go mod tidy -compat=1.21 builds: - main: ./cmd/omniflixhubd diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 2e20bc56..4e56ec8e 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -1,6 +1,8 @@ package keepers import ( + "github.com/OmniFlix/omniflixhub/v2/x/ics721nft" + nfttransfer "github.com/bianjieai/nft-transfer" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" "github.com/cosmos/cosmos-sdk/baseapp" @@ -84,9 +86,9 @@ import ( icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router" - packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/keeper" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" + packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" + packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" allockeeper "github.com/OmniFlix/omniflixhub/v2/x/alloc/keeper" alloctypes "github.com/OmniFlix/omniflixhub/v2/x/alloc/types" @@ -102,6 +104,9 @@ import ( streampaykeeper "github.com/OmniFlix/streampay/v2/x/streampay/keeper" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" + + ibcnfttransferkeeper "github.com/bianjieai/nft-transfer/keeper" + ibcnfttransfertypes "github.com/bianjieai/nft-transfer/types" ) var tokenFactoryCapabilities = []string{ @@ -140,12 +145,14 @@ type AppKeepers struct { GlobalFeeKeeper globalfeekeeper.Keeper GroupKeeper groupkeeper.Keeper TokenFactoryKeeper tokenfactorykeeper.Keeper + IBCNFTTransferKeeper ibcnfttransferkeeper.Keeper // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedICQKeeper capabilitykeeper.ScopedKeeper + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedICQKeeper capabilitykeeper.ScopedKeeper + ScopedNFTTransferKeeper capabilitykeeper.ScopedKeeper AllocKeeper allockeeper.Keeper ONFTKeeper onftkeeper.Keeper @@ -205,6 +212,7 @@ func NewAppKeeper( appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) appKeepers.ScopedICQKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icqtypes.ModuleName) + appKeepers.ScopedNFTTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibcnfttransfertypes.ModuleName) appKeepers.CapabilityKeeper.Seal() @@ -356,13 +364,14 @@ func NewAppKeeper( // initialize ibc packet forwarding middleware router appKeepers.PacketForwardKeeper = packetforwardkeeper.NewKeeper( - appCodec, appKeepers.keys[packetforwardtypes.StoreKey], - appKeepers.GetSubspace(packetforwardtypes.ModuleName), + appCodec, + appKeepers.keys[packetforwardtypes.StoreKey], appKeepers.TransferKeeper, // Will be zero-value here. Reference is set later on with SetTransferKeeper. appKeepers.IBCKeeper.ChannelKeeper, appKeepers.DistrKeeper, appKeepers.BankKeeper, appKeepers.IBCKeeper.ChannelKeeper, + govModAddress, ) // Create Transfer Keepers @@ -397,12 +406,12 @@ func NewAppKeeper( appKeepers.ICQKeeper = icqkeeper.NewKeeper( appCodec, appKeepers.keys[icqtypes.StoreKey], - appKeepers.GetSubspace(icqtypes.ModuleName), appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with middleware appKeepers.IBCKeeper.ChannelKeeper, &appKeepers.IBCKeeper.PortKeeper, appKeepers.ScopedICQKeeper, bApp.GRPCQueryRouter(), + govModAddress, ) icqModule := icq.NewIBCModule(appKeepers.ICQKeeper) @@ -443,6 +452,21 @@ func NewAppKeeper( appKeepers.DistrKeeper, govModAddress, ) + + appKeepers.IBCNFTTransferKeeper = ibcnfttransferkeeper.NewKeeper( + appCodec, + keys[ibcnfttransfertypes.StoreKey], + govModAddress, + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCKeeper.ChannelKeeper, + &appKeepers.IBCKeeper.PortKeeper, + appKeepers.AccountKeeper, + ics721nft.NewKeeper(appCodec, appKeepers.ONFTKeeper, appKeepers.AccountKeeper), + appKeepers.ScopedNFTTransferKeeper, + ) + + nfttransferIBCModule := nfttransfer.NewIBCModule(appKeepers.IBCNFTTransferKeeper) + appKeepers.MarketplaceKeeper = marketplacekeeper.NewKeeper( appCodec, appKeepers.keys[marketplacetypes.StoreKey], @@ -490,7 +514,8 @@ func NewAppKeeper( ibcRouter. AddRoute(ibctransfertypes.ModuleName, ibcStack). AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - AddRoute(icqtypes.ModuleName, icqModule) + AddRoute(icqtypes.ModuleName, icqModule). + AddRoute(ibcnfttransfertypes.ModuleName, nfttransferIBCModule) appKeepers.IBCKeeper.SetRouter(ibcRouter) diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 37aae3f4..7ad21306 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -8,6 +8,7 @@ import ( onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" tokenfactorytypes "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" + ibcnfttransfertypes "github.com/bianjieai/nft-transfer/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -26,7 +27,7 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -51,6 +52,7 @@ func (appKeepers *AppKeepers) GenerateKeys() { icahosttypes.StoreKey, icqtypes.StoreKey, packetforwardtypes.StoreKey, + ibcnfttransfertypes.StoreKey, capabilitytypes.StoreKey, crisistypes.StoreKey, feegrant.StoreKey, diff --git a/app/modules.go b/app/modules.go index ddf8e2c5..ac64f3e6 100644 --- a/app/modules.go +++ b/app/modules.go @@ -3,6 +3,8 @@ package app import ( appparams "github.com/OmniFlix/omniflixhub/v2/app/params" "github.com/OmniFlix/omniflixhub/v2/x/globalfee" + nfttransfer "github.com/bianjieai/nft-transfer" + ibcnfttransfertypes "github.com/bianjieai/nft-transfer/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -65,6 +67,7 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v7/modules/core" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" @@ -73,8 +76,8 @@ import ( icq "github.com/cosmos/ibc-apps/modules/async-icq/v7" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types" - packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" + "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" "github.com/OmniFlix/omniflixhub/v2/x/alloc" alloctypes "github.com/OmniFlix/omniflixhub/v2/x/alloc/types" @@ -111,6 +114,7 @@ var ( crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, + ibctm.AppModuleBasic{}, ica.AppModuleBasic{}, icq.AppModuleBasic{}, packetforward.AppModuleBasic{}, @@ -122,6 +126,7 @@ var ( vesting.AppModuleBasic{}, globalfee.AppModuleBasic{}, tokenfactory.AppModuleBasic{}, + nfttransfer.AppModuleBasic{}, alloc.AppModuleBasic{}, onft.AppModuleBasic{}, @@ -140,6 +145,7 @@ var ( stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + ibcnfttransfertypes.ModuleName: nil, icatypes.ModuleName: nil, tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, globalfee.ModuleName: nil, @@ -221,8 +227,9 @@ func appModules( consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), transfer.NewAppModule(app.TransferKeeper), ica.NewAppModule(nil, &app.ICAHostKeeper), - icq.NewAppModule(app.ICQKeeper), - packetforward.NewAppModule(app.PacketForwardKeeper), + icq.NewAppModule(app.ICQKeeper, app.GetSubspace(icqtypes.ModuleName)), + nfttransfer.NewAppModule(app.IBCNFTTransferKeeper), + packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), globalfee.NewAppModule(appCodec, app.GlobalFeeKeeper, bondDenom), alloc.NewAppModule(appCodec, app.AllocKeeper, app.GetSubspace(alloctypes.ModuleName)), onft.NewAppModule( @@ -301,6 +308,7 @@ func orderBeginBlockers() []string { icatypes.ModuleName, icqtypes.ModuleName, packetforwardtypes.ModuleName, + ibcnfttransfertypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, authtypes.ModuleName, @@ -334,6 +342,7 @@ func orderEndBlockers() []string { icatypes.ModuleName, icqtypes.ModuleName, packetforwardtypes.ModuleName, + ibcnfttransfertypes.ModuleName, minttypes.ModuleName, slashingtypes.ModuleName, distrtypes.ModuleName, @@ -387,6 +396,7 @@ func orderInitGenesis() []string { icatypes.ModuleName, icqtypes.ModuleName, packetforwardtypes.ModuleName, + ibcnfttransfertypes.ModuleName, alloctypes.ModuleName, onfttypes.ModuleName, marketplacetypes.ModuleName, diff --git a/app/upgrades/v012/constants.go b/app/upgrades/v012/constants.go index 12e7ae18..f60cc848 100644 --- a/app/upgrades/v012/constants.go +++ b/app/upgrades/v012/constants.go @@ -3,7 +3,7 @@ package v012 import ( "github.com/OmniFlix/omniflixhub/v2/app/upgrades" store "github.com/cosmos/cosmos-sdk/store/types" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ) diff --git a/app/upgrades/v012/upgrades.go b/app/upgrades/v012/upgrades.go index 34f81db8..06735b27 100644 --- a/app/upgrades/v012/upgrades.go +++ b/app/upgrades/v012/upgrades.go @@ -10,7 +10,7 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ) diff --git a/go.mod b/go.mod index b96790e1..04f369a6 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,24 @@ module github.com/OmniFlix/omniflixhub/v2 -go 1.20 +go 1.21 require ( - github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef + github.com/OmniFlix/streampay/v2 v2.2.0-alpha.1 + github.com/bianjieai/nft-transfer v1.1.3-ibc-v7.3.0 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.2 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0 - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 - github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.1 + github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 + github.com/cosmos/ibc-go/v7 v7.3.1 github.com/golang/protobuf v1.5.3 - github.com/google/uuid v1.3.0 - github.com/gorilla/mux v1.8.0 + github.com/google/uuid v1.4.0 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb diff --git a/go.sum b/go.sum index 3676a3f5..9c88aa3a 100644 --- a/go.sum +++ b/go.sum @@ -217,6 +217,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= @@ -226,9 +227,11 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef h1:odIDkcCWx5PTTGM01OgKicnuIx2KaxjNAxrUqdBgtHE= -github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef/go.mod h1:geZrSHVaGHERqTn1tuFfoH3PIHV5TOwaRErzi4Jnbcw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/OmniFlix/streampay/v2 v2.2.0-alpha.1 h1:atuisgnfQ1APLEwVOOvrRbJFf0qN8WfWeLBKEF9CFdQ= +github.com/OmniFlix/streampay/v2 v2.2.0-alpha.1/go.mod h1:C0+uhcZvzLqT9o1Xiy+LshBp8FzMTK6KHjAPKLVD818= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -239,6 +242,7 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -284,6 +288,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bianjieai/nft-transfer v1.1.3-ibc-v7.3.0 h1:399lErsTpI+faTerw5Q4OuVlXAmAQSuibVvxHR3C6OY= +github.com/bianjieai/nft-transfer v1.1.3-ibc-v7.3.0/go.mod h1:u2PNH4v8CD4AWU4Rf7yt8/qqQtrrwwHiw03qQSKERhg= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -295,6 +301,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -311,6 +318,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= @@ -380,6 +388,7 @@ github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSM github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -402,12 +411,12 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0 h1:i9esYyZ5ExpZOgxrLMQhY2jDTVYiaD8yUeqXN9QBgbk= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0/go.mod h1:fctjEnz9xaBFOlmYYPdKL8Hs1Y3GUKilSwsJdqBb5QU= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 h1:mMHedP3Q+mz5gpOWNz0P+X8hxPdamylrBKc/P2cFakA= -github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0/go.mod h1:/P6l2bWo2AR3rrsfs0DHuFZO3Imzb93sxFD3ihrIgw4= -github.com/cosmos/ibc-go/v7 v7.2.0 h1:dx0DLUl7rxdyZ8NiT6UsrbzKOJx/w7s+BOaewFRH6cg= -github.com/cosmos/ibc-go/v7 v7.2.0/go.mod h1:OOcjKIRku/j1Xs1RgKK0yvKRrJ5iFuZYMetR1n3yMlc= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.1 h1:PqIK9vTr6zxCdQmrDZwxwL4KMAqg/GRGsiMEiaMP4wA= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.1/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= +github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 h1:02RCbih5lQ8aGdDMSvxhTnk5JDLEDitn17ytEE1Qhko= +github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1/go.mod h1:LvVkEXTORVgd87W2Yu7ZY3acKKeTMq/txdTworn8EZI= +github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= +github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -418,7 +427,7 @@ github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzU github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -459,7 +468,9 @@ github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/ github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -493,9 +504,11 @@ github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -516,6 +529,7 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -639,12 +653,14 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -669,8 +685,9 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -695,8 +712,9 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -794,6 +812,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -952,6 +971,7 @@ github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -962,15 +982,20 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= 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= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -981,6 +1006,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1000,6 +1026,7 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1084,6 +1111,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd 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.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1099,8 +1127,8 @@ github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1204,6 +1232,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= +go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -1286,6 +1316,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1400,6 +1431,7 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1902,6 +1934,7 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/x/ics721nft/interface.go b/x/ics721nft/interface.go new file mode 100644 index 00000000..48ab05a9 --- /dev/null +++ b/x/ics721nft/interface.go @@ -0,0 +1,36 @@ +package ics721nft + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +type ( + // AccountKeeper defines the contract required for account APIs. + AccountKeeper interface { + NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + SetAccount(sdk.Context, authtypes.AccountI) + GetModuleAddress(name string) sdk.AccAddress + } + + ICS721Class struct { + ID string + URI string + Data string + } + + ICS721Token struct { + ClassID string + ID string + URI string + Data string + } +) + +func (c ICS721Class) GetID() string { return c.ID } +func (c ICS721Class) GetURI() string { return c.URI } +func (c ICS721Class) GetData() string { return c.Data } +func (t ICS721Token) GetClassID() string { return t.ClassID } +func (t ICS721Token) GetID() string { return t.ID } +func (t ICS721Token) GetURI() string { return t.URI } +func (t ICS721Token) GetData() string { return t.Data } diff --git a/x/ics721nft/keeper.go b/x/ics721nft/keeper.go new file mode 100644 index 00000000..84715f4e --- /dev/null +++ b/x/ics721nft/keeper.go @@ -0,0 +1,174 @@ +package ics721nft + +import ( + onftkeeper "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + nfttransfer "github.com/bianjieai/nft-transfer/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/nft" + nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" +) + +// Keeper defines the ICS721 Keeper +type Keeper struct { + nk nftkeeper.Keeper + cdc codec.Codec + ak AccountKeeper + cb onfttypes.ClassBuilder + tb onfttypes.NFTBuilder +} + +// NewKeeper creates a new ics721 Keeper instance +func NewKeeper(cdc codec.Codec, + k onftkeeper.Keeper, + ak AccountKeeper, +) Keeper { + return Keeper{ + nk: k.NFTkeeper(), + cdc: cdc, + ak: ak, + cb: onfttypes.NewClassBuilder(cdc, ak.GetModuleAddress), + tb: onfttypes.NewNFTBuilder(cdc), + } +} + +// CreateOrUpdateClass implement the method of ICS721Keeper.CreateOrUpdateClass +func (k Keeper) CreateOrUpdateClass(ctx sdk.Context, + classID, + classURI, + classData string, +) error { + var ( + class nft.Class + err error + ) + if len(classData) != 0 { + class, err = k.cb.Build(classID, classURI, classData) + if err != nil { + k.Logger(ctx).Error("unable to build class from packet data", "error:", err.Error()) + return err + } + } else { + denomMetadata := &onfttypes.DenomMetadata{ + Creator: k.ak.GetModuleAddress(onfttypes.ModuleName).String(), + PreviewUri: "", + Schema: "", + } + + metadata, err := codectypes.NewAnyWithValue(denomMetadata) + if err != nil { + k.Logger(ctx).Error("unable to build class metadata from packet data", "error:", err.Error()) + return err + } + class = nft.Class{ + Id: classID, + Uri: classURI, + Data: metadata, + } + } + if k.nk.HasClass(ctx, classID) { + return k.nk.UpdateClass(ctx, class) + } + return k.nk.SaveClass(ctx, class) +} + +// Mint implement the method of ICS721Keeper.Mint +func (k Keeper) Mint(ctx sdk.Context, + classID, + tokenID, + tokenURI, + tokenData string, + receiver sdk.AccAddress, +) error { + token, err := k.tb.Build(classID, tokenID, tokenURI, tokenData) + if err != nil { + k.Logger(ctx).Error("unable to build token from packet data", "error:", err.Error()) + return err + } + return k.nk.Mint(ctx, token, receiver) +} + +// Transfer implement the method of ICS721Keeper.Transfer +func (k Keeper) Transfer( + ctx sdk.Context, + classID, + tokenID, + tokenData string, + receiver sdk.AccAddress, +) error { + if err := k.nk.Transfer(ctx, classID, tokenID, receiver); err != nil { + return err + } + if len(tokenData) == 0 { + return nil + } + _nft, _ := k.nk.GetNFT(ctx, classID, tokenID) + token, err := k.tb.Build(classID, tokenID, _nft.GetUri(), tokenData) + if err != nil { + k.Logger(ctx).Error("unable to build token on transfer from packet data", "error:", err.Error()) + return err + } + + return k.nk.Update(ctx, token) +} + +// GetClass implement the method of ICS721Keeper.GetClass +func (k Keeper) GetClass(ctx sdk.Context, classID string) (nfttransfer.Class, bool) { + class, exist := k.nk.GetClass(ctx, classID) + if !exist { + return nil, false + } + metadata, err := k.cb.BuildMetadata(class) + if err != nil { + k.Logger(ctx).Error("encode class data failed") + return nil, false + } + + return ICS721Class{ + ID: classID, + URI: class.Uri, + Data: metadata, + }, true +} + +// GetNFT implement the method of ICS721Keeper.GetNFT +func (k Keeper) GetNFT(ctx sdk.Context, classID, tokenID string) (nfttransfer.NFT, bool) { + _nft, has := k.nk.GetNFT(ctx, classID, tokenID) + if !has { + return nil, false + } + metadata, err := k.tb.BuildMetadata(_nft) + if err != nil { + k.Logger(ctx).Error("encode nft data failed") + return nil, false + } + return ICS721Token{ + ClassID: classID, + ID: tokenID, + URI: _nft.Uri, + Data: metadata, + }, true +} + +// Burn implement the method of ICS721Keeper.Burn +func (k Keeper) Burn(ctx sdk.Context, classID string, tokenID string) error { + return k.nk.Burn(ctx, classID, tokenID) +} + +// GetOwner implement the method of ICS721Keeper.GetOwner +func (k Keeper) GetOwner(ctx sdk.Context, classID string, tokenID string) sdk.AccAddress { + return k.nk.GetOwner(ctx, classID, tokenID) +} + +// HasClass implement the method of ICS721Keeper.HasClass +func (k Keeper) HasClass(ctx sdk.Context, classID string) bool { + return k.nk.HasClass(ctx, classID) +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "ics721/NFTKeeper") +} diff --git a/x/itc/client/cli/query.go b/x/itc/client/cli/query.go index 36cdc887..4b2afe4a 100644 --- a/x/itc/client/cli/query.go +++ b/x/itc/client/cli/query.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "strconv" - "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -75,7 +74,7 @@ func GetCmdQueryCampaign() *cobra.Command { return err } - campaignId, err := strconv.ParseUint(strings.ToLower(strings.TrimSpace(args[0])), 10, 64) + campaignId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } diff --git a/x/marketplace/client/cli/query.go b/x/marketplace/client/cli/query.go index 8297f2e1..95680f1a 100644 --- a/x/marketplace/client/cli/query.go +++ b/x/marketplace/client/cli/query.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "strconv" - "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -80,7 +79,7 @@ func GetCmdQueryListing() *cobra.Command { return err } - listingId := strings.ToLower(strings.TrimSpace(args[0])) + listingId := args[0] queryClient := types.NewQueryClient(clientCtx) @@ -208,7 +207,7 @@ func GetCmdQueryAuction() *cobra.Command { return err } - auctionId, err := strconv.ParseUint(strings.ToLower(strings.TrimSpace(args[0])), 10, 64) + auctionId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } @@ -339,7 +338,7 @@ func GetCmdQueryAuctionBid() *cobra.Command { return err } - auctionId, err := strconv.ParseUint(strings.ToLower(strings.TrimSpace(args[0])), 10, 64) + auctionId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } diff --git a/x/marketplace/client/cli/tx.go b/x/marketplace/client/cli/tx.go index 40059e00..a9d3cb70 100644 --- a/x/marketplace/client/cli/tx.go +++ b/x/marketplace/client/cli/tx.go @@ -129,7 +129,7 @@ func GetCmdEditListing() *cobra.Command { owner := clientCtx.GetFromAddress() - listingId := strings.TrimSpace(args[0]) + listingId := args[0] priceStr, err := cmd.Flags().GetString(FlagPrice) if err != nil { @@ -177,7 +177,7 @@ func GetCmdDeListNft() *cobra.Command { owner := clientCtx.GetFromAddress() - listingId := strings.TrimSpace(args[0]) + listingId := args[0] msg := types.NewMsgDeListNFT(listingId, owner) if err := msg.ValidateBasic(); err != nil { @@ -408,7 +408,7 @@ func GetCmdCancelAuction() *cobra.Command { owner := clientCtx.GetFromAddress() - auctionId, err := strconv.ParseUint(strings.TrimSpace(args[0]), 10, 64) + auctionId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } diff --git a/x/marketplace/types/validation.go b/x/marketplace/types/validation.go index c01b2229..fb29a09b 100644 --- a/x/marketplace/types/validation.go +++ b/x/marketplace/types/validation.go @@ -1,7 +1,6 @@ package types import ( - "strings" "time" errorsmod "cosmossdk.io/errors" @@ -49,7 +48,6 @@ func ValidateDuration(t interface{}) error { } func ValidateId(id string) error { - id = strings.TrimSpace(id) if len(id) < MinListingIdLength || len(id) > MaxListingIdLength { return errorsmod.Wrapf( ErrInvalidListingId, diff --git a/x/onft/client/cli/query.go b/x/onft/client/cli/query.go index 036aee2a..7edaa41a 100644 --- a/x/onft/client/cli/query.go +++ b/x/onft/client/cli/query.go @@ -63,7 +63,7 @@ $ %s query onft supply [denom-id]`, version.AppName)), } } - denomId := strings.ToLower(strings.TrimSpace(args[0])) + denomId := args[0] queryClient := types.NewQueryClient(clientCtx) resp, err := queryClient.Supply(context.Background(), &types.QuerySupplyRequest{ @@ -218,10 +218,7 @@ $ %s query onft denom `, version.AppName)), return err } - denomId := strings.ToLower(strings.TrimSpace(args[0])) - if err := types.ValidateDenomID(denomId); err != nil { - return err - } + denomId := args[0] queryClient := types.NewQueryClient(clientCtx) resp, err := queryClient.Denom(context.Background(), &types.QueryDenomRequest{ diff --git a/x/onft/keeper/grpc_query.go b/x/onft/keeper/grpc_query.go index 9f90fd63..27b79411 100644 --- a/x/onft/keeper/grpc_query.go +++ b/x/onft/keeper/grpc_query.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "strings" "github.com/cosmos/cosmos-sdk/x/nft" @@ -18,19 +17,18 @@ import ( var _ types.QueryServer = Keeper{} func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error) { - denom := strings.ToLower(strings.TrimSpace(request.DenomId)) ctx := sdk.UnwrapSDKContext(c) var supply uint64 switch { - case len(request.Owner) == 0 && len(denom) > 0: - supply = k.GetTotalSupply(ctx, denom) + case len(request.Owner) == 0 && len(request.DenomId) > 0: + supply = k.GetTotalSupply(ctx, request.DenomId) default: owner, err := sdk.AccAddressFromBech32(request.Owner) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid owner address %s", request.Owner) } - supply = k.GetBalance(ctx, denom, owner) + supply = k.GetBalance(ctx, request.DenomId, owner) } return &types.QuerySupplyResponse{ Amount: supply, @@ -151,10 +149,9 @@ func (k Keeper) IBCCollection(c context.Context, request *types.QueryIBCCollecti } func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error) { - denom := strings.ToLower(strings.TrimSpace(request.DenomId)) ctx := sdk.UnwrapSDKContext(c) - denomObject, err := k.GetDenomInfo(ctx, denom) + denomObject, err := k.GetDenomInfo(ctx, request.DenomId) if err != nil { return nil, err } @@ -216,11 +213,9 @@ func (k Keeper) Denoms(c context.Context, request *types.QueryDenomsRequest) (*t } func (k Keeper) ONFT(c context.Context, request *types.QueryONFTRequest) (*types.QueryONFTResponse, error) { - denom := strings.ToLower(strings.TrimSpace(request.DenomId)) - onftID := strings.ToLower(strings.TrimSpace(request.Id)) ctx := sdk.UnwrapSDKContext(c) - onft, err := k.GetONFT(ctx, denom, onftID) + onft, err := k.GetONFT(ctx, request.DenomId, request.Id) if err != nil { return nil, errorsmod.Wrapf(types.ErrUnknownONFT, "invalid ONFT %s from collection %s", request.Id, request.DenomId) } diff --git a/x/onft/types/builder.go b/x/onft/types/builder.go index 11020a70..a15dbc5b 100644 --- a/x/onft/types/builder.go +++ b/x/onft/types/builder.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "time" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -31,6 +32,11 @@ var ( nftKeyURIHash = fmt.Sprintf("%s%s", Namespace, "uri_hash") nftKeyPreviewURI = fmt.Sprintf("%s%s", Namespace, "preview_uri") nftKeyDescription = fmt.Sprintf("%s%s", Namespace, "description") + nftKeyCreatedAt = fmt.Sprintf("%s%s", Namespace, "created_at") + nftKeyTransferable = fmt.Sprintf("%s%s", Namespace, "transferable") + nftKeyExtensible = fmt.Sprintf("%s%s", Namespace, "extensible") + nftKeyNSFW = fmt.Sprintf("%s%s", Namespace, "nsfw") + nftKeyRoyaltyShare = fmt.Sprintf("%s%s", Namespace, "royalty_share") ) type ClassBuilder struct { @@ -215,9 +221,12 @@ func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, er } denomMeta, err := codectypes.NewAnyWithValue(&DenomMetadata{ - Creator: creator, - Schema: schema, - Data: data, + Creator: creator, + Schema: schema, + Description: description, + PreviewUri: previewURI, + Data: data, + UriHash: uriHash, }) if err != nil { return nft.Class{}, err @@ -264,9 +273,14 @@ func (nb NFTBuilder) BuildMetadata(_nft nft.NFT) (string, error) { } } kvals[nftKeyName] = MediaField{Value: nftMetadata.Name} - kvals[nftKeyURIHash] = MediaField{Value: _nft.UriHash} - kvals[nftKeyPreviewURI] = MediaField{Value: nftMetadata.PreviewURI} kvals[nftKeyDescription] = MediaField{Value: nftMetadata.Description} + kvals[nftKeyPreviewURI] = MediaField{Value: nftMetadata.PreviewURI} + kvals[nftKeyTransferable] = MediaField{Value: nftMetadata.Transferable} + kvals[nftKeyExtensible] = MediaField{Value: nftMetadata.Extensible} + kvals[nftKeyNSFW] = MediaField{Value: nftMetadata.Nsfw} + kvals[nftKeyCreatedAt] = MediaField{Value: nftMetadata.CreatedAt} + kvals[nftKeyRoyaltyShare] = MediaField{Value: nftMetadata.RoyaltyShare} + kvals[nftKeyURIHash] = MediaField{Value: _nft.UriHash} data, err := json.Marshal(kvals) if err != nil { return "", err @@ -299,8 +313,15 @@ func (nb NFTBuilder) Build(classId, nftID, nftURI, nftData string) (nft.NFT, err } var ( - name string - uriHash string + name string + description string + previewURI string + transferable = true + extensible = true + nsfw = false + createdAt string + royaltyShare string + uriHash string ) if v, ok := dataMap[nftKeyName]; ok { if vMap, ok := v.(map[string]interface{}); ok { @@ -311,6 +332,15 @@ func (nb NFTBuilder) Build(classId, nftID, nftURI, nftData string) (nft.NFT, err } } + if v, ok := dataMap[nftKeyDescription]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + description = vStr + delete(dataMap, nftKeyDescription) + } + } + } + if v, ok := dataMap[nftKeyURIHash]; ok { if vMap, ok := v.(map[string]interface{}); ok { if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { @@ -319,6 +349,57 @@ func (nb NFTBuilder) Build(classId, nftID, nftURI, nftData string) (nft.NFT, err } } } + if v, ok := dataMap[nftKeyPreviewURI]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + previewURI = vStr + delete(dataMap, nftKeyPreviewURI) + } + } + } + if v, ok := dataMap[nftKeyCreatedAt]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + createdAt = vStr + delete(dataMap, nftKeyCreatedAt) + } + } + } + if v, ok := dataMap[nftKeyTransferable]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vBool, ok := vMap[KeyMediaFieldValue].(bool); ok { + transferable = vBool + delete(dataMap, nftKeyTransferable) + } + } + } + + if v, ok := dataMap[nftKeyExtensible]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vBool, ok := vMap[KeyMediaFieldValue].(bool); ok { + extensible = vBool + delete(dataMap, nftKeyExtensible) + } + } + } + + if v, ok := dataMap[nftKeyNSFW]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vBool, ok := vMap[KeyMediaFieldValue].(bool); ok { + nsfw = vBool + delete(dataMap, nftKeyNSFW) + } + } + } + + if v, ok := dataMap[nftKeyRoyaltyShare]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vDec, ok := vMap[KeyMediaFieldValue].(string); ok { + royaltyShare = vDec + delete(dataMap, nftKeyRoyaltyShare) + } + } + } data := "" if len(dataMap) > 0 { @@ -328,10 +409,19 @@ func (nb NFTBuilder) Build(classId, nftID, nftURI, nftData string) (nft.NFT, err } data = string(dataBz) } + createdTime, _ := time.Parse(time.RFC3339, createdAt) + royalty, _ := sdk.NewDecFromStr(royaltyShare) metadata, err := codectypes.NewAnyWithValue(&ONFTMetadata{ - Name: name, - Data: data, + Name: name, + Description: description, + PreviewURI: previewURI, + Data: data, + Transferable: transferable, + Extensible: extensible, + Nsfw: nsfw, + CreatedAt: createdTime, + RoyaltyShare: royalty, }) if err != nil { return nft.NFT{}, err diff --git a/x/onft/types/constants.go b/x/onft/types/constants.go index 847471d7..4ece88de 100644 --- a/x/onft/types/constants.go +++ b/x/onft/types/constants.go @@ -2,9 +2,9 @@ package types const ( MinDenomLen = 3 - MaxDenomLen = 64 + MaxDenomLen = 128 MinIDLen = 3 - MaxIDLen = 64 + MaxIDLen = 128 MaxNameLen = 256 MaxDescriptionLen = 4096 MaxURILen = 256 diff --git a/x/onft/types/genesis.go b/x/onft/types/genesis.go index 45f2c6d3..42a97a91 100644 --- a/x/onft/types/genesis.go +++ b/x/onft/types/genesis.go @@ -25,9 +25,6 @@ func ValidateGenesis(data GenesisState) error { if err := ValidateDenomID(c.Denom.Id); err != nil { return err } - if err := ValidateDenomSymbol(c.Denom.Symbol); err != nil { - return err - } if err := ValidateName(c.Denom.Name); err != nil { return err } diff --git a/x/onft/types/msgs.go b/x/onft/types/msgs.go index 3bdafaec..5991540b 100644 --- a/x/onft/types/msgs.go +++ b/x/onft/types/msgs.go @@ -62,18 +62,16 @@ func (msg MsgCreateDenom) ValidateBasic() error { if err := ValidateDenomSymbol(msg.Symbol); err != nil { return err } - name := strings.TrimSpace(msg.Name) - if len(name) > 0 && !utf8.ValidString(name) { + if len(msg.Name) > 0 && !utf8.ValidString(msg.Name) { return errorsmod.Wrap(ErrInvalidName, "denom name is invalid") } - if err := ValidateName(name); err != nil { + if err := ValidateName(msg.Name); err != nil { return err } - description := strings.TrimSpace(msg.Description) - if len(description) > 0 && !utf8.ValidString(description) { + if len(msg.Description) > 0 && !utf8.ValidString(msg.Description) { return errorsmod.Wrap(ErrInvalidDescription, "denom description is invalid") } - if err := ValidateDescription(description); err != nil { + if err := ValidateDescription(msg.Description); err != nil { return err } if err := ValidateURI(msg.PreviewURI); err != nil { @@ -121,18 +119,16 @@ func (msg MsgUpdateDenom) ValidateBasic() error { if err := ValidateDenomID(msg.Id); err != nil { return err } - name := msg.Name - if len(name) > 0 && !utf8.ValidString(name) { + if len(msg.Name) > 0 && !utf8.ValidString(msg.Name) { return errorsmod.Wrap(ErrInvalidName, "denom name is invalid") } - if err := ValidateName(name); err != nil { + if err := ValidateName(msg.Name); err != nil { return err } - description := strings.TrimSpace(msg.Description) - if len(description) > 0 && !utf8.ValidString(description) { + if len(msg.Description) > 0 && !utf8.ValidString(msg.Description) { return errorsmod.Wrap(ErrInvalidDescription, "denom description is invalid") } - if err := ValidateDescription(description); err != nil { + if err := ValidateDescription(msg.Description); err != nil { return err } if err := ValidateURI(msg.PreviewURI); err != nil {