%eth-watcher: ensure get-block-by-number RPC call doesn't pad block number.

Resolves #6377 - stuck %eth-watcher due to get-block-by-number zero-padded number RPC failure
This commit is contained in:
J Lynn 2023-03-08 09:23:37 +11:00
parent 81ab1c8b24
commit f5eeffef58

View File

@ -733,7 +733,7 @@
::
%eth-get-block-by-number
:- 'eth_getBlockByNumber'
:~ (tape (num-to-hex bon.req))
:~ (tape (num-to-hex-minimal bon.req))
b+txs.req
==
::
@ -942,6 +942,15 @@
%- render-hex-bytes
(as-octs:mimes:html n)
::
++ num-to-hex-minimal
|= n=@
^- tape
%- prefix-hex
?: =(0 n)
"0"
%- render-hex-bytes-minimal
(as-octs:mimes:html n)
::
++ address-to-hex
|= a=address
^- tape
@ -980,6 +989,12 @@
^- tape
((x-co:co (mul 2 p.a)) q.a)
::
++ render-hex-bytes-minimal
:: atom to string of hex bytes without 0x prefix and dots, minimal representation (no padding).
|= a=octs
^- tape
((x-co:co 1) q.a)
::
++ pad-to-multiple
|= [wat=tape mof=@ud wer=?(%left %right)]
^- tape