test(x/accounts): add tests for base account and cli (#20826)

This commit is contained in:
son trinh
2024-07-03 09:57:25 +00:00
committed by GitHub
parent 7b23e52b0b
commit 2718b7f6e0
6 changed files with 535 additions and 1 deletions
+8
View File
@@ -27,6 +27,14 @@ func NewMockCometRPC(respQuery abci.QueryResponse) MockCometRPC {
return MockCometRPC{responseQuery: respQuery}
}
// NewMockCometRPCWithValue returns a mock CometBFT RPC implementation with value only.
// It is used for CLI testing.
func NewMockCometRPCWithValue(bz []byte) MockCometRPC {
return MockCometRPC{responseQuery: abci.QueryResponse{
Value: bz,
}}
}
func (MockCometRPC) BroadcastTxSync(context.Context, cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) {
return &coretypes.ResultBroadcastTx{Code: 0}, nil
}