laconicd/tests/e2e/bond/query.go
Prathamesh Musale aed2d6d4c6 Rename RPC method to reserve authority and fix proto lint errors (#17)
- 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>
2024-03-07 11:25:15 +00:00

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()))
})
}
}