Update Go-Ethereum (#9157)

* update

* tidy

* fix

* fix e2e

* fix e2e

* fix bad tx opts
This commit is contained in:
Nishant Das
2021-07-09 20:58:43 +08:00
committed by GitHub
parent 7c23d02c3e
commit a9ee3ee06a
8 changed files with 120 additions and 54 deletions

View File

@@ -109,9 +109,13 @@ func main() {
if err != nil {
log.Fatal(err)
}
txOps = bind.NewKeyedTransactor(privKey)
txOps, err = bind.NewKeyedTransactorWithChainID(privKey, big.NewInt(1337))
if err != nil {
log.Fatal(err)
}
txOps.Value = big.NewInt(0)
txOps.GasLimit = 4000000
txOps.Context = context.Background()
// User inputs keystore json file, sign tx with keystore json
} else {
// #nosec - Inclusion of file via variable is OK for this tool.
@@ -135,9 +139,13 @@ func main() {
return err
}
txOps = bind.NewKeyedTransactor(privKey.PrivateKey)
txOps, err = bind.NewKeyedTransactorWithChainID(privKey.PrivateKey, big.NewInt(1337))
if err != nil {
log.Fatal(err)
}
txOps.Value = big.NewInt(0)
txOps.GasLimit = 4000000
txOps.Context = context.Background()
}
drain := txOps.From

View File

@@ -85,9 +85,13 @@ func main() {
if err != nil {
return err
}
txOps = bind.NewKeyedTransactor(privKey)
txOps, err = bind.NewKeyedTransactorWithChainID(privKey, big.NewInt(1337))
if err != nil {
return err
}
txOps.Value = big.NewInt(0)
txOps.GasLimit = 4000000
txOps.Context = context.Background()
nonce, err := client.NonceAt(context.Background(), crypto.PubkeyToAddress(privKey.PublicKey), nil)
if err != nil {
return errors.Wrap(err, "could not get account nonce")
@@ -109,9 +113,13 @@ func main() {
return err
}
txOps = bind.NewKeyedTransactor(privKey.PrivateKey)
txOps, err = bind.NewKeyedTransactorWithChainID(privKey.PrivateKey, big.NewInt(1337))
if err != nil {
return err
}
txOps.Value = big.NewInt(0)
txOps.GasLimit = 4000000
txOps.Context = context.Background()
nonce, err := client.NonceAt(context.Background(), privKey.Address, nil)
if err != nil {
return err