From b5b8e430259a1ff03fe75a2b198175cd1eaacae4 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 13 Dec 2022 01:40:11 +0100 Subject: [PATCH 1/2] refactor: update rosetta to use `coinbase/rosetta-sdk-go/types` --- tools/rosetta/CHANGELOG.md | 4 ++++ tools/rosetta/README.md | 2 +- tools/rosetta/client_offline.go | 2 +- tools/rosetta/client_online.go | 2 +- tools/rosetta/config.go | 2 +- tools/rosetta/converter.go | 2 +- tools/rosetta/converter_test.go | 15 ++++++--------- tools/rosetta/go.mod | 3 ++- tools/rosetta/go.sum | 6 ++++-- tools/rosetta/lib/errors/errors.go | 2 +- tools/rosetta/lib/errors/registry.go | 2 +- tools/rosetta/lib/internal/service/account.go | 2 +- tools/rosetta/lib/internal/service/block.go | 2 +- .../rosetta/lib/internal/service/construction.go | 2 +- tools/rosetta/lib/internal/service/mempool.go | 2 +- tools/rosetta/lib/internal/service/network.go | 2 +- tools/rosetta/lib/internal/service/offline.go | 2 +- tools/rosetta/lib/internal/service/online.go | 2 +- tools/rosetta/lib/server/server.go | 2 +- tools/rosetta/lib/types/types.go | 2 +- 20 files changed, 32 insertions(+), 28 deletions(-) diff --git a/tools/rosetta/CHANGELOG.md b/tools/rosetta/CHANGELOG.md index 4ea959976136..d6cb7d4e40ff 100644 --- a/tools/rosetta/CHANGELOG.md +++ b/tools/rosetta/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* [](https://github.com/cosmos/cosmos-sdk/pull/) Use `coinbase/rosetta-sdk-go/types` packages instead of comsos fork. + ## v0.2.0 2022-12-07 ### Improvements diff --git a/tools/rosetta/README.md b/tools/rosetta/README.md index aad1da34ad24..3d8467aea892 100644 --- a/tools/rosetta/README.md +++ b/tools/rosetta/README.md @@ -86,7 +86,7 @@ package custom_client import ( "context" -"github.com/cosmos/rosetta-sdk-go/types" +"github.com/coinbase/rosetta-sdk-go/types" "cosmossdk.io/tools/rosetta/lib" ) diff --git a/tools/rosetta/client_offline.go b/tools/rosetta/client_offline.go index 94ddd12d2016..adbf734ab538 100644 --- a/tools/rosetta/client_offline.go +++ b/tools/rosetta/client_offline.go @@ -4,7 +4,7 @@ import ( "context" "encoding/hex" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" crgerrs "cosmossdk.io/tools/rosetta/lib/errors" diff --git a/tools/rosetta/client_online.go b/tools/rosetta/client_online.go index ee1c6580f45d..f2dc1fdabac5 100644 --- a/tools/rosetta/client_online.go +++ b/tools/rosetta/client_online.go @@ -15,7 +15,7 @@ import ( abcitypes "github.com/tendermint/tendermint/abci/types" - rosettatypes "github.com/cosmos/rosetta-sdk-go/types" + rosettatypes "github.com/coinbase/rosetta-sdk-go/types" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" diff --git a/tools/rosetta/config.go b/tools/rosetta/config.go index 43be3d0cd222..6b549387aa03 100644 --- a/tools/rosetta/config.go +++ b/tools/rosetta/config.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" "github.com/spf13/pflag" crg "cosmossdk.io/tools/rosetta/lib/server" diff --git a/tools/rosetta/converter.go b/tools/rosetta/converter.go index 77aaa29a344b..4fd1f8366dc9 100644 --- a/tools/rosetta/converter.go +++ b/tools/rosetta/converter.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/math" "github.com/btcsuite/btcd/btcec/v2" - rosettatypes "github.com/cosmos/rosetta-sdk-go/types" + rosettatypes "github.com/coinbase/rosetta-sdk-go/types" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" tmcoretypes "github.com/tendermint/tendermint/rpc/core/types" diff --git a/tools/rosetta/converter_test.go b/tools/rosetta/converter_test.go index c2b0259d619c..3fa9979028a7 100644 --- a/tools/rosetta/converter_test.go +++ b/tools/rosetta/converter_test.go @@ -1,25 +1,22 @@ package rosetta_test import ( - "cosmossdk.io/tools/rosetta" "encoding/hex" "encoding/json" "testing" - abci "github.com/tendermint/tendermint/abci/types" + "cosmossdk.io/tools/rosetta" + crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + rosettatypes "github.com/coinbase/rosetta-sdk-go/types" + "github.com/stretchr/testify/suite" + abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - - rosettatypes "github.com/cosmos/rosetta-sdk-go/types" - "github.com/stretchr/testify/suite" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - sdk "github.com/cosmos/cosmos-sdk/types" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" bank "github.com/cosmos/cosmos-sdk/x/bank/types" ) diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index 425026b16f92..e2ceda01b816 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -5,8 +5,9 @@ go 1.19 require ( cosmossdk.io/math v1.0.0-beta.4 github.com/btcsuite/btcd/btcec/v2 v2.3.2 + github.com/coinbase/rosetta-sdk-go/types v1.0.0 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20221207001918-ed5124f932fd - github.com/cosmos/rosetta-sdk-go v0.9.0 + github.com/cosmos/rosetta-sdk-go v0.10.0 github.com/rs/zerolog v1.28.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index 95dc5620a257..b8b4349c1afd 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -98,6 +98,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= +github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -122,8 +124,8 @@ github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= -github.com/cosmos/rosetta-sdk-go v0.9.0 h1:3mj2naR+GUhUXabtb96WWSsPFZDCYkdtp6r0jffgugg= -github.com/cosmos/rosetta-sdk-go v0.9.0/go.mod h1:2v41yXL25xxAXrczVSnbDHcQH9CgildruDlGQGKW/JU= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +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.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= diff --git a/tools/rosetta/lib/errors/errors.go b/tools/rosetta/lib/errors/errors.go index bb1f41282d6a..5fcc0c760279 100644 --- a/tools/rosetta/lib/errors/errors.go +++ b/tools/rosetta/lib/errors/errors.go @@ -9,7 +9,7 @@ import ( grpccodes "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" tmtypes "github.com/tendermint/tendermint/rpc/jsonrpc/types" ) diff --git a/tools/rosetta/lib/errors/registry.go b/tools/rosetta/lib/errors/registry.go index 7fa35083a5bc..9cbafcacf7dc 100644 --- a/tools/rosetta/lib/errors/registry.go +++ b/tools/rosetta/lib/errors/registry.go @@ -5,7 +5,7 @@ import ( "os" "sync" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" ) type errorRegistry struct { diff --git a/tools/rosetta/lib/internal/service/account.go b/tools/rosetta/lib/internal/service/account.go index 4c9c50af3a10..5636a35b0261 100644 --- a/tools/rosetta/lib/internal/service/account.go +++ b/tools/rosetta/lib/internal/service/account.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/tools/rosetta/lib/errors" crgtypes "cosmossdk.io/tools/rosetta/lib/types" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" ) // AccountBalance retrieves the account balance of an address diff --git a/tools/rosetta/lib/internal/service/block.go b/tools/rosetta/lib/internal/service/block.go index 11924967658d..48b96a4bc1c4 100644 --- a/tools/rosetta/lib/internal/service/block.go +++ b/tools/rosetta/lib/internal/service/block.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/tools/rosetta/lib/errors" crgtypes "cosmossdk.io/tools/rosetta/lib/types" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" ) // Block gets the transactions in the given block diff --git a/tools/rosetta/lib/internal/service/construction.go b/tools/rosetta/lib/internal/service/construction.go index a2efc4f592f4..5fa770897b63 100644 --- a/tools/rosetta/lib/internal/service/construction.go +++ b/tools/rosetta/lib/internal/service/construction.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" "cosmossdk.io/tools/rosetta/lib/errors" ) diff --git a/tools/rosetta/lib/internal/service/mempool.go b/tools/rosetta/lib/internal/service/mempool.go index fc51b1b748e3..9e93085bc090 100644 --- a/tools/rosetta/lib/internal/service/mempool.go +++ b/tools/rosetta/lib/internal/service/mempool.go @@ -4,7 +4,7 @@ import ( "context" "cosmossdk.io/tools/rosetta/lib/errors" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" ) // Mempool fetches the transactions contained in the mempool diff --git a/tools/rosetta/lib/internal/service/network.go b/tools/rosetta/lib/internal/service/network.go index 95a0286684a4..a5fd13f8e655 100644 --- a/tools/rosetta/lib/internal/service/network.go +++ b/tools/rosetta/lib/internal/service/network.go @@ -4,7 +4,7 @@ import ( "context" "cosmossdk.io/tools/rosetta/lib/errors" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" ) func (on OnlineNetwork) NetworkList(_ context.Context, _ *types.MetadataRequest) (*types.NetworkListResponse, *types.Error) { diff --git a/tools/rosetta/lib/internal/service/offline.go b/tools/rosetta/lib/internal/service/offline.go index 0dac4f69707a..7f4a19bb0b2b 100644 --- a/tools/rosetta/lib/internal/service/offline.go +++ b/tools/rosetta/lib/internal/service/offline.go @@ -3,7 +3,7 @@ package service import ( "context" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" crgerrs "cosmossdk.io/tools/rosetta/lib/errors" crgtypes "cosmossdk.io/tools/rosetta/lib/types" diff --git a/tools/rosetta/lib/internal/service/online.go b/tools/rosetta/lib/internal/service/online.go index 3b48dedfba05..c2f03fe19a2e 100644 --- a/tools/rosetta/lib/internal/service/online.go +++ b/tools/rosetta/lib/internal/service/online.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/cosmos/rosetta-sdk-go/types" + "github.com/coinbase/rosetta-sdk-go/types" "github.com/rs/zerolog" crgerrs "cosmossdk.io/tools/rosetta/lib/errors" diff --git a/tools/rosetta/lib/server/server.go b/tools/rosetta/lib/server/server.go index 4976ea37f040..4ebb405eb121 100644 --- a/tools/rosetta/lib/server/server.go +++ b/tools/rosetta/lib/server/server.go @@ -5,9 +5,9 @@ import ( "net/http" "time" + "github.com/coinbase/rosetta-sdk-go/types" assert "github.com/cosmos/rosetta-sdk-go/asserter" "github.com/cosmos/rosetta-sdk-go/server" - "github.com/cosmos/rosetta-sdk-go/types" "github.com/rs/zerolog" "cosmossdk.io/tools/rosetta/lib/internal/service" diff --git a/tools/rosetta/lib/types/types.go b/tools/rosetta/lib/types/types.go index 1c4b77100e9b..00711b5bfcf7 100644 --- a/tools/rosetta/lib/types/types.go +++ b/tools/rosetta/lib/types/types.go @@ -3,8 +3,8 @@ package types import ( "context" + "github.com/coinbase/rosetta-sdk-go/types" "github.com/cosmos/rosetta-sdk-go/server" - "github.com/cosmos/rosetta-sdk-go/types" ) // SpecVersion defines the specification of rosetta From 6433731656d7b1d83d312bf8cbfaf209ce21d91b Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 13 Dec 2022 01:43:32 +0100 Subject: [PATCH 2/2] update changelog --- tools/rosetta/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rosetta/CHANGELOG.md b/tools/rosetta/CHANGELOG.md index d6cb7d4e40ff..ebad9ecc7369 100644 --- a/tools/rosetta/CHANGELOG.md +++ b/tools/rosetta/CHANGELOG.md @@ -38,7 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements -* [](https://github.com/cosmos/cosmos-sdk/pull/) Use `coinbase/rosetta-sdk-go/types` packages instead of comsos fork. +* [#14272](https://github.com/cosmos/cosmos-sdk/pull/14272) Use `coinbase/rosetta-sdk-go/types` packages instead of comsos fork. ## v0.2.0 2022-12-07