package Ġme . uport . sdk . jsonrpc Ċ Ċ import Ġassert k . all Ċ import Ġassert k . assertThat Ċ import Ġassert k . assertions . has Message Ċ import Ġassert k . assertions . isEqualTo Ċ import Ġassert k . assertions . is Failure Ċ import Ġassert k . assertions . isInstanceOf Ċ import Ġio . mock k . Capt uring Slot Ċ import Ġio . mock k . co Every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . spy k Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġme . uport . sdk . core . HttpClient Ċ import Ġme . uport . sdk . core . Networks Ċ import Ġme . uport . sdk . core . hex To BigInteger Ċ import Ġme . uport . sdk . jsonrpc . model . Json Rpc Log Item Ċ import Ġme . uport . sdk . jsonrpc . model . Transaction Information Ċ import Ġme . uport . sdk . jsonrpc . model . Transaction Receipt Ċ import Ġme . uport . sdk . jsonrpc . model . exceptions . Json Rpc Exception Ċ import Ġme . uport . sdk . jsonrpc . model . exceptions . Json Rpc InvalidArgumentException Ċ import Ġme . uport . sdk . jsonrpc . model . exceptions . Transaction NotFoundException Ċ import Ġme . uport . sdk . test helpers . co Assert Ċ import Ġorg . junit . Test Ċ import Ġjava . math . BigInteger Ċ Ċ class ĠJson RP CT est Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġsend Ġraw Ġtransaction `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsigned Tx Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 xf 8 6 4 0 2 8 5 0 4 a 8 1 7 c 8 0 0 8 2 5 2 0 8 9 4 1 fcf 8 ff 7 8 ac 5 1 1 7 d 9 c 9 9 b 8 3 0 c 7 4 b 6 6 6 8 d 6 ac 3 2 2 9 0 1 8 0 1 ba 0 0 7 b 8 2 9 ef 5 2 3 8 3 ef 8 9 8 f 9 8 ee 5 3 1 a 2 6 ed 0 8 e 7 8 5 4 6 7 4 6 c fae 8 ed 4 1 2 f 3 2 c 9 1 8 3 ac daa 0 2 d adb 1 9 3 9 bef 2 ce 2 1 fd 0 e 6 be 8 3 b 0 9 2 4 7 2 0 4 a 1 b 1 5 3 9 5 ed 7 c 0 e 8 5 7 1 e 8 9 1 d 7 6 0 8 b 1 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC (" localhost ", ĠhttpClient )) ĊĠĠĠĠĠĠĠ Ġval Ġparam Slot Ġ= ĠCapt uring Slot < String >() ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġcapture ( param Slot )) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 xeb 8 daa 5 cb 1 7 c 5 7 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġrpc . send Raw Transaction ( signed Tx ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( param Slot . captured ). isEqualTo (""" {" method ":" eth _ send Raw Transaction "," params ":[" 0 xf 8 6 4 0 2 8 5 0 4 a 8 1 7 c 8 0 0 8 2 5 2 0 8 9 4 1 fcf 8 ff 7 8 ac 5 1 1 7 d 9 c 9 9 b 8 3 0 c 7 4 b 6 6 6 8 d 6 ac 3 2 2 9 0 1 8 0 1 ba 0 0 7 b 8 2 9 ef 5 2 3 8 3 ef 8 9 8 f 9 8 ee 5 3 1 a 2 6 ed 0 8 e 7 8 5 4 6 7 4 6 c fae 8 ed 4 1 2 f 3 2 c 9 1 8 3 ac daa 0 2 d adb 1 9 3 9 bef 2 ce 2 1 fd 0 e 6 be 8 3 b 0 9 2 4 7 2 0 4 a 1 b 1 5 3 9 5 ed 7 c 0 e 8 5 7 1 e 8 9 1 d 7 6 0 8 b 1 "]," id ": 1 ," jsonrpc ":" 2 . 0 "} """) ĊĠĠĠĠĠĠĠ ĠassertThat ( tx Hash ). isEqualTo (" 0 xeb 8 daa 5 cb 1 7 c 5 7 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġparse Ġerror Ġresponse Ġfor Ġtransaction `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsigned Tx Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 xf 8 6 4 0 1 8 5 0 4 a 8 1 7 c 8 0 0 8 2 5 2 0 8 9 4 1 fcf 8 ff 7 8 ac 5 1 1 7 d 9 c 9 9 b 8 3 0 c 7 4 b 6 6 6 8 d 6 ac 3 2 2 9 0 1 8 0 1 ba 0 2 f 9 8 4 b 0 6 7 6 d 5 3 6 1 ca 2 b 4 4 af 8 5 b 5 c 8 e 6 aa 9 3 6 8 5 4 4 6 f 1 d 1 cd 6 2 7 5 8 4 e 5 4 b 9 d 5 7 7 dea 0 1 5 5 ebf af 5 a 3 8 6 0 c 5 c 2 c 3 0 dd 4 fe 3 a 0 1 2 3 a 0 0 e 7 f 3 f 5 2 6 5 9 f 1 ae 7 8 6 8 5 6 2 2 b 4 6 0 1 cb " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC (" localhost ", ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," error ":{" code ": - 3 2 0 0 0 ," message ":" nonce Ġtoo Ġlow "}} """ ĊĊĠĠĠĠĠĠĠ Ġco Assert Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrpc . send Raw Transaction ( signed Tx ) ĊĠĠĠĠĠĠĠ Ġ}. is Failure (). all Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis InstanceOf ( Json Rpc Exception :: class ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhas Message (" nonce Ġtoo Ġlow ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġtransaction Ġinformation `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġ" 0 xeb 8 daa 5 cb 1 7 c 5 7 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":{" block Hash ":" 0 x 8 0 1 5 0 ea ebb 8 8 8 a 6 e 0 5 aca 7 2 5 5 3 f 1 5 1 9 0 c 9 cc 5 0 7 e 1 5 b 0 9 9 5 3 9 7 f 0 1 b 2 8 d 4 1 a 1 8 c 2 "," block Number ":" 0 x 4 d 4 bef "," from ":" 0 x 1 fcf 8 ff 7 8 ac 5 1 1 7 d 9 c 9 9 b 8 3 0 c 7 4 b 6 6 6 8 d 6 ac 3 2 2 9 "," gas ":" 0 x 5 2 0 8 "," gas Price ":" 0 x 4 a 8 1 7 c 8 0 0 "," hash ":" 0 xeb 8 daa 5 cb 1 7 c 5 7 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 "," input ":" 0 x "," nonce ":" 0 x 2 "," r ":" 0 x 7 b 8 2 9 ef 5 2 3 8 3 ef 8 9 8 f 9 8 ee 5 3 1 a 2 6 ed 0 8 e 7 8 5 4 6 7 4 6 c fae 8 ed 4 1 2 f 3 2 c 9 1 8 3 ac da "," s ":" 0 x 2 d adb 1 9 3 9 bef 2 ce 2 1 fd 0 e 6 be 8 3 b 0 9 2 4 7 2 0 4 a 1 b 1 5 3 9 5 ed 7 c 0 e 8 5 7 1 e 8 9 1 d 7 6 0 8 b 1 "," to ":" 0 x 1 fcf 8 ff 7 8 ac 5 1 1 7 d 9 c 9 9 b 8 3 0 c 7 4 b 6 6 6 8 d 6 ac 3 2 2 9 "," transaction Index ":" 0 x 1 "," v ":" 0 x 1 b "," value ":" 0 x 1 "}} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġtx Info Ġ= Ġrpc . getTransaction By Hash ( tx Hash ) ĊĊĠĠĠĠĠĠĠ Ġval Ġreference Tx Ġ= ĠTransaction Information ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtx Hash Ġ= Ġ" 0 xeb 8 daa 5 cb 1 7 c 5 7 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnonce Ġ= ĠBigInteger (" 2 "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Hash Ġ= Ġ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 e 8 5 7 1 e 8 9 1 d 7 6 0 8 b 1 ". hex To BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġv Ġ= Ġ 2 7 . to BigInteger () ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( tx Info ). isEqualTo ( reference Tx ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` throws ĠTransaction NotFoundException Ġfor Ġunknown Ġtx `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġ" 0 xaaaaaaaa aaaa aa 1 2 5 6 ec 9 3 4 7 6 3 8 d 8 d 7 ea 8 5 4 7 4 8 cb de 3 5 5 f 6 6 bca 4 c 9 f 1 9 f 2 cd 4 7 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ": null } """ ĊĊĠĠĠĠĠĠĠ Ġco Assert Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrpc . getTransaction By Hash ( tx Hash ) ĊĠĠĠĠĠĠĠ Ġ}. is Failure (). all Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis InstanceOf ( Transaction NotFoundException :: class ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` throws ĠJson Rpc Exception Ġfor Ġbad Ġtx Ġhash `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġ" 0 x 1 FC f 8 ff 7 8 aC 5 1 1 7 d 9 c 9 9 B 8 3 0 c 7 4 b 6 6 6 8 D 6 AC 3 2 2 9 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," error ":{" code ": - 3 2 6 0 2 ," message ":" invalid Ġargument Ġ 0 : Ġhex Ġstring Ġhas Ġlength Ġ 4 0 , Ġwant Ġ 6 4 Ġfor Ġcommon . Hash "}} """ ĊĊĠĠĠĠĠĠĠ Ġco Assert Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrpc . getTransaction By Hash ( tx Hash ) ĊĠĠĠĠĠĠĠ Ġ}. is Failure (). all Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis InstanceOf ( Json Rpc InvalidArgumentException :: class ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġsimple Ġtransaction Ġreceipt `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġ" 0 x 5 df 3 d 9 c 9 9 5 9 6 9 9 1 7 c 5 bc 5 9 3 4 1 7 3 2 c 0 3 2 c 9 d 7 f 6 e 1 1 1 8 0 0 3 cfd 2 cd 4 3 9 5 1 3 a 8 1 d 0 6 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":{" block Hash ":" 0 xdb 2 c 2 6 2 2 4 3 6 5 0 5 9 d 3 b 9 5 dd 3 5 7 2 c 7 dd 7 bbe 7 0 4 3 6 bc 0 0 8 aa 4 0 7 4 bf 3 e 4 2 1 4 3 7 a 1 2 2 "," block Number ":" 0 x 4 4 dd 5 c "," contract Address ": null ," cumulative Gas Used ":" 0 xcf ecc "," from ":" 0 xcf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed "," gas Used ":" 0 x 1 1 1 7 0 "," logs ":[ ]," logs B loom ":" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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ĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġtransaction Ġreceipt Ġwith Ġlogs `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtx Hash Ġ= Ġ" 0 x 1 6 f 8 4 7 d 9 9 c 4 7 b 9 0 f 3 4 c 4 9 4 5 8 8 a 3 1 8 7 4 dc 2 da 0 8 1 b 0 0 ff 3 4 9 6 8 a 8 6 d 6 f 7 d 1 5 8 6 3 af " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":{" block Hash ":" 0 xa 2 3 7 5 9 8 ed 0 2 6 c 2 8 7 2 ed 8 2 7 2 a 0 2 d 9 fe 8 1 7 4 a 6 4 b 5 bef 9 2 8 6 cb 3 7 1 9 0 a 8 5 4 fec 3 7 0 6 "," block Number ":" 0 x 4 4 dd 7 f "," contract Address ": null ," cumulative Gas Used ":" 0 x 1 b 8 f 0 c "," from ":" 0 xcf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed "," gas Used ":" 0 x 1 1 3 7 a "," logs ":[{" address ":" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b "," block Hash ":" 0 xa 2 3 7 5 9 8 ed 0 2 6 c 2 8 7 2 ed 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "," status ":" 0 x 1 "," to ":" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b "," transaction Hash ":" 0 x 1 6 f 8 4 7 d 9 9 c 4 7 b 9 0 f 3 4 c 4 9 4 5 8 8 a 3 1 8 7 4 dc 2 da 0 8 1 b 0 0 ff 3 4 9 6 8 a 8 6 d 6 f 7 d 1 5 8 6 3 af "," transaction Index ":" 0 x 8 "}} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġreceipt Ġ= Ġrpc . getTransaction Receipt ( tx Hash ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( receipt ). isEqualTo ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTransaction Receipt ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Hash Ġ= Ġ" 0 x 1 6 f 8 4 7 d 9 9 c 4 7 b 9 0 f 3 4 c 4 9 4 5 8 8 a 3 1 8 7 4 dc 2 da 0 8 1 b 0 0 ff 3 4 9 6 8 a 8 6 d 6 f 7 d 1 5 8 6 3 af ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Index Ġ= Ġ" 0 x 8 ". hex To BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġblock Number Ġ= Ġ" 0 x 4 4 dd 7 f ". hex To BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġblock Hash Ġ= Ġ" 0 xa 2 3 7 5 9 8 ed 0 2 6 c 2 8 7 2 ed 8 2 7 2 a 0 2 d 9 fe 8 1 7 4 a 6 4 b 5 bef 9 2 8 6 cb 3 7 1 9 0 a 8 5 4 fec 3 7 0 6 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcumulative Gas Used Ġ= Ġ" 0 x 1 b 8 f 0 c ". hex To BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġgas Used Ġ= Ġ 7 0 5 2 2 L . to BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontract Address Ġ= Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfrom Ġ= Ġ" 0 xcf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġto Ġ= Ġ" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlogs Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠJson Rpc Log Item ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Ġ= Ġ" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtopics Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 x 5 a 5 0 8 4 3 3 9 5 3 6 bc ab 6 5 f 2 0 7 9 9 fcc 5 8 7 2 4 5 8 8 1 4 5 ca 0 5 4 bd 2 be 6 2 6 1 7 4 b 2 7 ba 1 5 6 f 7 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cf 0 3 dd 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url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":{" block Hash ":" 0 x 7 b 6 b 0 4 db 4 7 9 a 4 9 8 a 7 6 0 8 a 1 5 7 1 e 3 9 d 2 1 a 4 3 0 0 3 e 7 7 c 4 fac 0 8 8 5 aac bc 7 c 4 1 c 6 0 ff 3 "," block Number ":" 0 x 2 d 9 8 c 5 "," contract Address ":" 0 x 7 4 f 0 6 a 9 7 3 0 4 6 9 9 9 fcd 3 9 0 5 4 6 1 baf 8 cb ce 5 9 6 6 6 8 f "," cumulative Gas Used ":" 0 x 6 8 1 4 a "," from ":" 0 xa 4 cade 6 ec bed 8 f 7 5 f 6 fd 5 0 b 8 be 9 2 feb 1 4 4 4 0 0 cc 4 "," gas Used ":" 0 x 4 9 b 4 4 "," logs ":[ ]," logs B loom ":" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "," status ":" 0 x 1 "," to ": null ," transaction Hash ":" 0 x 2 eb 6 cd 8 6 9 7 7 d 3 2 df 7 6 9 f 5 2 ad 8 9 e 5 7 1 d 5 8 da ab 7 2 3 a 6 2 abd 9 c 2 fe 6 6 d 2 8 0 f 3 9 1 4 8 c "," transaction Index ":" 0 x 3 "}} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġreceipt Ġ= Ġrpc . getTransaction Receipt ( tx Hash ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( receipt ). isEqualTo ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTransaction Receipt ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Hash Ġ= Ġ" 0 x 2 eb 6 cd 8 6 9 7 7 d 3 2 df 7 6 9 f 5 2 ad 8 9 e 5 7 1 d 5 8 da ab 7 2 3 a 6 2 abd 9 c 2 fe 6 6 d 2 8 0 f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ĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġaccount Ġbalance `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġaddress Ġ= Ġ" 0 xC dc 5 8 5 8 2 3 A ac 3 4 f 2 9 e E 0 4 e 3 D 3 3 E 5 2 7 5 4 1 5 8 2 1 c 7 6 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 x 1 8 2 a 0 7 6 0 fd 2 0 ca 6 "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġwe i Balance Ġ= Ġrpc . get Account Balance ( address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( wei Balance ). isEqualTo ( BigInteger (" 1 0 8 8 2 5 7 6 9 9 4 2 3 2 2 3 4 2 ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġtransaction Ġcount `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġaddress Ġ= Ġ" 0 x 3 5 4 DB 1 Be 7 e 5 9 c 8 2 7 4 fbb c 1 8 3 9 3 9 B bec F 1 9 9 1 b 5 2 1 " ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 x 5 "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġtx Count Ġ= Ġrpc . getTransaction Count ( address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( tx Count ). isEqualTo ( BigInteger (" 5 ")) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġa Ġgas Ġprice `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 x 3 b 9 aca 0 0 "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġgas Price Ġ= Ġrpc . get Gas Price () ĊĠĠĠĠĠĠĠ ĠassertThat ( gas Price ). isEqualTo ( 1 _ 0 0 0 _ 0 0 0 _ 0 0 0 L . to BigInteger ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Ġlogs `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url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 0 0 0 0 0 0 0 0 cf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed "]," transaction Hash ":" 0 x 1 6 f 8 4 7 d 9 9 c 4 7 b 9 0 f 3 4 c 4 9 4 5 8 8 a 3 1 8 7 4 dc 2 da 0 8 1 b 0 0 ff 3 4 9 6 8 a 8 6 d 6 f 7 d 1 5 8 6 3 af "," transaction Index ":" 0 x 8 "}]} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġlogs Ġ= Ġrpc . get Logs ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Ġ= Ġ" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtopics Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom Block Ġ= Ġ 4 5 1 3 1 5 1 L . to BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġto Block Ġ= Ġ 4 5 1 3 1 5 1 L . to BigInteger () ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( logs . size ). isEqualTo ( 1 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( logs [ 0 ]). isEqualTo ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJson Rpc Log Item ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġblock Number Ġ= Ġ 4 5 1 3 1 5 1 L . to BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Hash Ġ= Ġ" 0 x 1 6 f 8 4 7 d 9 9 c 4 7 b 9 0 f 3 4 c 4 9 4 5 8 8 a 3 1 8 7 4 dc 2 da 0 8 1 b 0 0 ff 3 4 9 6 8 a 8 6 d 6 f 7 d 1 5 8 6 3 af ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Index Ġ= Ġ 8 . to BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġblock Hash Ġ= Ġ" 0 xa 2 3 7 5 9 8 ed 0 2 6 c 2 8 7 2 ed 8 2 7 2 a 0 2 d 9 fe 8 1 7 4 a 6 4 b 5 bef 9 2 8 6 cb 3 7 1 9 0 a 8 5 4 fec 3 7 0 6 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlog Index Ġ= Ġ 8 . to BigInteger (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġremoved Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġexecute Ġan Ġeth _ call `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 dd 7 f "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġrpc . eth Call ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Ġ= Ġ" 0 xd ca 7 ef 0 3 e 9 8 e 0 dc 2 b 8 5 5 be 6 4 7 c 3 9 abe 9 8 4 fcf 2 1 b ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Ġ= Ġ" 0 xf 9 6 d 0 f 9 f 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cf 0 3 dd 0 a 8 9 4 ef 7 9 cb 5 b 6 0 1 a 4 3 c 4 b 2 5 e 3 ae 4 c 6 7 ed " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result ). isEqualTo (" 0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 dd 7 f ") ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġget Chain ĠID `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠhttpClient Ġ= Ġmock k < HttpClient >() ĊĠĠĠĠĠĠĠ Ġval Ġrpc Ġ= Ġspy k ( Json RPC ( Networks . rin ke by . rpc Url , ĠhttpClient )) ĊĊĠĠĠĠĠĠĠ Ġco Every Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠhttpClient . url Post ( any (), Ġany ()) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns Ġ""" {" jsonrpc ":" 2 . 0 "," id ": 1 ," result ":" 0 x 4 "} """ ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġrpc . get Chain Id () ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result ). isEqualTo ( 4 . to BigInteger ()) ĊĠĠĠ Ġ} Ċ } Ċ