Skip to content

Commit

Permalink
Bump github.com/lmittmann/w3 from 0.16.4 to 0.17.0 (#115)
Browse files Browse the repository at this point in the history
* Bump github.com/lmittmann/w3 from 0.16.4 to 0.17.0

Bumps [github.com/lmittmann/w3](https://github.com/lmittmann/w3) from 0.16.4 to 0.17.0.
- [Release notes](https://github.com/lmittmann/w3/releases)
- [Commits](lmittmann/w3@v0.16.4...v0.17.0)

---
updated-dependencies:
- dependency-name: github.com/lmittmann/w3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixed v0.17.0 upgrade

* gofumpt

* updated doc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and lmittmann authored Aug 23, 2024
1 parent 7f2e17e commit 70934a0
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 133 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ List of supported RPC methods.
| Method | Go Code
| :----------------------------- | :-------
| `eth_sendBundle` | `flashbots.SendBundle(r *flashbots.SendBundleRequest).Returns(bundleHash *common.Hash)`
| `eth_callBundle` | `flashbots.CallBundle(r *flashbots.CallBundleRequest).Returns(resp *flashbots.CallBundleResponse)`
| `eth_callBundle` | `flashbots.CallBundle(r *flashbots.CallBundleRequest).Returns(resp **flashbots.CallBundleResponse)`
| `eth_sendPrivateTransaction` | `flashbots.SendPrivateTx(r *flashbots.SendPrivateTxRequest).Returns(txHash *common.Hash)`
| `eth_cancelPrivateTransaction` | `flashbots.CancelPrivateTx(txHash common.Hash).Returns(success *bool)`
| ~~`flashbots_getUserStats`~~ | ~~`flashbots.UserStats(blockNumber *big.Int).Returns(resp *flashbots.UserStatsResponse)`~~
| ~~`flashbots_getBundleStats`~~ | ~~`flashbots.BundleStats(bundleHash common.Hash, blockNumber *big.Int).Returns(resp *flashbots.BundleStatsResponse)`~~
| `flashbots_getUserStatsV2` | `flashbots.UserStatsV2(blockNumber *big.Int).Returns(resp *flashbots.UserStatsV2Response)`
| `flashbots_getBundleStatsV2` | `flashbots.BundleStatsV2(bundleHash common.Hash, blockNumber *big.Int).Returns(resp *flashbots.BundleStatsV2Response)`
| ~~`flashbots_getUserStats`~~ | ~~`flashbots.UserStats(blockNumber *big.Int).Returns(resp **flashbots.UserStatsResponse)`~~
| ~~`flashbots_getBundleStats`~~ | ~~`flashbots.BundleStats(bundleHash common.Hash, blockNumber *big.Int).Returns(resp **flashbots.BundleStatsResponse)`~~
| `flashbots_getUserStatsV2` | `flashbots.UserStatsV2(blockNumber *big.Int).Returns(resp **flashbots.UserStatsV2Response)`
| `flashbots_getBundleStatsV2` | `flashbots.BundleStatsV2(bundleHash common.Hash, blockNumber *big.Int).Returns(resp **flashbots.BundleStatsV2Response)`
6 changes: 3 additions & 3 deletions call_bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *CallBundleResponse) UnmarshalJSON(input []byte) error {
}

// CallBundle simulates a bundle.
func CallBundle(r *CallBundleRequest) w3types.RPCCallerFactory[CallBundleResponse] {
func CallBundle(r *CallBundleRequest) w3types.RPCCallerFactory[*CallBundleResponse] {
return &callBundleFactory{param: r}
}

Expand All @@ -184,10 +184,10 @@ type callBundleFactory struct {
param *CallBundleRequest

// returns
returns *CallBundleResponse
returns **CallBundleResponse
}

func (f *callBundleFactory) Returns(resp *CallBundleResponse) w3types.RPCCaller {
func (f *callBundleFactory) Returns(resp **CallBundleResponse) w3types.RPCCaller {
f.returns = resp
return f
}
Expand Down
8 changes: 3 additions & 5 deletions call_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestCallBundle(t *testing.T) {
tests := []rpctest.TestCase[flashbots.CallBundleResponse]{
rpctest.RunTestCases(t, []rpctest.TestCase[*flashbots.CallBundleResponse]{
{
Golden: "call_bundle",
Call: flashbots.CallBundle(&flashbots.CallBundleRequest{
Expand All @@ -31,7 +31,7 @@ func TestCallBundle(t *testing.T) {
CoinbaseDiff: w3.I("10000000000063000"),
EthSentToCoinbase: w3.I("10000000000000000"),
FromAddress: w3.A("0x02A727155aeF8609c9f7F2179b2a1f560B39F5A0"),
GasFees: w3.I("63000"), //XXX
GasFees: w3.I("63000"), // XXX
GasPrice: w3.I("476190476193"),
GasUsed: 21000,
ToAddress: w3.APtr("0x73625f59CAdc5009Cb458B751b3E7b6b48C06f2C"),
Expand All @@ -52,7 +52,5 @@ func TestCallBundle(t *testing.T) {
},
},
},
}

rpctest.RunTestCases(t, tests)
})
}
12 changes: 6 additions & 6 deletions examples/call_and_send_bundle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func main() {
// fetch nonce, gas price, and latest block
var (
nonce uint64
gasPrice big.Int
latestBlock big.Int
gasPrice *big.Int
latestBlock *big.Int
)
if err := client.Call(
eth.Nonce(addr, nil).Returns(&nonce),
Expand All @@ -49,19 +49,19 @@ func main() {
// build transaction
tx := types.MustSignNewTx(prv, signer, &types.DynamicFeeTx{
Nonce: nonce,
GasFeeCap: &gasPrice,
GasFeeCap: gasPrice,
GasTipCap: w3.I("1 gwei"),
Gas: 250_000,
// To: w3.APtr("0x..."),
// Data: w3.B("0xc0fe..."),
})

// call bundle
var callBundle flashbots.CallBundleResponse
var callBundle *flashbots.CallBundleResponse
if err := fbClient.Call(
flashbots.CallBundle(&flashbots.CallBundleRequest{
Transactions: []*types.Transaction{tx},
BlockNumber: new(big.Int).Add(&latestBlock, w3.Big1),
BlockNumber: new(big.Int).Add(latestBlock, w3.Big1),
}).Returns(&callBundle),
); err != nil {
fmt.Printf("Failed to call bundle: %v\n", err)
Expand All @@ -74,7 +74,7 @@ func main() {
if err := fbClient.Call(
flashbots.SendBundle(&flashbots.SendBundleRequest{
Transactions: []*types.Transaction{tx},
BlockNumber: new(big.Int).Add(&latestBlock, w3.Big1),
BlockNumber: new(big.Int).Add(latestBlock, w3.Big1),
}).Returns(&bundleHash),
); err != nil {
fmt.Printf("Failed to send bundle: %v\n", err)
Expand Down
10 changes: 5 additions & 5 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module examples
go 1.22

require (
github.com/ethereum/go-ethereum v1.14.5
github.com/ethereum/go-ethereum v1.14.8
github.com/lmittmann/flashbots v0.0.0
github.com/lmittmann/w3 v0.16.4
github.com/lmittmann/w3 v0.17.0
)

replace github.com/lmittmann/flashbots => ../
Expand All @@ -14,7 +14,7 @@ require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
Expand All @@ -23,7 +23,7 @@ require (
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.11 // indirect
Expand All @@ -33,6 +33,6 @@ require (
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/time v0.6.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
46 changes: 24 additions & 22 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88=
github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8=
github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw=
github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I=
github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8=
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4=
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4=
github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E=
github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw=
github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
Expand All @@ -44,12 +46,12 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw=
github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc=
github.com/ethereum/go-ethereum v1.14.8 h1:NgOWvXS+lauK+zFukEvi85UmmsS/OkV0N23UZ1VTIig=
github.com/ethereum/go-ethereum v1.14.8/go.mod h1:TJhyuDq0JDppAkFXgqjwpdlQApywnu/m10kFPxh8vvs=
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4=
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w=
github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0=
github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ=
github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps=
github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
Expand All @@ -68,10 +70,10 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs=
github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -80,8 +82,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/lmittmann/w3 v0.16.4 h1:N60z3egf9QzFzZdCaHxDgViOZA/EopNwQaPe8ulc8hw=
github.com/lmittmann/w3 v0.16.4/go.mod h1:6bihKnv6p79opmyug5rSk8xMf54DnM5m06owLhDvAiY=
github.com/lmittmann/w3 v0.17.0 h1:Bsb6xSNU+woj7+VO7ERBCus97oCy6EWWKVUmoFbt534=
github.com/lmittmann/w3 v0.17.0/go.mod h1:sQXu3RJpP6Oj398bFyHeFiMHUExVxVOzoKrWZd/+yZ0=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
Expand Down Expand Up @@ -109,8 +111,8 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
Expand All @@ -133,10 +135,10 @@ golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
6 changes: 3 additions & 3 deletions examples/user_stats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (

func main() {
// fetch latest block
var latestBlock big.Int
var latestBlock *big.Int
if err := client.Call(
eth.BlockNumber().Returns(&latestBlock),
); err != nil {
Expand All @@ -32,9 +32,9 @@ func main() {
}

// fetch user statistics
var userStats flashbots.UserStatsV2Response
var userStats *flashbots.UserStatsV2Response
if err := fbClient.Call(
flashbots.UserStatsV2(&latestBlock).Returns(&userStats),
flashbots.UserStatsV2(latestBlock).Returns(&userStats),
); err != nil {
fmt.Printf("Failed to fetch user statistics: %v\n", err)
return
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module github.com/lmittmann/flashbots
go 1.22

require (
github.com/ethereum/go-ethereum v1.14.5
github.com/lmittmann/w3 v0.16.4
github.com/ethereum/go-ethereum v1.14.8
github.com/lmittmann/w3 v0.17.0
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
Expand All @@ -21,7 +21,7 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.11 // indirect
Expand All @@ -31,6 +31,6 @@ require (
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/time v0.6.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading

0 comments on commit 70934a0

Please sign in to comment.