Skip to content

Commit

Permalink
remove gasPrice para
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyachi committed Jun 24, 2022
1 parent a766458 commit faf9597
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
type Config struct {
ChainId uint64
KeyStoreProviders []*KeyStoreProviderConfig
KeyProviders []string
KeyProviders []string
Nodes []string

// NEO wallet
Expand Down Expand Up @@ -195,7 +195,7 @@ func (w *Wallet) sendWithAccount(dry bool, account accounts.Account, addr common
return
}
if gasLimit == 0 {
msg := ethereum.CallMsg{From: account.Address, To: &addr, GasPrice: gasPrice, Value: amount, Data: data}
msg := ethereum.CallMsg{From: account.Address, To: &addr, Value: amount, Data: data}
gasLimit, err = w.sdk.Node().EstimateGas(context.Background(), msg)
if err != nil {
nonces.Update(false)
Expand Down Expand Up @@ -282,7 +282,7 @@ func (w *Wallet) EstimateGasWithAccount(account accounts.Account, addr common.Ad
err = fmt.Errorf("Get gas price error %v", err)
return
}
msg := ethereum.CallMsg{From: account.Address, To: &addr, GasPrice: gasPrice, Value: amount, Data: data}
msg := ethereum.CallMsg{From: account.Address, To: &addr, Value: amount, Data: data}
gasLimit, err = w.sdk.Node().EstimateGas(context.Background(), msg)
if err != nil {
err = fmt.Errorf("Estimate gas limit error %v, account %s", err, account.Address)
Expand All @@ -291,7 +291,6 @@ func (w *Wallet) EstimateGasWithAccount(account accounts.Account, addr common.Ad
return
}


func (w *Wallet) SendWithMaxLimit(account accounts.Account, addr common.Address, amount *big.Int, maxLimit *big.Int, gasPrice *big.Int, gasPriceX *big.Float, data []byte) (hash string, err error) {
if maxLimit == nil || maxLimit.Sign() <= 0 {
err = fmt.Errorf("max limit is zero or missing")
Expand All @@ -315,7 +314,7 @@ func (w *Wallet) SendWithMaxLimit(account accounts.Account, addr common.Address,
}

var gasLimit uint64
msg := ethereum.CallMsg{From: account.Address, To: &addr, GasPrice: gasPrice, Value: amount, Data: data}
msg := ethereum.CallMsg{From: account.Address, To: &addr, Value: amount, Data: data}
gasLimit, err = w.sdk.Node().EstimateGas(context.Background(), msg)
if err != nil {
nonces.Update(false)
Expand Down

0 comments on commit faf9597

Please sign in to comment.