naive: fully functional test-rut complete

This commit is contained in:
drbeefsupreme 2021-08-17 15:08:33 -04:00
parent c11cd709d0
commit febe814cce
No known key found for this signature in database
GPG Key ID: B70D5683DE7F9EFC

View File

@ -539,7 +539,7 @@
^$(nonce-i +(nonce-i)) ^$(nonce-i +(nonce-i))
=/ proxy-i 1 =/ proxy-i 1
|- |-
?. (lte proxy-i 5) ?. (lte proxy-i 4) ::no transfer proxy
^$(dominion-i +(dominion-i)) ^$(dominion-i +(dominion-i))
=/ tx-type-i 1 =/ tx-type-i 1
|- |-
@ -633,19 +633,19 @@
++ gen-rut-jar ++ gen-rut-jar
^- (jar @p event) ^- (jar @p event)
=/ filter ;: cork =/ filter ;: cork
(cury filter-owner %.y) ::(cury filter-owner %.y)
(cury filter-proxy %own) ::(cury filter-proxy %manage)
(cury filter-nonce %.y) ::(cury filter-nonce %.y)
(cury filter-rank %planet) ::(cury filter-rank %planet)
::(cury filter-dominion %spawn) ::(cury filter-dominion %spawn)
%- cury %- cury
:- filter-tx-type :- filter-tx-type
:* ::%spawn :* %spawn
::%transfer-point %transfer-point
%configure-keys %configure-keys
::%set-management-proxy %set-management-proxy
::%set-spawn-proxy :: planets can set spawn proxy atm %set-spawn-proxy
::%set-transfer-proxy %set-transfer-proxy
::%escape ::%escape
~ ~
== ==
@ -861,7 +861,8 @@
== ==
++ default-spawn-keys %- my:nl ++ default-spawn-keys %- my:nl
:* [~holrut %holrut-skey-0] :* [~holrut %holrut-skey-0]
[~losrut %losrut-skey-0] [~losrut %losrut-skey-1]
[~rigrut %rigrut-skey-0]
~ ~
== ==
:: ::
@ -907,7 +908,6 @@
=/ initial-state state =/ initial-state state
=/ ship-list rut-ship-list =/ ship-list rut-ship-list
=/ suc-map (make-success-map make-event-list) =/ suc-map (make-success-map make-event-list)
~& event-jar
:: ::
|- ^- tang |- ^- tang
?~ ship-list ~ ?~ ship-list ~
@ -925,6 +925,8 @@
%+ category (weld "tx-type " (scow %tas tx-type.cur-event)) %+ category (weld "tx-type " (scow %tas tx-type.cur-event))
%+ category (weld "owner? " (scow %f owner.cur-event)) %+ category (weld "owner? " (scow %f owner.cur-event))
%+ category (weld "correct nonce? " (scow %f nonce.cur-event)) %+ category (weld "correct nonce? " (scow %f nonce.cur-event))
%+ category (weld "success map " (scow %f (~(got by suc-map) cur-event)))
::
:: ::
=/ cur-point (~(got by points.initial-state) cur-ship) =/ cur-point (~(got by points.initial-state) cur-ship)
=* own own.cur-point =* own own.cur-point
@ -936,19 +938,21 @@
%vote nonce.voting-proxy.own %vote nonce.voting-proxy.own
%transfer nonce.transfer-proxy.own %transfer nonce.transfer-proxy.own
== ==
:: wrong nonce and/or wrong owner do not increment nonce
:: TODO: fix nonce calculation for e.g. %spawn proxy for planets
=/ new-nonce ?: &(nonce.cur-event owner.cur-event) =/ new-nonce ?: &(nonce.cur-event owner.cur-event)
?- rank.cur-event ?- proxy.cur-event
%galaxy +(cur-nonce) ?(%own %manage) +(cur-nonce)
%star +(cur-nonce) %spawn ?- rank.cur-event
%planet ?- proxy.cur-event %galaxy cur-nonce ::TODO: galaxies can actually do L2 spawn proxies so this needs to change
%own +(cur-nonce) %star ?- dominion.cur-event
%manage +(cur-nonce) %l1 cur-nonce
%spawn cur-nonce ::planets do not have a spawn proxy ?(%spawn %l2) +(cur-nonce)
%transfer +(cur-nonce)
%vote cur-nonce ::no vote proxy
== ==
%planet cur-nonce
==
%transfer ?~ address.transfer-proxy.own
cur-nonce
+(cur-nonce)
%vote cur-nonce
== ==
cur-nonce cur-nonce
:: ::