mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-26 08:25:04 +03:00
mall: fix tests
This commit is contained in:
parent
607a2c0ac6
commit
881517c872
@ -63,7 +63,7 @@
|
|||||||
=^ cards state
|
=^ cards state
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%handle-http-request
|
%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]
|
[cards this]
|
||||||
::
|
::
|
||||||
@ -126,6 +126,7 @@
|
|||||||
::
|
::
|
||||||
++ handle-http-request
|
++ handle-http-request
|
||||||
|= [eyre-id=@ta =inbound-request:eyre]
|
|= [eyre-id=@ta =inbound-request:eyre]
|
||||||
|
^- (quip card _state)
|
||||||
?> ?=(^ body.request.inbound-request)
|
?> ?=(^ body.request.inbound-request)
|
||||||
=/ =lsp-req
|
=/ =lsp-req
|
||||||
%- parser
|
%- parser
|
||||||
@ -138,6 +139,7 @@
|
|||||||
==
|
==
|
||||||
=. bufs
|
=. bufs
|
||||||
(~(put by bufs) uri.lsp-req buf)
|
(~(put by bufs) uri.lsp-req buf)
|
||||||
|
:_ state
|
||||||
%+ give-simple-payload:app eyre-id
|
%+ give-simple-payload:app eyre-id
|
||||||
%+ require-authorization:app inbound-request
|
%+ require-authorization:app inbound-request
|
||||||
|= =inbound-request:eyre
|
|= =inbound-request:eyre
|
||||||
|
@ -20,15 +20,17 @@
|
|||||||
--
|
--
|
||||||
=; core
|
=; core
|
||||||
^- imp:spider
|
^- imp:spider
|
||||||
|= =bowl:spider
|
|= [=bowl:spider args=vase]
|
||||||
=/ m (thread ,~)
|
=/ m (thread ,vase)
|
||||||
^- form:m
|
^- form:m
|
||||||
;< ~ bind:m (subscribe-our:threadio /effects %aqua /effect)
|
;< ~ bind:m (watch-our:threadio /effects %aqua /effect)
|
||||||
|
;< ~ bind:m
|
||||||
%- (main-loop:threadio ,state)
|
%- (main-loop:threadio ,state)
|
||||||
:~ |=(=state ~(handle-unix-effect core state))
|
:~ |=(=state ~(handle-unix-effect core state))
|
||||||
|=(=state ~(handle-poke core state))
|
|=(=state ~(handle-poke core state))
|
||||||
pure:(thread ,state)
|
pure:(thread ,state)
|
||||||
==
|
==
|
||||||
|
(pure:m *vase)
|
||||||
::
|
::
|
||||||
|_ =state
|
|_ =state
|
||||||
++ handle-unix-effect
|
++ handle-unix-effect
|
||||||
|
@ -292,7 +292,7 @@
|
|||||||
:: Main
|
:: Main
|
||||||
::
|
::
|
||||||
^- imp:spider
|
^- imp:spider
|
||||||
|= =bowl:spider
|
|= [=bowl:spider args=vase]
|
||||||
=/ m (thread ,vase)
|
=/ m (thread ,vase)
|
||||||
^- form:m
|
^- form:m
|
||||||
;< ~ bind: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 (real-ship ~dev)
|
||||||
;< ~ bind:m (wait-for-output ~bud "hi ~dev successful")
|
;< ~ bind:m (wait-for-output ~bud "hi ~dev successful")
|
||||||
;< ~ bind:m end-azimuth
|
;< ~ 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,7 +428,7 @@
|
|||||||
|= [crash-after=(unit @ud) computation=_*form:(thread (unit result))]
|
|= [crash-after=(unit @ud) computation=_*form:(thread (unit result))]
|
||||||
=/ m (thread ,result)
|
=/ m (thread ,result)
|
||||||
=| try=@ud
|
=| try=@ud
|
||||||
|^ |- ^- form:m
|
|- ^- form:m
|
||||||
=* loop $
|
=* loop $
|
||||||
?: =(crash-after `try)
|
?: =(crash-after `try)
|
||||||
(thread-fail %retry-too-many ~)
|
(thread-fail %retry-too-many ~)
|
||||||
@ -449,7 +449,6 @@
|
|||||||
%+ add
|
%+ add
|
||||||
(mul ~s1 (bex (dec try)))
|
(mul ~s1 (bex (dec try)))
|
||||||
(mul ~s0..0001 (~(rad og eny) 1.000))
|
(mul ~s0..0001 (~(rad og eny) 1.000))
|
||||||
--
|
|
||||||
::
|
::
|
||||||
:: ----
|
:: ----
|
||||||
::
|
::
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
$txt (frond %txt (tape p.sef))
|
$txt (frond %txt (tape p.sef))
|
||||||
$tan (frond %tan (tape (wush 160 p.sef)))
|
$tan (frond %tan (tape (wush 160 p.sef)))
|
||||||
$det (frond %det json:~(grow mar-sole-change +.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
|
$pro
|
||||||
%+ frond %pro
|
%+ frond %pro
|
||||||
|
Loading…
Reference in New Issue
Block a user