Skip to content

Commit

Permalink
fix: Fix Uint64 deserialization in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-smith committed Sep 24, 2023
1 parent 8cb9b84 commit a67d095
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 85 deletions.
10 changes: 7 additions & 3 deletions eth/tracers/blocknative/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ func (b Uint64) MarshalText() ([]byte, error) {
return []byte("0x" + strconv.FormatUint(uint64(b), 16)), nil
}

func (b Uint64) UnmarshalJSON(input []byte) error {
u := hexutil.Uint64(b)
return u.UnmarshalJSON(input)
func (b *Uint64) UnmarshalJSON(input []byte) error {
u := hexutil.Uint64(*b)
if err := u.UnmarshalJSON(input); err != nil {
return err
}
*b = Uint64(u)
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
"from": "0x3de712784baf97260455ae25fb74f574ec9c1add",
"to": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x7e2c0",
"gasUsed": "0x25883",
"input": "0xbbd4f854e9efd3ab89acad6a3edf9828c3b00ed1c4a74e974d05d32d3b2fb15aa16fc3770000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000080d29fa5cccfadac",
"output": "0x00000000000000000000000000000000000000000000000080d29fa5cccfadac",
"calls": [
Expand All @@ -147,8 +147,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x77e82",
"gasUsed": "0x54c",
"input": "0x8c172fa2d9a4ffe21d19763887176173d08241e8393c1dfd208f29193dfecdf854b664ac",
"output": "0x446374989d279847d0dbc6708a9c76a419fe9831d42c78bc89473f559a00d91500000000000000000000000061d76c05cd2aa9ed5135e21e52fff188b02089d4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000092f1dbea03ce08225e31e95cc926ddbe0198e6f2000000000000000000000000529c4cb814029b8bb32acb516ea3a4b07fdae350846fd373887ade3ab7703750294876afa61cf56303f5f014a4d80d04f508a1f100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"decoded": {
Expand All @@ -164,8 +164,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x7737b",
"gasUsed": "0x3fe1",
"input": "0x0439978de9efd3ab89acad6a3edf9828c3b00ed1c4a74e974d05d32d3b2fb15aa16fc3770000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000026566ea1ec2f6a9b00000000000000000000000000000000000000000000000072aa5b7e04d56a9b",
"output": "0x0000000000000000000000000000000000000000000000008060b57e2e0c99aa",
"calls": [
Expand All @@ -174,8 +174,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x770ef",
"gasUsed": "0xc24",
"input": "0x24d4e90a0000000000000000000000000000000000000000000000020000000000000000",
"output": "0x000000000000000000000000000000000000000000000000b17217f7d1cf79ab",
"decoded": {
Expand All @@ -190,8 +190,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x75eb2",
"gasUsed": "0x265",
"input": "0x872fb2b5000000000000000000000000000000000000000000000000c330b3f7006420b8",
"output": "0x00000000000000000000000000000000000000000000000224bf7df2c80f0878",
"decoded": {
Expand All @@ -206,8 +206,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x75aad",
"gasUsed": "0x25b",
"input": "0x872fb2b50000000000000000000000000000000000000000000000000000000000000000",
"output": "0x00000000000000000000000000000000000000000000000100000016aee6e8ef",
"decoded": {
Expand All @@ -222,8 +222,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x75737",
"gasUsed": "0xc24",
"input": "0x24d4e90a00000000000000000000000000000000000000000000000324bf7e0976f5f167",
"output": "0x0000000000000000000000000000000000000000000000012535c5e5f87ee0d2",
"decoded": {
Expand All @@ -238,8 +238,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x748c7",
"gasUsed": "0x265",
"input": "0x872fb2b5000000000000000000000000000000000000000000000000c330b3f7006420b8",
"output": "0x00000000000000000000000000000000000000000000000224bf7df2c80f0878",
"decoded": {
Expand All @@ -254,8 +254,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x744c2",
"gasUsed": "0x265",
"input": "0x872fb2b500000000000000000000000000000000000000000000000237d37fe5d297a500",
"output": "0x0000000000000000000000000000000000000000000000093088c407fcbbce38",
"decoded": {
Expand All @@ -270,8 +270,8 @@
"from": "0x8695e5e79dab06fbbb05f445316fa4edb0da30f0",
"to": "0xef3487d24a0702703e04a26cef479e313c8fc7ae",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x74142",
"gasUsed": "0xc99",
"input": "0x24d4e90a00000000000000000000000000000000000000000000000b554841fac4cad6b0",
"output": "0x0000000000000000000000000000000000000000000000026d7fc130d6a74cbe",
"decoded": {
Expand Down Expand Up @@ -301,8 +301,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x731be",
"gasUsed": "0x241",
"input": "0xc51cf179000000000000000000000000000000000000000000000000de0b6b3a76400000",
"output": "0x0000000000000000000000000000000000000000000000000071ea279ec31402",
"decoded": {
Expand All @@ -318,8 +318,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x92f1dbea03ce08225e31e95cc926ddbe0198e6f2",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x72df4",
"gasUsed": "0x468b",
"input": "0x23b872dd0000000000000000000000003de712784baf97260455ae25fb74f574ec9c1add0000000000000000000000006ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba500000000000000000000000000000000000000000000000080d29fa5cccfadac",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -338,8 +338,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x92f1dbea03ce08225e31e95cc926ddbe0198e6f2",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x6e627",
"gasUsed": "0x56d6",
"input": "0x095ea7b30000000000000000000000005aae5c59d642e5fd45b427df6ed478b49d55fefd00000000000000000000000000000000000000000000000080d29fa5cccfadac",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -357,8 +357,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x68dae",
"gasUsed": "0xd6f0",
"input": "0x07d5b826d9a4ffe21d19763887176173d08241e8393c1dfd208f29193dfecdf854b664ac00000000000000000000000000000000000000000000000080d29fa5cccfadac",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"calls": [
Expand All @@ -367,8 +367,8 @@
"from": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"to": "0x92f1dbea03ce08225e31e95cc926ddbe0198e6f2",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x629ff",
"gasUsed": "0x468b",
"input": "0x23b872dd0000000000000000000000006ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba50000000000000000000000005aae5c59d642e5fd45b427df6ed478b49d55fefd00000000000000000000000000000000000000000000000080d29fa5cccfadac",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -387,8 +387,8 @@
"from": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"to": "0x92f1dbea03ce08225e31e95cc926ddbe0198e6f2",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x5e0df",
"gasUsed": "0x31af",
"input": "0xa9059cbb000000000000000000000000950ca4a06c78934a148b7a3ff3ea8fc366f77a060000000000000000000000000000000000000000000000000041f50e27d56848",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -406,8 +406,8 @@
"from": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"to": "0x01e60b511fced1eb2b5b40991eb1dfd171a6df42",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x5ac6b",
"gasUsed": "0x29ae",
"input": "0x475a9fa90000000000000000000000006ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba50000000000000000000000000000000000000000000000008090aa97a4fa4564",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -424,8 +424,8 @@
"from": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"to": "0xf4cbd7e037b80c2e67b80512d482685f15b1fb28",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x57fed",
"gasUsed": "0x29ae",
"input": "0x475a9fa90000000000000000000000006ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba50000000000000000000000000000000000000000000000008090aa97a4fa4564",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -452,8 +452,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0x5aae5c59d642e5fd45b427df6ed478b49d55fefd",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x56030",
"gasUsed": "0x265",
"input": "0x1f0c1e0cd9a4ffe21d19763887176173d08241e8393c1dfd208f29193dfecdf854b664ac0000000000000000000000000000000000000000000000000000000000000001",
"output": "0x000000000000000000000000f4cbd7e037b80c2e67b80512d482685f15b1fb28",
"decoded": {
Expand All @@ -470,8 +470,8 @@
"from": "0x6ca7f214ab2ddbb9a8e1a1e2c8550e3164e9dba5",
"to": "0xf4cbd7e037b80c2e67b80512d482685f15b1fb28",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x55cc3",
"gasUsed": "0x339f",
"input": "0xa9059cbb0000000000000000000000003de712784baf97260455ae25fb74f574ec9c1add000000000000000000000000000000000000000000000000de0b6b3a76400000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"calls": [
Expand All @@ -480,8 +480,8 @@
"from": "0xf4cbd7e037b80c2e67b80512d482685f15b1fb28",
"to": "0x19ee743d2e356d5f0e4d97cc09b96d06e933d0db",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x55a8a",
"gasUsed": "0x30f7",
"input": "0x88d5fecb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000003de712784baf97260455ae25fb74f574ec9c1add000000000000000000000000000000000000000000000000de0b6b3a76400000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"from": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"to": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"value": "0x0",
"gas": "0x0",
"gasUsed": "0x0",
"gas": "0x5f58c50",
"gasUsed": "0xa188",
"input": "0xa9059cbb000000000000000000000000fba9f22d040e53e5fac36698080cee3dd3792262000000000000000000000000000000000000000000000207b733832c88c007ca",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"decoded": {
Expand All @@ -75,6 +75,27 @@
"random": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"balanceChanges": [
{
"address": "0x4675c7e5baafbffbca748158becba61ef3b0a263",
"balanceChanges": [
{
"delta": "1011744513820800",
"asset": {
"address": "0x0000000000000000000000000000000000000000",
"type": "eth",
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"breakdown": [
{
"counterparty": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"amount": "1011744513820800"
}
]
}
]
},
{
"address": "0xfba9f22d040e53e5fac36698080cee3dd3792262",
"balanceChanges": [
Expand All @@ -97,10 +118,10 @@
]
},
{
"address": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"address": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"balanceChanges": [
{
"delta": "-9587061213415306430410",
"delta": "95870612134153064304",
"asset": {
"address": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"type": "erc20",
Expand All @@ -110,15 +131,16 @@
},
"breakdown": [
{
"counterparty": "0xfba9f22d040e53e5fac36698080cee3dd3792262",
"amount": "-9491190601281153366106"
},
{
"counterparty": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"amount": "-95870612134153064304"
"counterparty": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"amount": "95870612134153064304"
}
]
},
}
]
},
{
"address": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"balanceChanges": [
{
"delta": "-1012435575212160",
"asset": {
Expand All @@ -138,14 +160,9 @@
"amount": "-1011744513820800"
}
]
}
]
},
{
"address": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"balanceChanges": [
},
{
"delta": "95870612134153064304",
"delta": "-9587061213415306430410",
"asset": {
"address": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"type": "erc20",
Expand All @@ -155,29 +172,12 @@
},
"breakdown": [
{
"counterparty": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"amount": "95870612134153064304"
}
]
}
]
},
{
"address": "0x4675c7e5baafbffbca748158becba61ef3b0a263",
"balanceChanges": [
{
"delta": "1011744513820800",
"asset": {
"address": "0x0000000000000000000000000000000000000000",
"type": "eth",
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"breakdown": [
"counterparty": "0xfba9f22d040e53e5fac36698080cee3dd3792262",
"amount": "-9491190601281153366106"
},
{
"counterparty": "0xf527a5ee2155fad99a5bbb23c9e52b0a11b99dd4",
"amount": "1011744513820800"
"counterparty": "0xc3761eb917cd790b30dad99f6cc5b4ff93c4f9ea",
"amount": "-95870612134153064304"
}
]
}
Expand Down

0 comments on commit a67d095

Please sign in to comment.