diff --git a/server/rosetta/client_offline.go b/server/rosetta/client_offline.go index 494a27d31493..575539940d85 100644 --- a/server/rosetta/client_offline.go +++ b/server/rosetta/client_offline.go @@ -31,8 +31,7 @@ func (c *Client) OperationStatuses() []*types.OperationStatus { } func (c *Client) Version() string { - const version = "cosmos-sdk:v0.40.0-rc5/tendermint:0.34.0" - return version + return c.version } func (c *Client) SupportedOperations() []string { diff --git a/server/rosetta/client_online.go b/server/rosetta/client_online.go index 30c0ad60a446..5c0c9b7712b1 100644 --- a/server/rosetta/client_online.go +++ b/server/rosetta/client_online.go @@ -7,6 +7,8 @@ import ( "strconv" "time" + "github.com/cosmos/cosmos-sdk/version" + abcitypes "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/btcd/btcec" @@ -50,6 +52,8 @@ type Client struct { ir codectypes.InterfaceRegistry clientCtx client.Context + + version string } func (c *Client) AccountIdentifierFromPublicKey(pubKey *types.PublicKey) (*types.AccountIdentifier, error) { @@ -74,9 +78,11 @@ func (c *Client) AccountIdentifierFromPublicKey(pubKey *types.PublicKey) (*types // NewClient instantiates a new online servicer func NewClient(cfg *Config) (*Client, error) { + info := version.NewInfo() return &Client{ - config: cfg, - ir: cfg.InterfaceRegistry, + config: cfg, + ir: cfg.InterfaceRegistry, + version: info.Version, }, nil } diff --git a/server/rosetta/main_test.go b/server/rosetta/main_test.go deleted file mode 100644 index 2def17e23fdb..000000000000 --- a/server/rosetta/main_test.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build rosetta_integration_tests - -package rosetta - -import ( - "fmt" - "os" - "testing" -) - -// integrationClient is the client spawned in an integration environment -// which can connect to the integration cosmos gRPC and tendermint RPC -var integrationClient *Client - -func TestMain(m *testing.M) { - err := makeTestPreconditions() - if err != nil { - fmt.Println("precondition failed:", err.Error()) - os.Exit(1) - } - os.Exit(m.Run()) -} - -func makeTestPreconditions() error { - var err error - integrationClient, err = NewClient("localhost:9090", "tcp://localhost:26657") - if err != nil { - return fmt.Errorf("client init failure: %w", err) - } - return nil -}