-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x/auth: in-process test refactor (#6573)
* remove unused functions * create helper func to send tx * refactor to use test help to send tx by client * Commit before getting backend. * Temporal commit * temp commit * remove the creation of txbuilder from cli * fix imports * update changelog * Remove unused function. * Add flag home into tx sign command. * migrade TestCLIValidateSignatures to use new test suite * migrate test one * Add changes to make sign batch. * make test pass * refactor common logic * First part of cli sign. * Add test for sign batch. * refactor a little and improve the test * migrate broadcast command * fix linter * Remove printf for debug in bank module. * Fix unused err var. * fix linter * fix test * fix tests client * Fix linter. * Temp commit signature. * encode tx * migrate tests * Fix imports. * Remove changelog * fix tests * Fix tests. * Update x/bank/client/testutil/cli_helpers.go * Remove alias. * Remove wait for N block func. * export callCmd function into its own file. * fix imports * bring back to inner functions * apply mock io * the helpers use mockio * fix bug * Add Helpers. * return to put the function in testutil package * return BufferWriter in ExecTestCLICmd Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
- Loading branch information
1 parent
5656e86
commit 351192a
Showing
20 changed files
with
769 additions
and
546 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cli | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/testutil" | ||
) | ||
|
||
// ExecTestCLICmd builds the client context, mocks the output and executes the command. | ||
func ExecTestCLICmd(clientCtx client.Context, cmd *cobra.Command, extraArgs []string) (testutil.BufferWriter, error) { | ||
cmd.SetArgs(extraArgs) | ||
|
||
_, out := testutil.ApplyMockIO(cmd) | ||
clientCtx = clientCtx.WithOutput(out) | ||
|
||
ctx := context.Background() | ||
ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) | ||
|
||
if err := cmd.ExecuteContext(ctx); err != nil { | ||
return out, err | ||
} | ||
|
||
return out, nil | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.