naive: expand approval-for-all test

This commit is contained in:
drbeefsupreme 2021-08-17 13:30:04 -04:00
parent 2f49dab586
commit c8b62d8d2c
No known key found for this signature in database
GPG Key ID: B70D5683DE7F9EFC

View File

@ -3159,8 +3159,8 @@
owner.own:(~(got by points.state) ~marbud)
::
++ test-changed-dns
:: raw data from transaction
:: https://etherscan.io/tx/0x51a26c3b100ad1c7aa8d593068df60465046d437edc3e939fadee4056791fd13#eventlog
:: uses actual data from ETH transaction
:: 0x51a26c3b100ad1c7aa8d593068df60465046d437edc3e939fadee4056791fd13
::
=/ data %- crip
;: weld
@ -3197,7 +3197,9 @@
++ test-approval-for-all
=| operators=(jug address address)
=/ op1 (~(put ju operators) (addr %test1) (addr %test2))
=/ del1 (~(del ju op1) (addr %test1) (addr %test2))
=/ op2 (~(put ju op1) (addr %test1) (addr %test3))
=/ del2 (~(del ju op2) (addr %test1) (addr %test2))
::
;: weld
%+ expect-eq
@ -3209,6 +3211,16 @@
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 1))
operators.state
::
%+ expect-eq
!> del1
::
!>
=| =^state:naive
=^ f state (init-marbud state)
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 1))
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 0))
operators.state
::
%+ expect-eq
!> op2
::
@ -3218,6 +3230,17 @@
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 1))
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test3) 1))
operators.state
::
%+ expect-eq
!> del2
::
!>
=| =^state:naive
=^ f state (init-marbud state)
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 1))
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test3) 1))
=^ f state (n state (approval-for-all:l1 (addr %test1) (addr %test2) 0))
operators.state
==
::
:: TODO: signature format changed; regenerate