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

remove gasPrice para #31

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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