mirror of
https://github.com/urbit/shrub.git
synced 2025-01-06 21:18:42 +03:00
Support lockup preparation
This action spawns stars and sends them to the ceremony address.
This commit is contained in:
parent
26953e92ca
commit
701caf537f
@ -33,8 +33,17 @@
|
||||
==
|
||||
::
|
||||
++ batch
|
||||
$% [%single =call]
|
||||
$% :: %single: execute a single ecliptic function call
|
||||
::
|
||||
[%single =call]
|
||||
:: %deed: deed ships based on json, assumes spawnable
|
||||
::
|
||||
[%deed deeds-json=cord]
|
||||
:: %lock-prep: prepare for lockup by transfering ships to the ceremony address
|
||||
::
|
||||
[%lock-prep what=(list ship)]
|
||||
:: %lock: put ships into lockup for the target address
|
||||
::
|
||||
[%lock what=(list ship) to=address =lockup]
|
||||
==
|
||||
::
|
||||
@ -369,9 +378,10 @@
|
||||
%+ write-file-transactions
|
||||
path.command
|
||||
?- -.batch.command
|
||||
%single [(single nonce [network as +.batch]:command) ~]
|
||||
%deed (deed nonce [network as +.batch]:command)
|
||||
%lock (lock 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)
|
||||
%lock (lock nonce [network as +.batch]:command)
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -510,6 +520,26 @@
|
||||
%key ;~(pose (stag ~ hex) (cold ~ (jest '')))
|
||||
==
|
||||
::
|
||||
++ lock-prep
|
||||
|= [nonce=@ud =network as=address what=(list ship)]
|
||||
^- (list transaction)
|
||||
=| txs=(list transaction)
|
||||
|^
|
||||
?~ what (flop txs)
|
||||
=. txs
|
||||
%- do-here
|
||||
(spawn:dat i.what as)
|
||||
=. txs
|
||||
%- do-here
|
||||
%+ transfer-ship:dat i.what
|
||||
0x740d.6d74.1711.163d.3fca.cecf.1f11.b867.9a7c.7964
|
||||
$(what t.what)
|
||||
++ do-here
|
||||
|= dat=tape
|
||||
:_ txs
|
||||
(do network (add nonce (lent txs)) ecliptic dat)
|
||||
--
|
||||
::
|
||||
::TODO need secondary kind of lockup logic, where
|
||||
:: 1) we need to batch-transfer stars to the ceremony
|
||||
:: 2) (not forget to register and) deposit already-active stars
|
||||
|
Loading…
Reference in New Issue
Block a user