forked from cerc-io/laconicd
Prathamesh Musale
aed2d6d4c6
- Rename RPC method to reserve authority from `ReserveName` to `ReserveAuthority` and `GetBondsModuleBalance` to `GetBondModuleBalance` - Run lint formatter - Fix proto lint errors and regenerate proto bindings Reviewed-on: deep-stack/laconic2d#17 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
package bond
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
|
|
|
|
bondtypes "git.vdb.to/cerc-io/laconic2d/x/bond"
|
|
"git.vdb.to/cerc-io/laconic2d/x/bond/client/cli"
|
|
)
|
|
|
|
func (ets *E2ETestSuite) TestGetQueryBondList() {
|
|
val := ets.network.Validators[0]
|
|
sr := ets.Require()
|
|
|
|
testCases := []struct {
|
|
name string
|
|
args []string
|
|
createBond bool
|
|
preRun func()
|
|
}{
|
|
{
|
|
"create and get bond lists",
|
|
[]string{fmt.Sprintf("--%s=json", flags.FlagOutput)},
|
|
true,
|
|
func() {
|
|
ets.createBond()
|
|
},
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
ets.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
|
clientCtx := val.ClientCtx
|
|
if tc.createBond {
|
|
tc.preRun()
|
|
}
|
|
|
|
cmd := cli.GetQueryBondList()
|
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
|
sr.NoError(err)
|
|
var queryResponse bondtypes.QueryBondsResponse
|
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
|
sr.NoError(err)
|
|
sr.NotZero(len(queryResponse.GetBonds()))
|
|
})
|
|
}
|
|
}
|