From 2f6e60aa1c0ba9182ff039269a25f8a3f54d6520 Mon Sep 17 00:00:00 2001 From: drbeefsupreme Date: Wed, 11 Aug 2021 11:52:22 -0400 Subject: [PATCH] naive: batch test creator implemented --- pkg/arvo/tests/lib/naive.hoon | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/tests/lib/naive.hoon b/pkg/arvo/tests/lib/naive.hoon index 4f394de6e8..37a808db08 100644 --- a/pkg/arvo/tests/lib/naive.hoon +++ b/pkg/arvo/tests/lib/naive.hoon @@ -698,7 +698,8 @@ -- :: :: takes in a list of full-tx and turns them into a batch - :: to be submitted to +n + :: to be submitted to +n. The ordering on the list is the order in which + :: the transactions are processed ++ tx-list-to-batch |= =tx-list ^- @ :: @@ -710,7 +711,7 @@ =/ cur-tx i.tx-list =/ cur-raw q:(gen-tx cur-tx) $(batch-raw (snoc batch-raw cur-raw), tx-list t.tx-list) - (roll tx-list-octs (cury cat 3)) + (roll (flop tx-list-octs) (cury cat 3)) :: -- :: end +l2-event-gen :: @@ -3009,6 +3010,23 @@ =^ f state (n state %bat q:signed-tx) transfer-proxy.own:(~(got by points.state) ~tasben-monbur) :: +++ test-batch-create + =, l2-event-gen + =/ marbud-transfer [marbud-own %transfer-point (addr %marbud-key-0) |] + =/ marbud-transfer-2 [marbud-own %transfer-point (addr %marbud-key-1) |] + :: + =/ tx-1=full-tx [0 marbud-transfer %marbud-key-0] + =/ tx-2=full-tx [1 marbud-transfer-2 %marbud-key-0] + =/ txs=tx-list (limo ~[tx-1 tx-2]) + %+ expect-eq + !> [(addr %marbud-key-1) 2] + :: + !> + =| =^state:naive + =^ f state (init-marbud state) + =^ f state (n state %bat (tx-list-to-batch txs)) + owner.own:(~(got by points.state) ~marbud) +:: :: TODO: signature format changed; regenerate :: :: ++ test-metamask-signature ^- tang