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

fix: generalize archway module as wasm #112

Merged
merged 8 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dist/
.release-env

**/log*.txt
**/debug_archway_msg_data.json
**/debug_wasm_msg_data.json

# Don't commit the vendor directory if anyone runs 'go mod vendor'.
/vendor
8 changes: 4 additions & 4 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"time"

"github.com/cosmos/relayer/v2/relayer"
archway "github.com/cosmos/relayer/v2/relayer/chains/archway"
"github.com/cosmos/relayer/v2/relayer/chains/cosmos"
"github.com/cosmos/relayer/v2/relayer/chains/icon"
"github.com/cosmos/relayer/v2/relayer/chains/penumbra"
wasm "github.com/cosmos/relayer/v2/relayer/chains/wasm"
"github.com/cosmos/relayer/v2/relayer/provider"
"github.com/spf13/cobra"
"go.uber.org/zap"
Expand Down Expand Up @@ -378,7 +378,7 @@
customTypes := map[string]reflect.Type{
"cosmos": reflect.TypeOf(cosmos.CosmosProviderConfig{}),
"icon": reflect.TypeOf(icon.IconProviderConfig{}),
"archway": reflect.TypeOf(archway.ArchwayProviderConfig{}),
"wasm": reflect.TypeOf(wasm.WasmProviderConfig{}),
"penumbra": reflect.TypeOf(penumbra.PenumbraProviderConfig{}),
}
val, err := UnmarshalJSONProviderConfig(data, customTypes)
Expand Down Expand Up @@ -434,8 +434,8 @@
iw.Value = new(cosmos.CosmosProviderConfig)
case "icon":
iw.Value = new(icon.IconProviderConfig)
case "archway":
iw.Value = new(archway.ArchwayProviderConfig)
case "wasm":
iw.Value = new(wasm.WasmProviderConfig)

Check warning on line 438 in cmd/config.go

View check run for this annotation

Codecov / codecov/patch

cmd/config.go#L437-L438

