Support multiple, sequential batches

This commit is contained in:
Fang 2019-06-13 21:11:26 +02:00
parent 701caf537f
commit 37e85275b3
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -33,6 +33,7 @@
== ==
:: ::
++ batch ++ batch
$~ [%deed '{}']
$% :: %single: execute a single ecliptic function call $% :: %single: execute a single ecliptic function call
:: ::
[%single =call] [%single =call]
@ -45,6 +46,9 @@
:: %lock: put ships into lockup for the target address :: %lock: put ships into lockup for the target address
:: ::
[%lock what=(list ship) to=address =lockup] [%lock what=(list ship) to=address =lockup]
:: %more: multiple batches sequentially
::
[%more batches=(list batch)]
== ==
:: ::
++ lockup ++ lockup
@ -377,11 +381,29 @@
%generate %generate
%+ write-file-transactions %+ write-file-transactions
path.command path.command
?- -.batch.command (batch-to-transactions nonce [network as batch]:command)
%single [(single nonce [network as +.batch]:command) ~] ==
%deed (deed nonce [network as +.batch]:command) ::
%lock-prep (lock-prep nonce [network as +.batch]:command) ++ batch-to-transactions
%lock (lock nonce [network as +.batch]:command) |= [nonce=@ud =network as=address =batch]
^- (list transaction)
?- -.batch
%single [(single nonce network as +.batch) ~]
%deed (deed nonce network as +.batch)
%lock-prep (lock-prep nonce network as +.batch)
%lock (lock nonce network as +.batch)
::
%more
=| txs=(list transaction)
=* batches batches.batch
|-
?~ batches txs
=/ new-txs=(list transaction)
^$(batch i.batches)
%_ $
txs (weld txs new-txs)
nonce (add nonce (lent new-txs))
batches t.batches
== ==
== ==
:: ::