naive: final touch-up

This commit is contained in:
Philip Monk 2021-10-05 22:20:35 -05:00
parent 32f07f4c3e
commit 7b528e823f
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
4 changed files with 14 additions and 83 deletions

View File

@ -99,6 +99,8 @@
::
+$ card card:agent:gall
::
++ orm ((on ship point:naive) por:naive)
::
:: TODO: add to config
::
++ resend-time ~m5
@ -234,7 +236,7 @@
:+ ~ ~
:- %noun
!> ^- (unit @)
?~ point=(get:orm:naive points.pre u.who)
?~ point=(get:orm points.pre u.who)
~
=< `nonce
(proxy-from-point:naive proxy u.point)
@ -246,12 +248,12 @@
!> ^- (list [=^ship =address:ethereum])
?~ star=(slaw %p wat) ~
=/ range
%+ lot:orm:naive points.pre
%+ lot:orm points.pre
:: range exclusive [star next-star-first-planet-]
:: TODO: make range inclusive ([first-planet last-planet])?
::
[`u.star `(cat 3 +(u.star) 0x1)]
%+ turn (tap:orm:naive range)
%+ turn (tap:orm range)
|= [=ship =point:naive]
^- [=^ship =address:ethereum]
:- ship
@ -261,7 +263,7 @@
|= wat=@t
?~ ship=(rush wat ;~(pfix sig fed:ag))
``noun+!>(*(unit point:naive))
``noun+!>((get:orm:naive points.pre u.ship))
``noun+!>((get:orm points.pre u.ship))
::
++ points
|= wat=@t
@ -586,7 +588,7 @@
++ get-l1-address
|= [=tx:naive nas=^state:naive]
^- (unit address:ethereum)
?~ point=(get:orm:naive points.nas ship.from.tx) ~
?~ point=(get:orm points.nas ship.from.tx) ~
=< `address
(proxy-from-point:naive proxy.from.tx u.point)
::

View File

@ -1,4 +1,5 @@
/+ tiny
!.
=> => tiny
:: Laconic bit
::
@ -147,7 +148,8 @@
== == ==
::
+$ state
$: =points
$: %0
=points
=operators
dns=(list @t)
==
@ -246,7 +248,7 @@
`[[[from-ship proxy] skim-tx.u.res] pos.u.res]
^- res=(unit [=skim-tx pos=@ud])
=^ op pos (take 0 7)
?+ op ~>(%slog.[0 %strange-opcode] ~)
?+ op (debug %strange-opcode ~)
%0
=^ reset=@ pos (take 0)
=^ =address pos (take 3 20)
@ -419,7 +421,7 @@
`u.existing
=| =point
=. who.sponsor.net.point (sein ship)
?+ (ship-rank ship) ~>(%slog.[0 %strange-point] ~)
?+ (ship-rank ship) (debug %strange-point ~)
%0 `point(dominion %l1)
?(%1 %2)
=/ existing-parent $(ship (sein ship))
@ -595,8 +597,7 @@
:+ ~ [%point ship %voting-proxy to]~
point(address.voting-proxy.own to)
::
~> %slog.[0 %unknown-log]
~
(debug %unknown-log ~)
::
:: Receive batch of L2 transactions
::

View File

@ -493,11 +493,6 @@
$(a l.a)
$(a r.a)
::
++ has
~/ %has
|* b=*
!=(~ (get b))
::
++ put
~/ %put
|* [b=* c=*]
@ -576,13 +571,6 @@
?~(r.a %.y &((mor key.n.a key.n.r.a) $(a r.a, r `key.n.a)))
==
::
++ gas
~/ %gas
|= [a=(tree item) b=(list item)]
^- (tree item)
?~ b a
$(b t.b, a (put a i.b))
::
++ get
~/ %get
|= [a=(tree item) b=key]
@ -600,58 +588,6 @@
^- ?
!=(~ (get a b))
::
++ lot
~/ %lot
|= $: tre=(tree item)
start=(unit key)
end=(unit key)
==
^- (tree item)
|^
?: ?&(?=(~ start) ?=(~ end))
tre
?~ start
(del-span tre %end end)
?~ end
(del-span tre %start start)
?> (compare u.start u.end)
=. tre (del-span tre %start start)
(del-span tre %end end)
::
++ del-span
|= [a=(tree item) b=?(%start %end) c=(unit key)]
^- (tree item)
?~ a a
?~ c a
?- b
%start
?: =(key.n.a u.c)
(nip a(l ~))
?: (compare key.n.a u.c)
$(a (nip a(l ~)))
a(l $(a l.a))
::
%end
?: =(u.c key.n.a)
(nip a(r ~))
?: (compare key.n.a u.c)
a(r $(a r.a))
$(a (nip a(r ~)))
==
--
::
++ nip
~/ %nip
|= a=(tree item)
^- (tree item)
?> ?=(^ a)
|- ^- (tree item)
?~ l.a r.a
?~ r.a l.a
?: (mor key.n.l.a key.n.r.a)
l.a(r $(l.a r.l.a))
r.a(l $(r.a l.r.a))
::
++ put
~/ %put
|= [a=(tree item) =key =val]
@ -669,15 +605,6 @@
?: (mor key.n.a key.n.r)
a(r r)
r(l a(r l.r))
::
++ tap
~/ %tap
|= a=(tree item)
^- (list item)
=| b=(list item)
|- ^+ b
?~ a b
$(a l.a, b [n.a $(a r.a)])
--
::
:: Sets

View File

@ -2326,6 +2326,7 @@
%+ expect-eq
!>
:- [%point ~bud %owner (addr %bud-key-0)]~
:- %0
:_ [~ ~] :_ [~ ~]
:- ~bud
%* . *point:naive