Added lines #L437 - L438 were not covered by tests
case "penumbra":
iw.Value = new(penumbra.PenumbraProviderConfig)
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"type": "archway",
"type": "wasm",
"value": {
"key": "default",
"chain-id": "constantine-2",
"chain-id": "test-1",
"rpc-addr": "https://rpc.constantine-2.archway.tech:443",
"key-directory":"/Users/viveksharmapoudel/.relayer/keys/archway",
"key-directory":"/Users/viveksharmapoudel/.relayer/keys/test-1",
"grpc-addr": "",
"account-prefix": "archway",
"account-prefix": "neutron",
"keyring-backend": "test",
"gas-adjustment": 1.5,
"gas-prices": "0.02uconst",
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ require (
replace (
github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
github.com/CosmWasm/wasmd => github.com/cosmwasm/wasmd v0.40.0-rc.1.0.20230424144037-55647a1fd1f9
// github.com/CosmWasm/wasmd => github.com/archway-network/archway-wasmd v0.29.2-archway
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/icon-project/IBC-Integration => github.com/icon-project/ibc-integration v0.0.0-20230619065023-ddc96101b9b1
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"context"
Expand All @@ -13,19 +13,19 @@
"google.golang.org/grpc/metadata"
)

var _ client.AccountRetriever = &ArchwayProvider{}
var _ client.AccountRetriever = &WasmProvider{}

// GetAccount queries for an account given an address and a block height. An
// error is returned if the query or decoding fails.
func (cc *ArchwayProvider) GetAccount(clientCtx client.Context, addr sdk.AccAddress) (client.Account, error) {
func (cc *WasmProvider) GetAccount(clientCtx client.Context, addr sdk.AccAddress) (client.Account, error) {

Check warning on line 20 in relayer/chains/wasm/accounts.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/accounts.go#L20

Added line #L20 was not covered by tests
account, _, err := cc.GetAccountWithHeight(clientCtx, addr)
return account, err
}

// GetAccountWithHeight queries for an account given an address. Returns the
// height of the query with the account. An error is returned if the query
// or decoding fails.
func (cc *ArchwayProvider) GetAccountWithHeight(clientCtx client.Context, addr sdk.AccAddress) (client.Account, int64, error) {
func (cc *WasmProvider) GetAccountWithHeight(clientCtx client.Context, addr sdk.AccAddress) (client.Account, int64, error) {

Check warning on line 28 in relayer/chains/wasm/accounts.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/accounts.go#L28

Added line #L28 was not covered by tests
var header metadata.MD
address, err := cc.EncodeBech32AccAddr(addr)
if err != nil {
Expand Down Expand Up @@ -57,7 +57,7 @@
}

// EnsureExists returns an error if no account exists for the given address else nil.
func (cc *ArchwayProvider) EnsureExists(clientCtx client.Context, addr sdk.AccAddress) error {
func (cc *WasmProvider) EnsureExists(clientCtx client.Context, addr sdk.AccAddress) error {

Check warning on line 60 in relayer/chains/wasm/accounts.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/accounts.go#L60

Added line #L60 was not covered by tests
if _, err := cc.GetAccount(clientCtx, addr); err != nil {
return err
}
Expand All @@ -66,7 +66,7 @@

// GetAccountNumberSequence returns sequence and account number for the given address.
// It returns an error if the account couldn't be retrieved from the state.
func (cc *ArchwayProvider) GetAccountNumberSequence(clientCtx client.Context, addr sdk.AccAddress) (uint64, uint64, error) {
func (cc *WasmProvider) GetAccountNumberSequence(clientCtx client.Context, addr sdk.AccAddress) (uint64, uint64, error) {

Check warning on line 69 in relayer/chains/wasm/accounts.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/accounts.go#L69

Added line #L69 was not covered by tests
acc, err := cc.GetAccount(clientCtx, addr)
if err != nil {
return 0, 0, err
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"context"
Expand All @@ -20,10 +20,10 @@
"golang.org/x/sync/errgroup"
)

type ArchwayChainProcessor struct {
type WasmChainProcessor struct {
log *zap.Logger

chainProvider *ArchwayProvider
chainProvider *WasmProvider

pathProcessors processor.PathProcessors

Expand Down Expand Up @@ -55,8 +55,8 @@
parsedGasPrices *sdk.DecCoins
}

func NewArchwayChainProcessor(log *zap.Logger, provider *ArchwayProvider, metrics *processor.PrometheusMetrics) *ArchwayChainProcessor {
return &ArchwayChainProcessor{
func NewWasmChainProcessor(log *zap.Logger, provider *WasmProvider, metrics *processor.PrometheusMetrics) *WasmChainProcessor {
return &WasmChainProcessor{

Check warning on line 59 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L58-L59

Added lines #L58 - L59 were not covered by tests
log: log.With(zap.String("chain_name", provider.ChainName()), zap.String("chain_id", provider.ChainId())),
chainProvider: provider,
latestClientState: make(latestClientState),
Expand All @@ -82,7 +82,7 @@
// latestClientState is a map of clientID to the latest clientInfo for that client.
type latestClientState map[string]provider.ClientState

func (l latestClientState) update(ctx context.Context, clientInfo clientInfo, ccp *ArchwayChainProcessor) {
func (l latestClientState) update(ctx context.Context, clientInfo clientInfo, ccp *WasmChainProcessor) {

Check warning on line 85 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L85

Added line #L85 was not covered by tests
existingClientInfo, ok := l[clientInfo.clientID]
var trustingPeriod time.Duration
if ok {
Expand Down Expand Up @@ -112,19 +112,19 @@
}

// Provider returns the ChainProvider, which provides the methods for querying, assembling IBC messages, and sending transactions.
func (ccp *ArchwayChainProcessor) Provider() provider.ChainProvider {
func (ccp *WasmChainProcessor) Provider() provider.ChainProvider {

Check warning on line 115 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L115

Added line #L115 was not covered by tests
return ccp.chainProvider
}

// Set the PathProcessors that this ChainProcessor should publish relevant IBC events to.
// ChainProcessors need reference to their PathProcessors and vice-versa, handled by EventProcessorBuilder.Build().
func (ccp *ArchwayChainProcessor) SetPathProcessors(pathProcessors processor.PathProcessors) {
func (ccp *WasmChainProcessor) SetPathProcessors(pathProcessors processor.PathProcessors) {

Check warning on line 121 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L121

Added line #L121 was not covered by tests
ccp.pathProcessors = pathProcessors
}

// latestHeightWithRetry will query for the latest height, retrying in case of failure.
// It will delay by latestHeightQueryRetryDelay between attempts, up to latestHeightQueryRetries.
func (ccp *ArchwayChainProcessor) latestHeightWithRetry(ctx context.Context) (latestHeight int64, err error) {
func (ccp *WasmChainProcessor) latestHeightWithRetry(ctx context.Context) (latestHeight int64, err error) {

Check warning on line 127 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L127

Added line #L127 was not covered by tests
return latestHeight, retry.Do(func() error {
latestHeightQueryCtx, cancelLatestHeightQueryCtx := context.WithTimeout(ctx, queryTimeout)
defer cancelLatestHeightQueryCtx()
Expand All @@ -143,7 +143,7 @@

// nodeStatusWithRetry will query for the latest node status, retrying in case of failure.
// It will delay by latestHeightQueryRetryDelay between attempts, up to latestHeightQueryRetries.
func (ccp *ArchwayChainProcessor) nodeStatusWithRetry(ctx context.Context) (status *ctypes.ResultStatus, err error) {
func (ccp *WasmChainProcessor) nodeStatusWithRetry(ctx context.Context) (status *ctypes.ResultStatus, err error) {

Check warning on line 146 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L146

Added line #L146 was not covered by tests
return status, retry.Do(func() error {
latestHeightQueryCtx, cancelLatestHeightQueryCtx := context.WithTimeout(ctx, queryTimeout)
defer cancelLatestHeightQueryCtx()
Expand All @@ -162,7 +162,7 @@

// clientState will return the most recent client state if client messages
// have already been observed for the clientID, otherwise it will query for it.
func (ccp *ArchwayChainProcessor) clientState(ctx context.Context, clientID string) (provider.ClientState, error) {
func (ccp *WasmChainProcessor) clientState(ctx context.Context, clientID string) (provider.ClientState, error) {

Check warning on line 165 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L165

Added line #L165 was not covered by tests
if state, ok := ccp.latestClientState[clientID]; ok && state.TrustingPeriod > 0 {
return state, nil
}
Expand Down Expand Up @@ -191,7 +191,7 @@
// Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors.
// The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks.
// ChainProcessors should obey the context and return upon context cancellation.
func (ccp *ArchwayChainProcessor) Run(ctx context.Context, initialBlockHistory uint64) error {
func (ccp *WasmChainProcessor) Run(ctx context.Context, initialBlockHistory uint64) error {

Check warning on line 194 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L194

Added line #L194 was not covered by tests
// this will be used for persistence across query cycle loop executions
persistence := queryCyclePersistence{
minQueryLoopDuration: defaultMinQueryLoopDuration,
Expand Down Expand Up @@ -257,7 +257,7 @@
}

// initializeConnectionState will bootstrap the connectionStateCache with the open connection state.
func (ccp *ArchwayChainProcessor) initializeConnectionState(ctx context.Context) error {
func (ccp *WasmChainProcessor) initializeConnectionState(ctx context.Context) error {

Check warning on line 260 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L260

Added line #L260 was not covered by tests
ctx, cancel := context.WithTimeout(ctx, queryTimeout)
defer cancel()
connections, err := ccp.chainProvider.QueryConnections(ctx)
Expand All @@ -277,7 +277,7 @@
}

// initializeChannelState will bootstrap the channelStateCache with the open channel state.
func (ccp *ArchwayChainProcessor) initializeChannelState(ctx context.Context) error {
func (ccp *WasmChainProcessor) initializeChannelState(ctx context.Context) error {

Check warning on line 280 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L280

Added line #L280 was not covered by tests
ctx, cancel := context.WithTimeout(ctx, queryTimeout)
defer cancel()
channels, err := ccp.chainProvider.QueryChannels(ctx)
Expand All @@ -304,10 +304,10 @@
return nil
}

func (ccp *ArchwayChainProcessor) queryCycle(ctx context.Context, persistence *queryCyclePersistence) error {
func (ccp *WasmChainProcessor) queryCycle(ctx context.Context, persistence *queryCyclePersistence) error {

Check warning on line 307 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L307

Added line #L307 was not covered by tests
status, err := ccp.nodeStatusWithRetry(ctx)
if err != nil {
// don't want to cause ArchwayChainProcessor to quit here, can retry again next cycle.
// don't want to cause WasmChainProcessor to quit here, can retry again next cycle.

Check warning on line 310 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L310

Added line #L310 was not covered by tests
ccp.log.Error(
"Failed to query node status after max attempts",
zap.Uint("attempts", latestHeightQueryRetries),
Expand Down Expand Up @@ -349,7 +349,7 @@

ppChanged := false

var latestHeader ArchwayIBCHeader
var latestHeader WasmIBCHeader

Check warning on line 352 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L352

Added line #L352 was not covered by tests

newLatestQueriedBlock := persistence.latestQueriedBlock

Expand Down Expand Up @@ -379,7 +379,7 @@
break
}

latestHeader = ibcHeader.(ArchwayIBCHeader)
latestHeader = ibcHeader.(WasmIBCHeader)

Check warning on line 382 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L382

Added line #L382 was not covered by tests

heightUint64 := uint64(i)

Expand Down Expand Up @@ -451,7 +451,7 @@
return nil
}

func (ccp *ArchwayChainProcessor) CollectMetrics(ctx context.Context, persistence *queryCyclePersistence) {
func (ccp *WasmChainProcessor) CollectMetrics(ctx context.Context, persistence *queryCyclePersistence) {

Check warning on line 454 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L454

Added line #L454 was not covered by tests
ccp.CurrentBlockHeight(ctx, persistence)

// Wait a while before updating the balance
Expand All @@ -461,11 +461,11 @@
}
}

func (ccp *ArchwayChainProcessor) CurrentBlockHeight(ctx context.Context, persistence *queryCyclePersistence) {
func (ccp *WasmChainProcessor) CurrentBlockHeight(ctx context.Context, persistence *queryCyclePersistence) {

Check warning on line 464 in relayer/chains/wasm/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/archway_chain_processor.go#L464

Added line #L464 was not covered by tests
ccp.metrics.SetLatestHeight(ccp.chainProvider.ChainId(), persistence.latestHeight)
}

// func (ccp *ArchwayChainProcessor) CurrentRelayerBalance(ctx context.Context) {
// func (ccp *WasmChainProcessor) CurrentRelayerBalance(ctx context.Context) {
// // memoize the current gas prices to only show metrics for "interesting" denoms
// if ccp.parsedGasPrices == nil {
// gp, err := sdk.ParseDecCoins(ccp.chainProvider.PCfg.GasPrices)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"sync"
Expand All @@ -13,10 +13,10 @@ import (
var sdkConfigMutex sync.Mutex

// Based on cosmos bech32_hack.go
// SetSDKContext sets the SDK config to the proper bech32 prefixes for archway.
// SetSDKContext sets the SDK config to the proper bech32 prefixes for wasm.
// Don't use this unless you know what you're doing.
// TODO: :dagger: :knife: :chainsaw: remove this function
func (ap *ArchwayProvider) SetSDKContext() {
func (ap *WasmProvider) SetSDKContext() {
sdkConfigMutex.Lock()
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(ap.PCfg.AccountPrefix, app.Bech32PrefixAccPub)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"github.com/CosmWasm/wasmd/x/wasm"
Expand All @@ -10,14 +10,14 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
archway_module "github.com/cosmos/relayer/v2/relayer/chains/archway/module"
icon_module "github.com/cosmos/relayer/v2/relayer/chains/icon/module"
wasm_module "github.com/cosmos/relayer/v2/relayer/chains/wasm/module"
)

var ModuleBasics = []module.AppModuleBasic{
auth.AppModuleBasic{},
ibc.AppModuleBasic{},
archway_module.AppModuleBasic{},
wasm_module.AppModuleBasic{},
wasm.AppModuleBasic{},
icon_module.AppModuleBasic{},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

const (
// External methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"encoding/base64"
Expand Down Expand Up @@ -36,7 +36,7 @@ type ibcMessageInfo interface {
MarshalLogObject(enc zapcore.ObjectEncoder) error
}

// func (ccp *ArchwayChainProcessor) ibcMessagesFromBlockEvents(
// func (ccp *WasmChainProcessor) ibcMessagesFromBlockEvents(
// beginBlockEvents, endBlockEvents []abci.Event,
// height uint64, base64Encoded bool,
// ) (res []ibcMessage) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package archway
package wasm

import (
"context"
Expand All @@ -25,12 +25,12 @@
"github.com/cosmos/cosmos-sdk/types/tx"
)

var _ gogogrpc.ClientConn = &ArchwayProvider{}
var _ gogogrpc.ClientConn = &WasmProvider{}

var protoCodec = encoding.GetCodec(proto.Name)

// Invoke implements the grpc ClientConn.Invoke method
func (ap *ArchwayProvider) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) {
func (ap *WasmProvider) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) {

Check warning on line 33 in relayer/chains/wasm/grpc_query.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/grpc_query.go#L33

Added line #L33 was not covered by tests
// Two things can happen here:
// 1. either we're broadcasting a Tx, in which call we call Tendermint's broadcast endpoint directly,
// 2. or we are querying for state, in which case we call ABCI's Querier.
Expand Down Expand Up @@ -86,15 +86,15 @@
}

// NewStream implements the grpc ClientConn.NewStream method
func (ap *ArchwayProvider) NewStream(context.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) {
func (ap *WasmProvider) NewStream(context.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) {

Check warning on line 89 in relayer/chains/wasm/grpc_query.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/grpc_query.go#L89

Added line #L89 was not covered by tests
return nil, fmt.Errorf("streaming rpc not supported")
}

// RunGRPCQuery runs a gRPC query from the clientCtx, given all necessary
// arguments for the gRPC method, and returns the ABCI response. It is used
// to factorize code between client (Invoke) and server (RegisterGRPCServer)
// gRPC handlers.
func (ap *ArchwayProvider) RunGRPCQuery(ctx context.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error) {
func (ap *WasmProvider) RunGRPCQuery(ctx context.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error) {

Check warning on line 97 in relayer/chains/wasm/grpc_query.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/grpc_query.go#L97

Added line #L97 was not covered by tests
reqBz, err := protoCodec.Marshal(req)
if err != nil {
return abci.ResponseQuery{}, nil, err
Expand Down Expand Up @@ -147,7 +147,7 @@

// TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types
// from the tx service. Calls `clientCtx.BroadcastTx` under the hood.
func (ap *ArchwayProvider) TxServiceBroadcast(ctx context.Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) {
func (ap *WasmProvider) TxServiceBroadcast(ctx context.Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) {

Check warning on line 150 in relayer/chains/wasm/grpc_query.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/grpc_query.go#L150

Added line #L150 was not covered by tests
if req == nil || req.TxBytes == nil {
return nil, status.Error(codes.InvalidArgument, "invalid empty tx")
}
Expand All @@ -163,7 +163,7 @@
if ap.PCfg.BlockTimeout != "" {
blockTimeout, err = time.ParseDuration(ap.PCfg.BlockTimeout)
if err != nil {
// Did you call Validate() method on ArchwayProviderConfig struct
// Did you call Validate() method on WasmProviderConfig struct

Check warning on line 166 in relayer/chains/wasm/grpc_query.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/wasm/grpc_query.go#L166

Added line #L166 was not covered by tests
// before coming here?
return nil, err
}
Expand Down
Loading
Loading