mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-10 10:05:09 +03:00
azimuth+roller: add get-naive/predicted-state
This commit is contained in:
parent
96789d1aab
commit
7e0c99c980
@ -146,8 +146,9 @@
|
||||
[~ ~(parse error:json-rpc id)]
|
||||
=/ method=@tas (enkebab method)
|
||||
?+ method [~ ~(method error:json-rpc id)]
|
||||
%get-point `(get-point id +.params point:scry)
|
||||
%get-dns `(get-dns id +.params dns:scry)
|
||||
%get-point `(get-point id +.params point:scry)
|
||||
%get-dns `(get-dns id +.params dns:scry)
|
||||
%get-naive-state `(get-naive id +.params naive-state:scry)
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -165,5 +166,11 @@
|
||||
%gx
|
||||
(~(scry agentio bowl) %azimuth /dns/noun)
|
||||
==
|
||||
::
|
||||
++ naive-state
|
||||
.^ ^state:naive
|
||||
%gx
|
||||
(~(scry agentio bowl) %azimuth /nas/noun)
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -142,6 +142,7 @@
|
||||
[%x %own ~] ``noun+!>(own.state)
|
||||
[%x %point @ ~] ``noun+(point i.t.t.path)
|
||||
==
|
||||
::
|
||||
++ point
|
||||
|= wat=@t
|
||||
^- vase
|
||||
|
@ -167,6 +167,7 @@
|
||||
%get-history `(history id +.params addr:history:scry)
|
||||
%get-roller-config `(get-config id +.params config:scry)
|
||||
%hash-transaction `(hash-transaction id +.params chain-id:scry)
|
||||
%get-predicted-state `(get-naive id +.params predicted:scry)
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -306,5 +307,11 @@
|
||||
%roller
|
||||
/chain-id/noun
|
||||
==
|
||||
::
|
||||
++ predicted
|
||||
.^ ^state:naive
|
||||
%gx
|
||||
(~(scry agentio bowl) %roller /predicted/noun)
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -164,6 +164,7 @@
|
||||
:: /x/manager -> %noun (list ship)
|
||||
:: /x/voting -> %noun (list ship)
|
||||
:: /x/spawning -> %noun (list ship)
|
||||
:: /x/predicted -> %noun state:naive
|
||||
::
|
||||
++ on-peek
|
||||
|= =path
|
||||
@ -187,6 +188,7 @@
|
||||
[%x %manager @ ~] (points-proxy %manage i.t.t.path)
|
||||
[%x %voting @ ~] (points-proxy %vote i.t.t.path)
|
||||
[%x %spawning @ ~] (points-proxy %spawn i.t.t.path)
|
||||
[%x %predicted ~] ``noun+!>(pre)
|
||||
==
|
||||
::
|
||||
++ pending-by
|
||||
|
@ -361,6 +361,29 @@
|
||||
|= [p=@ q=@]
|
||||
^- json
|
||||
s+(crip ['0' 'x' ((x-co:co (mul 2 p)) q)])
|
||||
::
|
||||
++ naive-state
|
||||
|= =^state:naive
|
||||
^- json
|
||||
|^
|
||||
%- pairs
|
||||
:~ ['points' (points (tap:orm:naive points.state))]
|
||||
['operators' (operators operators.state)]
|
||||
['dns' a+(turn dns.state (cork same (lead %s)))]
|
||||
==
|
||||
::
|
||||
++ operators
|
||||
|= =operators:naive
|
||||
^- json
|
||||
:- %a
|
||||
%+ turn ~(tap by operators)
|
||||
|= [op=@ux addrs=(set @ux)]
|
||||
^- json
|
||||
%- pairs
|
||||
:~ ['operator' (hex 20 op)]
|
||||
['addresses' a+(turn ~(tap in addrs) (cury hex 20))]
|
||||
==
|
||||
--
|
||||
--
|
||||
::
|
||||
++ to-hex
|
||||
@ -567,4 +590,11 @@
|
||||
:+ %result id
|
||||
=- (hex:to-json 32 (hash-tx:lib p q))
|
||||
(unsigned-tx:lib chain-id u.nonce (gen-tx-octs:lib u.tx))
|
||||
::
|
||||
++ get-naive
|
||||
|= [id=@t params=(map @t json) =^state:naive]
|
||||
^- response:rpc
|
||||
?. =((lent ~(tap by params)) 0)
|
||||
~(params error:json-rpc id)
|
||||
[%result id (naive-state:to-json state)]
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user