naive: large batch test

This commit is contained in:
drbeefsupreme 2021-09-13 12:56:53 -04:00
parent f9f82eedfd
commit b808f927d2
No known key found for this signature in database
GPG Key ID: B70D5683DE7F9EFC

View File

@ -3680,4 +3680,26 @@
owner.own:(got:orm points.state ~marbud)
==
::
++ test-large-batch ^- tang
=+ batch-size=20 :: should be an even number
=/ tx-1 [[marbud-own %transfer-point (addr %marbud-key-1) |] %marbud-key-0]
=/ tx-2 [[marbud-own %transfer-point (addr %marbud-key-0) |] %marbud-key-1]
=+ nonce=0
::
=| =^state:naive
=^ f state (init-marbud state)
%+ expect-eq
!> [`@ux`(addr %marbud-key-1) +(batch-size)]
::
!>
|^
?: =((mod nonce 2) 0)
=^ f state (n state %bat q:(gen-tx nonce tx-1)) loop
=^ f state (n state %bat q:(gen-tx nonce tx-2)) loop
++ loop
?: =(batch-size nonce)
owner.own:(got:orm points.state ~marbud)
$(nonce +(nonce))
--
::
--