Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add polkadot/hyperspace support and update TestHyperspace for ibc-go wasm light client changes #747

Merged
merged 12 commits into from
Sep 14, 2023
10 changes: 5 additions & 5 deletions chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"encoding/json"
"fmt"
"io"
"math"
"os"
"strconv"
"strings"
"sync"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -535,20 +535,20 @@ func (c *CosmosChain) ExportState(ctx context.Context, height int64) (string, er

// GetBalance fetches the current balance for a specific account address and denom.
// Implements Chain interface
func (c *CosmosChain) GetBalance(ctx context.Context, address string, denom string) (math.Int, error) {
func (c *CosmosChain) GetBalance(ctx context.Context, address string, denom string) (sdkmath.Int, error) {
params := &bankTypes.QueryBalanceRequest{Address: address, Denom: denom}
grpcAddress := c.getFullNode().hostGRPCPort
conn, err := grpc.Dial(grpcAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return math.Int{}, err
return sdkmath.Int{}, err
}
defer conn.Close()

queryClient := bankTypes.NewQueryClient(conn)
res, err := queryClient.Balance(ctx, params)

if err != nil {
return math.Int{}, err
return sdkmath.Int{}, err
}

return res.Balance.Amount, nil
Expand Down Expand Up @@ -582,7 +582,7 @@ func (c *CosmosChain) getTransaction(txhash string) (*types.TxResponse, error) {
func (c *CosmosChain) GetGasFeesInNativeDenom(gasPaid int64) int64 {
gasPrice, _ := strconv.ParseFloat(strings.Replace(c.cfg.GasPrices, c.cfg.Denom, "", 1), 64)
fees := float64(gasPaid) * gasPrice
return int64(fees)
return int64(math.Ceil(fees))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! 🔥

}

func (c *CosmosChain) UpgradeVersion(ctx context.Context, cli *client.Client, containerRepo, version string) {
Expand Down