Better change message structure.

No longer need to send separate messages for multiple non-simultaneous changes.
This commit is contained in:
Fang 2018-05-22 19:32:22 +02:00
parent 1c7c61c9bb
commit 72a680bfe0
2 changed files with 16 additions and 10 deletions

View File

@ -1980,14 +1980,15 @@
%+ rpc-hiss w
a+(turn (flop r) request-to-json)
^- (list move)
%- zing
%+ turn
%+ sort ~(tap by changes)
:: sort by block number, then by event log number
|= [[[b1=@ud l1=@ud] *] [[b2=@ud l2=@ud] *]]
?.(=(b1 b2) (lth b1 b2) (lth l1 l2))
|= [cause=[@ud @ud] dis=(list diff-constitution)]
(update-to-all %diff cause (flop dis))
?: =(0 ~(wyt by changes)) ~
%+ update-to-all %difs
%+ sort ~(tap by changes)
:: sort by block number, then by event log number,
::TODO then by diff priority.
|= [[[b1=@ud l1=@ud] *] [[b2=@ud l2=@ud] *]]
?. =(b1 b2) (lth b1 b2)
?. =(l1 l2) (lth l1 l2)
&
::
++ put-move
|= mov=move
@ -2143,7 +2144,12 @@
^+ +>
?- -.upd
%full (assume +.upd)
%diff (accept +.upd)
::
%difs
|-
?~ dis.upd +>.^$
=. +>.^$ (accept i.dis.upd)
$(dis.upd t.dis.upd)
==
::
++ assume

View File

@ -262,7 +262,7 @@
::
++ update
$% [%full ships=fleet dns=dnses heard=events]
[%diff [block=@ud log=@ud] dis=(list diff-constitution)]
[%difs dis=(list (pair [block=@ud log=@ud] (list diff-constitution)))]
==
::
++ diff-constitution