mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 12:36:48 +00:00
docs: replace deprecated function NewTransactor in native-bindings page (#29369)
This commit is contained in:
parent
8787b06b4b
commit
1c4860424c
1 changed files with 2 additions and 2 deletions
|
|
@ -223,12 +223,12 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to connect to the Ethereum client: %v", err)
|
log.Fatalf("Failed to connect to the Ethereum client: %v", err)
|
||||||
}
|
}
|
||||||
auth, err := bind.NewTransactor(strings.NewReader(key), "<<strong_password>>")
|
auth, err := bind.NewTransactorWithChainID(strings.NewReader(key), "<<strong_password>>", ChainId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to create authorized transactor: %v", err)
|
log.Fatalf("Failed to create authorized transactor: %v", err)
|
||||||
}
|
}
|
||||||
// Deploy the contract passing the newly created `auth` and `conn` vars
|
// Deploy the contract passing the newly created `auth` and `conn` vars
|
||||||
address, tx, instance, err := DeployStorage(auth, conn), new(big.Int), "Storage contract in Go!", 0, "Go!")
|
address, tx, instance, err := DeployStorage(auth, conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to deploy new storage contract: %v", err)
|
log.Fatalf("Failed to deploy new storage contract: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue