Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Jul 15, 2024
1 parent 073f977 commit 94308e2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
7 changes: 6 additions & 1 deletion x/crosschain/keeper/msg_server_vote_gas_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/pkg/errors"

"github.com/zeta-chain/zetacore/pkg/chains"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
Expand Down Expand Up @@ -77,7 +78,11 @@ func (k msgServer) VoteGasPrice(
return k.voteGasPrice(ctx, chain, gasPrice)
}

func (k msgServer) voteGasPrice(ctx sdk.Context, chain chains.Chain, entity types.GasPrice) (*types.MsgVoteGasPriceResponse, error) {
func (k msgServer) voteGasPrice(
ctx sdk.Context,
chain chains.Chain,
entity types.GasPrice,
) (*types.MsgVoteGasPriceResponse, error) {
var (
chainID = big.NewInt(chain.ChainId)
gasPrice = math.NewUint(entity.Prices[entity.MedianIndex]).BigInt()
Expand Down
5 changes: 4 additions & 1 deletion zetaclient/chains/evm/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ func (ob *Observer) PostGasPrice(ctx context.Context) error {
return err
}

zetaHash, err := ob.ZetacoreClient().PostVoteGasPrice(ctx, ob.Chain(), gasPrice.Uint64(), priorityFee.Uint64(), blockNum)
zetaHash, err := ob.
ZetacoreClient().
PostVoteGasPrice(ctx, ob.Chain(), gasPrice.Uint64(), priorityFee.Uint64(), blockNum)

if err != nil {
ob.Logger().GasPrice.Err(err).Msg("PostGasPrice to zetacore failed")
return err
Expand Down
18 changes: 9 additions & 9 deletions zetaclient/testutils/mocks/zetacore_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions zetaclient/zetacore/client_vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ func (c *Client) PostVoteBlockHeader(
func (c *Client) PostVoteGasPrice(
ctx context.Context,
chain chains.Chain,
gasPrice uint64,
supply string,
blockNum uint64,
gasPrice uint64, priorityFee, blockNum uint64,
) (string, error) {
// apply gas price multiplier for the chain
multiplier, err := GasPriceMultiplier(chain)
Expand All @@ -59,7 +57,7 @@ func (c *Client) PostVoteGasPrice(
// #nosec G115 always in range
gasPrice = uint64(float64(gasPrice) * multiplier)
signerAddress := c.keys.GetOperatorAddress().String()
msg := types.NewMsgVoteGasPrice(signerAddress, chain.ChainId, gasPrice, supply, blockNum)
msg := types.NewMsgVoteGasPrice(signerAddress, chain.ChainId, gasPrice, priorityFee, blockNum)

authzMsg, authzSigner, err := WrapMessageWithAuthz(msg)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions zetaclient/zetacore/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"encoding/hex"
"math/big"
"net"
"os"
"testing"
Expand Down Expand Up @@ -148,7 +147,7 @@ func TestZetacore_PostGasPrice(t *testing.T) {
)

t.Run("post gas price success", func(t *testing.T) {
hash, err := client.PostVoteGasPrice(ctx, chains.BscMainnet, 1000000,0, 1234)
hash, err := client.PostVoteGasPrice(ctx, chains.BscMainnet, 1000000, 0, 1234)
require.NoError(t, err)
require.Equal(t, sampleHash, hash)
})
Expand Down

0 comments on commit 94308e2

Please sign in to comment.