From 6ec776f04aa70889d75c3265c9fe0855c9aef7d7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 29 Jun 2018 00:01:45 -0400 Subject: [PATCH] defers :acme initialization to first certificate order --- app/acme.hoon | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/app/acme.hoon b/app/acme.hoon index 57590e8ffa..cba797f9a8 100644 --- a/app/acme.hoon +++ b/app/acme.hoon @@ -1928,11 +1928,9 @@ ++ prep |= old=(unit acme) ^- (quip move _this) - ?^ old - [~ this(+<+ u.old)] - ?: ?=(?(%earl %pawn) (clan:title our.bow)) + ?~ old [~ this] - abet:init + [~ this(+<+ u.old)] :: ++ rekey :: XX do something about this |= eny=@ @@ -1958,12 +1956,26 @@ ++ add-order |= dom=(set turf) ^+ this - :: XX we may have pending moves out for this order - :: XX put dates in wires, check against order creation date? - :: XX or re-use order-id? + ?: ?=(?(%earl %pawn) (clan:title our.bow)) + this + :: set pending order + :: + =. pen `dom + :: archive active order if exists + :: + :: XX we may have pending moves out for this order + :: put dates in wires, check against order creation date? + :: or re-use order-id? + :: =? fal.hit ?=(^ rod) [u.rod fal.hit] - =< ?~(reg.act this new-order:effect) - this(rod ~, pen `dom) + =. rod ~ + :: if registered, create order + :: + ?^ reg.act + new-order:effect + :: if initialized, defer + :: + ?.(=(act *acct) this init) :: ++ test =, tester:tester