2023-12-13 17:17:37 +00:00
|
|
|
package e2e_test
|
|
|
|
|
|
|
|
import (
|
2024-08-12 03:44:39 +00:00
|
|
|
"github.com/0glabs/0g-chain/chaincfg"
|
2023-12-13 17:17:37 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (suite *IntegrationTestSuite) TestGrpcClientUtil_Account() {
|
|
|
|
// ARRANGE
|
2024-08-12 03:44:39 +00:00
|
|
|
// setup 0g account
|
|
|
|
zgAcc := suite.ZgChain.NewFundedAccount("account-test", sdk.NewCoins(chaincfg.MakeCoinForGasDenom(1e5)))
|
2023-12-13 17:17:37 +00:00
|
|
|
|
|
|
|
// ACT
|
2024-08-12 03:44:39 +00:00
|
|
|
rsp, err := suite.ZgChain.Grpc.BaseAccount(zgAcc.SdkAddress.String())
|
2023-12-13 17:17:37 +00:00
|
|
|
|
|
|
|
// ASSERT
|
|
|
|
suite.Require().NoError(err)
|
2024-08-12 03:44:39 +00:00
|
|
|
suite.Equal(zgAcc.SdkAddress.String(), rsp.Address)
|
2023-12-13 17:17:37 +00:00
|
|
|
suite.Greater(rsp.AccountNumber, uint64(1))
|
|
|
|
suite.Equal(uint64(0), rsp.Sequence)
|
|
|
|
}
|