Skip to content

Commit

Permalink
refactor: update rosetta to use coinbase/rosetta-sdk-go/types (#14272)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 13, 2022
1 parent c6c7eb9 commit 5c02a4c
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 28 deletions.
4 changes: 4 additions & 0 deletions tools/rosetta/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Improvements

* [#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

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/client_offline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/client_online.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 6 additions & 9 deletions tools/rosetta/converter_test.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
3 changes: 2 additions & 1 deletion tools/rosetta/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tools/rosetta/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/errors/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"sync"

"github.com/cosmos/rosetta-sdk-go/types"
"github.com/coinbase/rosetta-sdk-go/types"
)

type errorRegistry struct {
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/construction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/offline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/internal/service/online.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/rosetta/lib/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c02a4c

Please sign in to comment.