naive: adoption test was wrong, not naive.hoon
=^ f5 state (n state %bat q:(gen-tx 0 lm-escape %rigrut-lm-key-0))
[:(welp f1 f2 f3 f4 f5) state]
::
-::
:: ~dopbud is for testing L1 ownership with L2 spawn proxy
::
++ init-dopbud
++ gen-rut-jar
^- (jar @p event)
=/ filter ;: cork
- (cury filter-owner %.y)
+ (cury filter-owner %.n)
(cury filter-proxy %own)
(cury filter-nonce %.y)
- ::(cury filter-rank %star)
- ::(cury filter-dominion %l1)
+ (cury filter-rank %planet)
+ (cury filter-dominion %l1)
%- cury
:- filter-tx-type
:* ::%spawn
=/ initial-state state
=/ ship-list rut-ship-list
=/ suc-map (make-success-map make-event-list)
+ ~& event-jar
::
|- ^- tang
?~ ship-list ~
%set-spawn-proxy set-spwn-proxy
%set-transfer-proxy set-xfer-proxy
%spawn (new-point which-spawn)
- %escape (set-escape which-escape-l2)
+ %escape (set-escape which-escape-l1)
==
::
++ set-keys ^- ^state:naive
%own (~(got by default-own-keys) cur-ship)
%manage (~(got by default-manage-keys) cur-ship)
==
- %wrong-key
+ %wrong-key :: if not owner then use wrong key
state
::
++ def-args
==
::
++ which-escape-l1 ^- ship
+ :: currently unused
:: escaping to a L1 point
?- rank.cur-event
%galaxy ~red
=^ f state (n state (escape-accepted:l1 ~rigred ~rabsum-ravtyd))
[escape.net sponsor.net]:(~(got by points.state) ~rabsum-ravtyd)
::
-++ test-l1-adoption-on-l2-wrong-key-or-nonce
- :: this is really bad
+++ test-rut-l1-adoption-on-l2-wrong-key-or-nonce
=/ rr-escape [[~rabsum-ravtyd %own] %escape ~rigred]
=/ rr-adopt [rigred-own %adopt ~rabsum-ravtyd]
::
::
!>
=| =^state:naive
- =^ f state (init-red-full state)
+ =^ f state (init-rut-full state)
=^ f state (n state %bat q:(gen-tx 1 rr-escape %wrong-key))
=^ f state (n state %bat q:(gen-tx 0 rr-adopt %rigred-key-0))
[escape.net sponsor.net]:(~(got by points.state) ~rabsum-ravtyd)
::
!>
=| =^state:naive
- =^ f state (init-red-full state)
+ =^ f state (init-rut-full state)
=^ f state (n state %bat q:(gen-tx 999 rr-escape %holrut-rr-key-0))
=^ f state (n state %bat q:(gen-tx 0 rr-adopt %rigred-key-0))
[escape.net sponsor.net]:(~(got by points.state) ~rabsum-ravtyd)
