mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
e888960370
Including these in pkg/arvo has caused many minor problems over the years. We don't want to include them in releases, but this often meant excluding them manually, which was error-prone. Here, we move them out of /pkg/arvo/tests and into /tests. CI will have to be updated to match, since we'll still want to include tests there.
45 lines
2.1 KiB
Plaintext
45 lines
2.1 KiB
Plaintext
/+ ethereum, *test
|
|
|%
|
|
::TODO copy this:
|
|
:: https://github.com/ethereum/web3.js/blob/master/test/coder.encodeParam.js
|
|
::
|
|
++ test-static-args
|
|
%+ expect-eq
|
|
!> %- encode-args:abi:ethereum
|
|
:~ [%string "dave"]
|
|
[%bool &]
|
|
[%array [%uint 1] [%uint 2] [%uint 3] ~]
|
|
==
|
|
!> %- zing
|
|
:~ "0000000000000000000000000000000000000000000000000000000000000060"
|
|
"0000000000000000000000000000000000000000000000000000000000000001"
|
|
"00000000000000000000000000000000000000000000000000000000000000a0"
|
|
"0000000000000000000000000000000000000000000000000000000000000004"
|
|
"6461766500000000000000000000000000000000000000000000000000000000"
|
|
"0000000000000000000000000000000000000000000000000000000000000003"
|
|
"0000000000000000000000000000000000000000000000000000000000000001"
|
|
"0000000000000000000000000000000000000000000000000000000000000002"
|
|
"0000000000000000000000000000000000000000000000000000000000000003"
|
|
==
|
|
::
|
|
++ test-dynamic-args
|
|
%+ expect-eq
|
|
!> %- encode-args:abi:ethereum
|
|
:~ [%uint `@ud`0x123]
|
|
[%array [%uint `@ud`0x456] [%uint `@ud`0x789] ~]
|
|
[%bytes-n (as-octt:mimes:html (flop "1234567890"))]
|
|
[%bytes (as-octt:mimes:html (flop "Hello, world!"))]
|
|
==
|
|
!> %- zing
|
|
:~ "0000000000000000000000000000000000000000000000000000000000000123"
|
|
"0000000000000000000000000000000000000000000000000000000000000080"
|
|
"3132333435363738393000000000000000000000000000000000000000000000"
|
|
"00000000000000000000000000000000000000000000000000000000000000e0"
|
|
"0000000000000000000000000000000000000000000000000000000000000002"
|
|
"0000000000000000000000000000000000000000000000000000000000000456"
|
|
"0000000000000000000000000000000000000000000000000000000000000789"
|
|
"000000000000000000000000000000000000000000000000000000000000000d"
|
|
"48656c6c6f2c20776f726c642100000000000000000000000000000000000000"
|
|
==
|
|
--
|