worm: fix attestation parsing (#3218)
The parser was dropping 0 bytes from the front, which is incorrect, because the symbol and name fields are right-padded with 0s.
This commit is contained in:
parent
f11299b888
commit
8d63ab50fb
|
@ -20,8 +20,8 @@
|
|||
"tokenAddress": "0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
||||
"tokenChain": 2,
|
||||
"decimals": 18,
|
||||
"symbol": "WETH",
|
||||
"name": "Wrapped ether"
|
||||
"symbol": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000WETH",
|
||||
"name": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000Wrapped ether"
|
||||
},
|
||||
"digest": "0x6793c77cc9283df50ab5f2cdd688637d6ba935d4e6baabf46e07b83c55655461"
|
||||
"digest": "0x4bb52b9a44ff6062ba5db1c47afc40c186f7485c8972b1c6261eb070ce0b1c6e"
|
||||
}
|
||||
|
|
|
@ -746,20 +746,12 @@ function tokenBridgeAttestMetaParser(): P<TokenBridgeAttestMeta> {
|
|||
.array("symbol", {
|
||||
type: "uint8",
|
||||
lengthInBytes: 32,
|
||||
formatter: (arr: Uint8Array) =>
|
||||
Buffer.from(arr).toString(
|
||||
"utf8",
|
||||
arr.findIndex((val) => val != 0)
|
||||
),
|
||||
formatter: (arr: Uint8Array) => Buffer.from(arr).toString("utf8"),
|
||||
})
|
||||
.array("name", {
|
||||
type: "uint8",
|
||||
lengthInBytes: 32,
|
||||
formatter: (arr: Uint8Array) =>
|
||||
Buffer.from(arr).toString(
|
||||
"utf8",
|
||||
arr.findIndex((val) => val != 0)
|
||||
),
|
||||
formatter: (arr: Uint8Array) => Buffer.from(arr).toString("utf8"),
|
||||
})
|
||||
.string("end", {
|
||||
greedy: true,
|
||||
|
|
Loading…
Reference in New Issue