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

chore: Project cleanup #66

Closed
wants to merge 3 commits into from
Closed
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
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,29 @@ Types of changes (Stanzas):
"Improvements" for changes in existing functionality.
"Deprecated" for soon-to-be removed features.
"Bug Fixes" for any bug fixes.
"Client Breaking" for breaking Protobuf, gRPC and REST routes used by end-users.
"CLI Breaking" for breaking CLI commands.
"API Breaking" for breaking exported APIs used by developers building on SDK.
Ref: https://keepachangelog.com/en/1.0.0/
-->

# Changelog

## [Unreleased]

## v0.50.2

### Features

* [#37](https://github.com/cosmos/rosetta/pull/37) Added rosetta Dockerfile image.
* [#41](https://github.com/cosmos/rosetta/pull/41) Added rosetta-CLI integration tests

### Improvements

* [#27](https://github.com/cosmos/rosetta/pull/27) Multi zone and overall project enhancements.
* [#29](https://github.com/cosmos/rosetta/pull/29) Error handling improvements.
* [#44](https://github.com/cosmos/rosetta/pull/44) Added mock data and improved amount of processed blocks on Rosetta cli tests.
* [#58](https://github.com/cosmos/rosetta/pull/58) Upgraded cosmos-sdk version and removed tip handling.

## v0.47.x

## v0.47.x

* Migrated rosetta from cosmos-sdk repository to the standalone [repo](https://github.com/cosmos/rosetta).
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Rosetta
<div align="center">
<h1> Cosmos - Rosetta </h1>
</div>

![banner](static/banner.jpg)

The `rosetta` project implements Coinbase's [Rosetta API](https://www.rosetta-api.org). This document provides instructions on how to use the Rosetta API integration. For information about the motivation and design choices, refer to [ADR 035](https://docs.cosmos.network/main/architecture/adr-035-rosetta-api-support).

Expand Down
5 changes: 0 additions & 5 deletions converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,8 @@ func (s *ConverterTestSuite) TestOpsAndSigners() {
_, err := s.txConf.TxEncoder()(sdkTx)
s.Require().NoError(err)

// s.Require().NoError(err)

_, err = sdkTx.GetSigners()
s.Require().NoError(err)
// s.Require().Equal(len(ops), len(sdkTx.GetMsgs())*len(signerAddrs), "operation number mismatch")
//
// s.Require().Equal(len(signers), len(signerAddrs), "signers number mismatch")
})
}

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/cometbft/cometbft v0.38.2
github.com/cosmos/cosmos-sdk v0.50.2
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/v8 v8.0.0
github.com/cosmos/rosetta-sdk-go v0.10.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/spf13/cobra v1.8.0
Expand All @@ -26,6 +27,7 @@ require (
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/store v1.0.1 // indirect
cosmossdk.io/x/upgrade v0.1.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
Expand All @@ -49,6 +51,7 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v1.0.0 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
Expand Down
69 changes: 68 additions & 1 deletion go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions plugins/cosmos-hub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"

// ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
// ibcLightClient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcLightClient "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

sdk "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
Expand All @@ -20,8 +20,8 @@ func InitZone() {
}

func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
// ibcclienttypes.RegisterInterfaces(registry)
// ibcLightClient.RegisterInterfaces(registry)
ibcclienttypes.RegisterInterfaces(registry)
ibcLightClient.RegisterInterfaces(registry)
sdk.RegisterInterfaces(registry)
txtypes.RegisterInterfaces(registry)
cryptocodec.RegisterInterfaces(registry)
Expand Down
110 changes: 55 additions & 55 deletions plugins_test.go
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
package rosetta_test

//
// import (
// "testing"
//
// "github.com/cosmos/rosetta"
//
// "github.com/cosmos/cosmos-sdk/codec"
// "github.com/stretchr/testify/suite"
//
// codectypes "github.com/cosmos/cosmos-sdk/codec/types"
//)
//
// type PluginTestSuite struct {
// suite.Suite
//
// ir codectypes.InterfaceRegistry
// cdc *codec.ProtoCodec
//
// requiredInterfaces []string
//}
//
// func (s *PluginTestSuite) SetupTest() {
// s.ir = codectypes.NewInterfaceRegistry()
// s.cdc = codec.NewProtoCodec(s.ir)
// s.requiredInterfaces = []string{
// "cosmos.base.v1beta1.Msg",
// "cosmos.tx.v1beta1.Tx",
// "cosmos.crypto.PubKey",
// "cosmos.crypto.PrivKey",
// "ibc.core.client.v1.ClientState",
// "ibc.core.client.v1.Height",
// "cosmos.tx.v1beta1.MsgResponse",
// "ibc.core.client.v1.Header",
// }
//}
//
// func (s *PluginTestSuite) TestLoadPlugin() {
// s.Run("Load cosmos-hub plugin", func() {
// rosetta.LoadPlugin(s.ir, "cosmos-hub")
// interfaceList := s.ir.ListAllInterfaces()
//
// interfaceListMap := make(map[string]bool)
// for _, interfaceTypeURL := range interfaceList {
// interfaceListMap[interfaceTypeURL] = true
// }
//
// for _, requiredInterfaceTypeURL := range s.requiredInterfaces {
// s.Require().True(interfaceListMap[requiredInterfaceTypeURL])
// }
// })
//}
//
// func TestPluginTestSuite(t *testing.T) {
// suite.Run(t, new(PluginTestSuite))
//}
import (
"testing"

"github.com/cosmos/rosetta"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/stretchr/testify/suite"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
)

type PluginTestSuite struct {
suite.Suite

ir codectypes.InterfaceRegistry
cdc *codec.ProtoCodec

requiredInterfaces []string
}

func (s *PluginTestSuite) SetupTest() {
s.ir = codectypes.NewInterfaceRegistry()
s.cdc = codec.NewProtoCodec(s.ir)
s.requiredInterfaces = []string{
"cosmos.base.v1beta1.Msg",
"cosmos.tx.v1beta1.Tx",
"cosmos.crypto.PubKey",
"cosmos.crypto.PrivKey",
"ibc.core.client.v1.ClientState",
"ibc.core.client.v1.Height",
"cosmos.tx.v1beta1.MsgResponse",
"ibc.core.client.v1.Header",
}
}

func (s *PluginTestSuite) TestLoadPlugin() {
s.Run("Load cosmos-hub plugin", func() {
err := rosetta.LoadPlugin(s.ir, "cosmos-hub")
s.Require().NoError(err)
interfaceList := s.ir.ListAllInterfaces()

interfaceListMap := make(map[string]bool)
for _, interfaceTypeURL := range interfaceList {
interfaceListMap[interfaceTypeURL] = true
}

for _, requiredInterfaceTypeURL := range s.requiredInterfaces {
s.Require().True(interfaceListMap[requiredInterfaceTypeURL])
}
})
}

func TestPluginTestSuite(t *testing.T) {
suite.Run(t, new(PluginTestSuite))
}
Binary file added static/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading