-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'merge/e2e_test/relay_x_relayer_cli' into e2e_test/relay…
…-update * merge/e2e_test/relay_x_relayer_cli: fix: supplier client test chore: add long command description chore: review feedback improvements chore: review feedback improvements fix: sessiontree store path check fix: sessiontree store path check refactor: separate tx and query client contexts 🙄 refactor: relayminer depinject helpers & godoc comments on all constructors chore: review feedback improvements chore: update anvil service port in make targets
- Loading branch information
Showing
12 changed files
with
254 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import ( | |
authclient "github.com/cosmos/cosmos-sdk/x/auth/client" | ||
|
||
"github.com/pokt-network/poktroll/pkg/client" | ||
"github.com/pokt-network/poktroll/pkg/relayer" | ||
) | ||
|
||
var _ client.TxContext = (*cosmosTxContext)(nil) | ||
|
@@ -21,7 +22,7 @@ var _ client.TxContext = (*cosmosTxContext)(nil) | |
type cosmosTxContext struct { | ||
// Holds cosmos-sdk client context. | ||
// (see: https://pkg.go.dev/github.com/cosmos/[email protected]/client#Context) | ||
clientCtx cosmosclient.Context | ||
clientCtx relayer.TxClientContext | ||
// Holds the cosmos-sdk transaction factory. | ||
// (see: https://pkg.go.dev/github.com/cosmos/[email protected]/client/tx#Factory) | ||
txFactory cosmostx.Factory | ||
|
@@ -30,6 +31,10 @@ type cosmosTxContext struct { | |
// NewTxContext initializes a new cosmosTxContext with the given dependencies. | ||
// It uses depinject to populate its members and returns a client.TxContext | ||
// interface type. | ||
// | ||
// Required dependencies: | ||
// - cosmosclient.Context | ||
// - cosmostx.Factory | ||
func NewTxContext(deps depinject.Config) (client.TxContext, error) { | ||
txCtx := cosmosTxContext{} | ||
|
||
|
@@ -41,8 +46,6 @@ func NewTxContext(deps depinject.Config) (client.TxContext, error) { | |
return nil, err | ||
} | ||
|
||
txCtx.clientCtx = cosmosclient.Context(txCtx.clientCtx) | ||
|
||
return txCtx, nil | ||
} | ||
|
||
|
@@ -62,7 +65,7 @@ func (txCtx cosmosTxContext) SignTx( | |
) error { | ||
return authclient.SignTx( | ||
txCtx.txFactory, | ||
txCtx.clientCtx, | ||
cosmosclient.Context(txCtx.clientCtx), | ||
signingKeyName, | ||
txBuilder, | ||
offline, overwriteSig, | ||
|
@@ -82,8 +85,8 @@ func (txCtx cosmosTxContext) EncodeTx(txBuilder cosmosclient.TxBuilder) ([]byte, | |
// BroadcastTx broadcasts the given transaction to the network, blocking until the check-tx | ||
// ABCI operation completes and returns a TxResponse of the transaction status at that point in time. | ||
func (txCtx cosmosTxContext) BroadcastTx(txBytes []byte) (*cosmostypes.TxResponse, error) { | ||
return txCtx.clientCtx.BroadcastTxAsync(txBytes) | ||
//return txCtx.clientCtx.BroadcastTxSync(txBytes) | ||
clientCtx := cosmosclient.Context(txCtx.clientCtx) | ||
return clientCtx.BroadcastTxAsync(txBytes) | ||
} | ||
|
||
// QueryTx queries the transaction based on its hash and optionally provides proof | ||
|
Oops, something went wrong.