[bank]: add balance tracking events (#8656)
* change(bank): add utxo events and simplify logic * add(bank): balance and supply tracking test * chore(bank): fix balance tracking test comment * fix(grpc): service test * fix(bank): sub unlocked coins to use less gas * fix(auth): cli test gas * fix(rest): grpc gas test * fix(staking/cli): increase delegation required gas * add: burn events, fix tests * fix(auth/tx): grpc test * add(bank): coin events in delegate * fix(bank): add amt check in delegate coins back * change(bank): add coin spent and coin recv events in burn and mint * change(bank): revert sub coin function * change(auth): revert cli test * change(auth): revert service test * chore(auth): fix events comment in service_test.go * chore: update CHANGELOG.md * remove(bank): balanceError func * chore(bank): address lint warnings * chore(bank): update events spec Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot]
parent
19e79e00d6
commit
ef9968debd
@@ -58,11 +58,17 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
val2 := s.network.Validators[1]
|
||||
|
||||
// redelegate
|
||||
_, err = stakingtestutil.MsgRedelegateExec(val.ClientCtx, val.Address, val.ValAddress, val2.ValAddress, unbond)
|
||||
_, err = stakingtestutil.MsgRedelegateExec(
|
||||
val.ClientCtx,
|
||||
val.Address,
|
||||
val.ValAddress,
|
||||
val2.ValAddress,
|
||||
unbond,
|
||||
fmt.Sprintf("--%s=%d", flags.FlagGas, 202954), // 202954 is the required
|
||||
)
|
||||
s.Require().NoError(err)
|
||||
_, err = s.network.WaitForHeight(1)
|
||||
s.Require().NoError(err)
|
||||
|
||||
// unbonding
|
||||
_, err = stakingtestutil.MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbond)
|
||||
s.Require().NoError(err)
|
||||
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
@@ -46,7 +48,15 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
val2 := s.network.Validators[1]
|
||||
|
||||
// redelegate
|
||||
_, err = stakingtestutil.MsgRedelegateExec(val.ClientCtx, val.Address, val.ValAddress, val2.ValAddress, unbond)
|
||||
_, err = stakingtestutil.MsgRedelegateExec(
|
||||
val.ClientCtx,
|
||||
val.Address,
|
||||
val.ValAddress,
|
||||
val2.ValAddress,
|
||||
unbond,
|
||||
fmt.Sprintf("--%s=%d", flags.FlagGas, 254000),
|
||||
) // expected gas is 202987
|
||||
|
||||
s.Require().NoError(err)
|
||||
_, err = s.network.WaitForHeight(1)
|
||||
s.Require().NoError(err)
|
||||
@@ -330,7 +340,7 @@ func (s *IntegrationTestSuite) TestQueryDelegationGRPC() {
|
||||
s.Run(tc.name, func() {
|
||||
resp, err := rest.GetRequest(tc.url)
|
||||
s.Require().NoError(err)
|
||||
|
||||
s.T().Logf("%s", resp)
|
||||
err = val.ClientCtx.JSONMarshaler.UnmarshalJSON(resp, tc.respType)
|
||||
|
||||
if tc.error {
|
||||
|
||||
@@ -27,6 +27,7 @@ func MsgRedelegateExec(clientCtx client.Context, from, src, dst, amount fmt.Stri
|
||||
amount.String(),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, from.String()),
|
||||
}
|
||||
args = append(args, extraArgs...)
|
||||
|
||||
args = append(args, commonArgs...)
|
||||
return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewRedelegateCmd(), args)
|
||||
@@ -43,5 +44,6 @@ func MsgUnbondExec(clientCtx client.Context, from fmt.Stringer, valAddress,
|
||||
}
|
||||
|
||||
args = append(args, commonArgs...)
|
||||
args = append(args, extraArgs...)
|
||||
return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewUnbondCmd(), args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user