Skip to content

Commit

Permalink
Update to newer go-wallet-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jimpick committed Dec 8, 2024
1 parent 126bb20 commit 1d1a95b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion cmd/agent_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ var createCmd = &cobra.Command{
s.Start()
defer s.Stop()

auth, err := walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID))
ethClient, err := PoolsSDK.Extern().ConnectEthClient()
if err != nil {
logFatal(err)
}

_, auth, err := walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID), ethClient)
if err != nil {
logFatal(err)
}
Expand Down
14 changes: 12 additions & 2 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ func commonOwnerOrOperatorSetup(ctx context.Context, from string) (agentAddr com
return common.Address{}, nil, accounts.Account{}, nil, err
}

auth, err = walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID))
ethClient, err := PoolsSDK.Extern().ConnectEthClient()
if err != nil {
return common.Address{}, nil, accounts.Account{}, nil, err
}

_, auth, err = walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID), ethClient)
if err != nil {
logFatal(err)
}
Expand Down Expand Up @@ -356,7 +361,12 @@ func commonGenericAccountSetup(ctx context.Context, from string) (auth *bind.Tra
}
}

auth, err = walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID))
ethClient, err := PoolsSDK.Extern().ConnectEthClient()
if err != nil {
return nil, accounts.Account{}, err
}

_, auth, err = walletutils.NewEthWalletTransactor(wallet, &account, passphrase, big.NewInt(chainID), ethClient)
if err != nil {
logFatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/filecoin-project/go-state-types v0.14.0
github.com/filecoin-project/lotus v1.28.1
github.com/glifio/go-pools v1.1.3
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533
github.com/glifio/go-wallet-utils v0.0.0-20241208165650-6ce2b38a31d2
github.com/golang/mock v1.6.0
github.com/ipfs/go-cid v0.4.1
github.com/pelletier/go-toml/v2 v2.0.6
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ github.com/glifio/go-pools v1.1.3 h1:o8lop9cckaxZ3P8UeWlk/GmlJLWhcQkiDIX9aDM82cA
github.com/glifio/go-pools v1.1.3/go.mod h1:G+JltF4457QvLCk8cIMLTHl6L7HgB515Bv8IRgFJJx8=
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533 h1:teuqQtVb7YMyqIOg+xUNO21qZAnm8ibhpKy4lIUBpag=
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533/go.mod h1:zJ9ksxDWIsuS80RtpjaM6swuKZ7OYdJH56I00EZRxD4=
github.com/glifio/go-wallet-utils v0.0.0-20241208165650-6ce2b38a31d2 h1:7FGk6IZO3rxeYfM/x2no58V/3QNxyixJHvB8gTYzOlI=
github.com/glifio/go-wallet-utils v0.0.0-20241208165650-6ce2b38a31d2/go.mod h1:Zf3Lh4yyVkBVtFgNkocJ+cS3f55ENdQfXptMilpJQrU=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down

0 comments on commit 1d1a95b

Please sign in to comment.