Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update rosetta to use coinbase/rosetta-sdk-go/types #14272

Merged
merged 4 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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