From 749f8e93f969a7436f734e4b5d318fe4afe54683 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Wed, 9 Jun 2021 15:59:04 +0200 Subject: [PATCH] naive: add when %next-batch to rpc-api --- pkg/arvo/app/azimuth-rpc.hoon | 7 +++++++ pkg/arvo/lib/azimuth-rpc.hoon | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/pkg/arvo/app/azimuth-rpc.hoon b/pkg/arvo/app/azimuth-rpc.hoon index 5809a78aa..4cac794db 100644 --- a/pkg/arvo/app/azimuth-rpc.hoon +++ b/pkg/arvo/app/azimuth-rpc.hoon @@ -143,6 +143,7 @@ %pending-by-ship [~ (ship:pending id +.params ship:pending:scry)] %pending-by-address [~ (addr:pending id +.params addr:pending:scry)] %status [~ (status id +.params tx-status:scry)] + %next-batch [~ (next-batch id +.params next-batch:scry)] :: %history [~ (history id +.params all:history:scry)] == :: @@ -222,6 +223,12 @@ (~(scry agentio bowl) %aggregator /tx/(scot %ux keccak)/status/noun) == :: + ++ next-batch + .^ time + %gx + (~(scry agentio bowl) %aggregator /next-batch/noun) + == + :: ++ nonce |= [=ship =address:naive] :: FIXME: use proper type from aggregator/index diff --git a/pkg/arvo/lib/azimuth-rpc.hoon b/pkg/arvo/lib/azimuth-rpc.hoon index bed670649..08df94408 100644 --- a/pkg/arvo/lib/azimuth-rpc.hoon +++ b/pkg/arvo/lib/azimuth-rpc.hoon @@ -482,6 +482,13 @@ ~(parse error:json-rpc id) [%result id (tx-status:to-json (scry u.keccak))] :: +++ next-batch + |= [id=@t params=(map @t json) when=time] + ^- response:rpc + ?. =((lent ~(tap by params)) 0) + ~(params error:json-rpc id) + [%result id (time:enjs:format when)] +:: :: ++ history :: |= $: id=@t :: params=(map @t json)