From 0edec90d9e06d534d3e48d890dbaa09bdfebad8e Mon Sep 17 00:00:00 2001 From: Akshar Dave Date: Wed, 1 Nov 2023 15:33:31 -0400 Subject: [PATCH] votingStation txn withOpts --- Makefile | 13 +++++++++++++ command/ibft/propose/params.go | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Makefile b/Makefile index 90899293b2..df625d4e26 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,19 @@ build: -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime=$(TIME)'" \ main.go +.PHONY: build-amd +build-amd: + $(eval LATEST_VERSION = $(shell git describe --tags --abbrev=0)) + $(eval COMMIT_HASH = $(shell git rev-parse HEAD)) + $(eval BRANCH = $(shell git rev-parse --abbrev-ref HEAD | tr -d '\040\011\012\015\n')) + $(eval TIME = $(shell date)) + GOOS=linux GOARCH=amd64 go build -o main -ldflags="\ + -X 'github.com/0xPolygon/polygon-edge/versioning.Version=$(LATEST_VERSION)' \ + -X 'github.com/0xPolygon/polygon-edge/versioning.Commit=$(COMMIT_HASH)'\ + -X 'github.com/0xPolygon/polygon-edge/versioning.Branch=$(BRANCH)'\ + -X 'github.com/0xPolygon/polygon-edge/versioning.BuildTime=$(TIME)'" \ + main.go + .PHONY: lint lint: golangci-lint run --config .golangci.yml diff --git a/command/ibft/propose/params.go b/command/ibft/propose/params.go index 2660abcc05..729954b258 100644 --- a/command/ibft/propose/params.go +++ b/command/ibft/propose/params.go @@ -46,6 +46,11 @@ const ( voteRemoveSCFunction = "function voteDrop(address oldValidator)" ) +const ( + txGasPriceWei = 1000000000 + txGasLimitWei = 1000000 +) + type proposeParams struct { addressRaw string rawBLSPublicKey string @@ -207,6 +212,13 @@ func (p *proposeParams) ibftSetVotingStationValidators(grpcAddress string, jsonr functionArgs..., ) + txn.WithOpts( + &contract.TxnOpts{ + GasPrice: txGasPriceWei + (4 * txGasPriceWei), + GasLimit: txGasLimitWei, + }, + ) + if txnErr != nil { fmt.Println(fmt.Errorf("failed to initiate voting-station txn %w", txnErr)) return txnErr