From f28b9f7b605b4513e07cbfb60607266c170b3963 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 13 Mar 2018 14:47:21 +0100 Subject: [PATCH] RPC API structures are part of the Ethereum lib proper for now. --- lib/ethereum.hoon | 6 +++--- sur/ethereum.hoon | 42 +++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/ethereum.hoon b/lib/ethereum.hoon index cf53c0c3e1..9ba7c26060 100644 --- a/lib/ethereum.hoon +++ b/lib/ethereum.hoon @@ -28,7 +28,7 @@ :: ++ request-to-json =, enjs:format - |= req=request:jrpc-api + |= req=request ^- json %- pairs =; cal=[m=@t p=(list json)] @@ -49,7 +49,7 @@ == :: ++ eth-call-to-json - |= cal=call:jrpc-api + |= cal=call ^- json :- %o %- ~(gas by *(map @t json)) =- (murn - same) @@ -73,7 +73,7 @@ == :: ++ default-block-to-json - |= dob=default-block:jrpc-api + |= dob=default-block ^- json ?- -.dob %quantity n+(crip ((d-co:co 0) n.dob)) diff --git a/sur/ethereum.hoon b/sur/ethereum.hoon index 63e2cd5404..edf770f4e1 100644 --- a/sur/ethereum.hoon +++ b/sur/ethereum.hoon @@ -15,28 +15,24 @@ == :: :: ethereum json rpc api -::TODO make single ++eth-rpc core, or split off into separate sur+lib :: -++ jrpc-api - |% - ++ request - $% [%eth-block-number ~] - [%eth-call cal=call deb=default-block] - [%eth-estimate-gas cal=call deb=default-block] - == - :: - ++ call - $: from=(unit @i) - to=@i - gas=(unit @ud) - gas-price=(unit @ud) - value=(unit @ud) - data=tape - == - :: - ++ default-block - $% [%quantity n=@ud] - [%label l=?(%earliest %latest %pending)] - == - -- +++ request + $% [%eth-block-number ~] + [%eth-call cal=call deb=default-block] + [%eth-estimate-gas cal=call deb=default-block] + == +:: +++ call + $: from=(unit @i) + to=@i + gas=(unit @ud) + gas-price=(unit @ud) + value=(unit @ud) + data=tape + == +:: +++ default-block + $% [%quantity n=@ud] + [%label l=?(%earliest %latest %pending)] + == --