mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 07:52:59 +03:00
mall: fix tests
This commit is contained in:
parent
607a2c0ac6
commit
881517c872
@ -63,7 +63,7 @@
|
||||
=^ cards state
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%handle-http-request
|
||||
(handle-http-request:lsp !<([eyre-id=@ta inbound-request:eyre vase))
|
||||
(handle-http-request:lsp !<([eyre-id=@ta inbound-request:eyre] vase))
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
@ -126,6 +126,7 @@
|
||||
::
|
||||
++ handle-http-request
|
||||
|= [eyre-id=@ta =inbound-request:eyre]
|
||||
^- (quip card _state)
|
||||
?> ?=(^ body.request.inbound-request)
|
||||
=/ =lsp-req
|
||||
%- parser
|
||||
@ -138,6 +139,7 @@
|
||||
==
|
||||
=. bufs
|
||||
(~(put by bufs) uri.lsp-req buf)
|
||||
:_ state
|
||||
%+ give-simple-payload:app eyre-id
|
||||
%+ require-authorization:app inbound-request
|
||||
|= =inbound-request:eyre
|
||||
|
@ -20,15 +20,17 @@
|
||||
--
|
||||
=; core
|
||||
^- imp:spider
|
||||
|= =bowl:spider
|
||||
=/ m (thread ,~)
|
||||
|= [=bowl:spider args=vase]
|
||||
=/ m (thread ,vase)
|
||||
^- form:m
|
||||
;< ~ bind:m (subscribe-our:threadio /effects %aqua /effect)
|
||||
%- (main-loop:threadio ,state)
|
||||
:~ |=(=state ~(handle-unix-effect core state))
|
||||
|=(=state ~(handle-poke core state))
|
||||
pure:(thread ,state)
|
||||
==
|
||||
;< ~ bind:m (watch-our:threadio /effects %aqua /effect)
|
||||
;< ~ bind:m
|
||||
%- (main-loop:threadio ,state)
|
||||
:~ |=(=state ~(handle-unix-effect core state))
|
||||
|=(=state ~(handle-poke core state))
|
||||
pure:(thread ,state)
|
||||
==
|
||||
(pure:m *vase)
|
||||
::
|
||||
|_ =state
|
||||
++ handle-unix-effect
|
||||
|
@ -292,7 +292,7 @@
|
||||
:: Main
|
||||
::
|
||||
^- imp:spider
|
||||
|= =bowl:spider
|
||||
|= [=bowl:spider args=vase]
|
||||
=/ m (thread ,vase)
|
||||
^- form:m
|
||||
;< ~ bind:m
|
||||
|
@ -1,17 +0,0 @@
|
||||
/- spider
|
||||
/+ *threadio
|
||||
=, thread=thread:libthread
|
||||
^- imp:spider
|
||||
|= [=bowl:spider =vase]
|
||||
=/ m (thread ,vase)
|
||||
^- form:m
|
||||
~& > 'starting azt'
|
||||
=/ url 'http://eth-mainnet.urbit.org:8545'
|
||||
=/ poke-vase !>([%azimuth-tracker %azimuth-tracker-poke !>([%watch url])])
|
||||
;< ~ bind:m (poke-our %spider %spider-imput poke-vase)
|
||||
;< ~ bind:m (watch-our /sub %spider /imp/azimuth-tracker)
|
||||
|- ^- form:m
|
||||
=* loop $
|
||||
;< [=mark =vase] bind:m (take-fact /sub)
|
||||
%- (slog (sell vase) ~)
|
||||
loop
|
@ -15,4 +15,4 @@
|
||||
;< ~ bind:m (real-ship ~dev)
|
||||
;< ~ bind:m (wait-for-output ~bud "hi ~dev successful")
|
||||
;< ~ bind:m end-azimuth
|
||||
(pure:m vase)
|
||||
(pure:m *vase)
|
||||
|
@ -1,89 +0,0 @@
|
||||
|* [state=mold in-poke-data=mold sign=mold]
|
||||
|%
|
||||
++ agent
|
||||
=> |%
|
||||
+$ step (quip move:agent:mall state)
|
||||
--
|
||||
$_ ^|
|
||||
|_ [bowl:mall state]
|
||||
++ handle-init
|
||||
*step
|
||||
::
|
||||
++ handle-prep
|
||||
|~ old-state=vase
|
||||
*step
|
||||
::
|
||||
++ handle-poke
|
||||
|~ =in-poke-data
|
||||
*step
|
||||
::
|
||||
++ handle-peer
|
||||
|~ path
|
||||
*step
|
||||
::
|
||||
++ handle-pull
|
||||
|~ path
|
||||
*step
|
||||
::
|
||||
++ handle-peek
|
||||
|~ path
|
||||
*(unit (unit cage))
|
||||
::
|
||||
++ handle-mall
|
||||
|~ [wire internal-gift:mall]
|
||||
*step
|
||||
::
|
||||
++ handle-take
|
||||
|~ [wire =sign]
|
||||
*step
|
||||
::
|
||||
++ handle-lame
|
||||
|~ [term tang]
|
||||
*step
|
||||
--
|
||||
++ agent-to-mall-agent
|
||||
|= =a=agent
|
||||
|^ ^- agent:mall
|
||||
|_ [=bowl:mall state=vase]
|
||||
++ handle-init (ag-step handle-init:(ag-core bowl state))
|
||||
++ handle-prep ((ag-pace ,vase) handle-prep:(ag-core bowl state))
|
||||
++ handle-poke
|
||||
|= in=cage
|
||||
~& poke-in=in
|
||||
~& !>(*in-poke-data)
|
||||
=/ data=(unit in-poke-data) !<(in-poke-data q.in)
|
||||
?~ data
|
||||
~| [%agent-received-malformed-poke our.bowl dap.bowl]
|
||||
!!
|
||||
(ag-step (handle-poke:(ag-core bowl state) u.data))
|
||||
::
|
||||
++ handle-peer ((ag-pace ,path) handle-peer:(ag-core bowl state))
|
||||
++ handle-pull ((ag-pace ,path) handle-pull:(ag-core bowl state))
|
||||
++ handle-peek handle-peek:(ag-core bowl state)
|
||||
++ handle-mall
|
||||
%- (ag-pace ,[wire internal-gift:mall])
|
||||
handle-mall:(ag-core bowl state)
|
||||
::
|
||||
++ handle-take ((ag-pace ,[wire vase]) handle-take:(ag-core bowl state))
|
||||
++ handle-lame ((ag-pace ,[term tang]) handle-lame:(ag-core bowl state))
|
||||
--
|
||||
::
|
||||
++ ag-core
|
||||
|= [=bowl:mall =state=vase]
|
||||
=/ static-state !<(state state-vase)
|
||||
?~ static-state
|
||||
~| [%bad-state-type our.bowl dap.bowl]
|
||||
!!
|
||||
~(. a-agent bowl u.static-state)
|
||||
::
|
||||
++ ag-step
|
||||
|= =step:agent
|
||||
[-.step !>(+.step)]
|
||||
::
|
||||
++ ag-pace
|
||||
|* in=mold
|
||||
|= fun=$-(in step:agent)
|
||||
|= =in
|
||||
(ag-step (fun in))
|
||||
--
|
||||
--
|
@ -428,28 +428,27 @@
|
||||
|= [crash-after=(unit @ud) computation=_*form:(thread (unit result))]
|
||||
=/ m (thread ,result)
|
||||
=| try=@ud
|
||||
|^ |- ^- form:m
|
||||
=* loop $
|
||||
?: =(crash-after `try)
|
||||
(thread-fail %retry-too-many ~)
|
||||
;< ~ bind:m (backoff try ~m1)
|
||||
;< res=(unit result) bind:m computation
|
||||
?^ res
|
||||
(pure:m u.res)
|
||||
loop(try +(try))
|
||||
::
|
||||
++ backoff
|
||||
|= [try=@ud limit=@dr]
|
||||
=/ m (thread ,~)
|
||||
^- form:m
|
||||
;< eny=@uvJ bind:m get-entropy
|
||||
%- sleep
|
||||
%+ min limit
|
||||
?: =(0 try) ~s0
|
||||
%+ add
|
||||
(mul ~s1 (bex (dec try)))
|
||||
(mul ~s0..0001 (~(rad og eny) 1.000))
|
||||
--
|
||||
|- ^- form:m
|
||||
=* loop $
|
||||
?: =(crash-after `try)
|
||||
(thread-fail %retry-too-many ~)
|
||||
;< ~ bind:m (backoff try ~m1)
|
||||
;< res=(unit result) bind:m computation
|
||||
?^ res
|
||||
(pure:m u.res)
|
||||
loop(try +(try))
|
||||
::
|
||||
++ backoff
|
||||
|= [try=@ud limit=@dr]
|
||||
=/ m (thread ,~)
|
||||
^- form:m
|
||||
;< eny=@uvJ bind:m get-entropy
|
||||
%- sleep
|
||||
%+ min limit
|
||||
?: =(0 try) ~s0
|
||||
%+ add
|
||||
(mul ~s1 (bex (dec try)))
|
||||
(mul ~s0..0001 (~(rad og eny) 1.000))
|
||||
::
|
||||
:: ----
|
||||
::
|
||||
|
@ -59,7 +59,6 @@
|
||||
$txt (frond %txt (tape p.sef))
|
||||
$tan (frond %tan (tape (wush 160 p.sef)))
|
||||
$det (frond %det json:~(grow mar-sole-change +.sef))
|
||||
$tab (frond %tab a+(turn p.sef |=([=cord tan=^tank] (pairs match+s+cord info+(tape ~(ram re tan)) ~))))
|
||||
::
|
||||
$pro
|
||||
%+ frond %pro
|
||||
|
Loading…
Reference in New Issue
Block a user