Coverage Summary for Class: Web3EthModule (co.rsk.rpc)
Class |
Class, %
|
Method, %
|
Line, %
|
Web3EthModule |
100%
(1/1)
|
55.6%
(5/9)
|
55.6%
(5/9)
|
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2018 RSK Labs Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 package co.rsk.rpc;
20
21 import co.rsk.rpc.modules.eth.EthModule;
22 import org.ethereum.rpc.Web3;
23 import org.ethereum.rpc.dto.BlockResultDTO;
24 import org.ethereum.rpc.dto.CompilationResultDTO;
25 import org.ethereum.rpc.dto.TransactionReceiptDTO;
26 import org.ethereum.rpc.dto.TransactionResultDTO;
27
28 import java.math.BigInteger;
29 import java.util.Map;
30
31 public interface Web3EthModule {
32 default String[] eth_accounts() {
33 return getEthModule().accounts();
34 }
35
36 default String eth_sign(String addr, String data) {
37 return getEthModule().sign(addr, data);
38 }
39
40 default String eth_call(Web3.CallArguments args, String bnOrId) {
41 return getEthModule().call(args, bnOrId);
42 }
43
44 default String eth_estimateGas(Web3.CallArguments args) {
45 return getEthModule().estimateGas(args);
46 }
47
48
49
50 default Map<String, Object> eth_bridgeState() throws Exception {
51 return getEthModule().bridgeState();
52 }
53
54 default String eth_chainId() {
55 return getEthModule().chainId();
56 }
57
58 EthModule getEthModule();
59
60 String eth_protocolVersion();
61
62 Object eth_syncing();
63
64 String eth_coinbase();
65
66 boolean eth_mining();
67
68 BigInteger eth_hashrate();
69
70 String eth_gasPrice();
71
72 String eth_blockNumber();
73
74 String eth_call(Web3.CallArguments args, Map<String, String> blockRef) throws Exception;
75
76 String eth_getBalance(String address, String block) throws Exception;
77
78 String eth_getBalance(String address) throws Exception;
79
80 String eth_getBalance(String address, Map<String, String> blockRef) throws Exception;
81
82 String eth_getStorageAt(String address, String storageIdx, Map<String, String> blockRef) throws Exception;
83
84 String eth_getStorageAt(String address, String storageIdx, String blockId) throws Exception;
85
86 String eth_getTransactionCount(String address, Map<String, String> blockRef) throws Exception ;
87
88 String eth_getTransactionCount(String address, String blockId) throws Exception ;
89
90 String eth_getBlockTransactionCountByHash(String blockHash)throws Exception;
91
92 String eth_getBlockTransactionCountByNumber(String bnOrId)throws Exception;
93
94 String eth_getUncleCountByBlockHash(String blockHash)throws Exception;
95
96 String eth_getUncleCountByBlockNumber(String bnOrId)throws Exception;
97
98 default String eth_getCode(String address, String blockId) {
99 return getEthModule().getCode(address, blockId);
100 }
101 String eth_getCode(String address, Map<String, String> blockRef) throws Exception;
102
103 default String eth_sendRawTransaction(String rawData) {
104 return getEthModule().sendRawTransaction(rawData);
105 }
106
107 default String eth_sendTransaction(Web3.CallArguments args) {
108 return getEthModule().sendTransaction(args);
109 }
110
111 BlockResultDTO eth_getBlockByHash(String blockHash, Boolean fullTransactionObjects) throws Exception;
112
113 BlockResultDTO eth_getBlockByNumber(String bnOrId, Boolean fullTransactionObjects) throws Exception;
114
115 TransactionResultDTO eth_getTransactionByHash(String transactionHash) throws Exception;
116
117 TransactionResultDTO eth_getTransactionByBlockHashAndIndex(String blockHash, String index) throws Exception;
118
119 TransactionResultDTO eth_getTransactionByBlockNumberAndIndex(String bnOrId, String index) throws Exception;
120
121 TransactionReceiptDTO eth_getTransactionReceipt(String transactionHash) throws Exception;
122
123 BlockResultDTO eth_getUncleByBlockHashAndIndex(String blockHash, String uncleIdx) throws Exception;
124
125 BlockResultDTO eth_getUncleByBlockNumberAndIndex(String blockId, String uncleIdx) throws Exception;
126
127 String[] eth_getCompilers();
128
129 Map<String, CompilationResultDTO> eth_compileLLL(String contract);
130
131 Map<String, CompilationResultDTO> eth_compileSerpent(String contract);
132
133 Map<String, CompilationResultDTO> eth_compileSolidity(String contract);
134
135 String eth_newFilter(Web3.FilterRequest fr) throws Exception;
136
137 String eth_newBlockFilter();
138
139 String eth_newPendingTransactionFilter();
140
141 boolean eth_uninstallFilter(String id);
142
143 Object[] eth_getFilterChanges(String id);
144
145 Object[] eth_getFilterLogs(String id);
146
147 Object[] eth_getLogs(Web3.FilterRequest fr) throws Exception;
148
149 BigInteger eth_netHashrate();
150
151 boolean eth_submitWork(String nonce, String header, String mince);
152
153 boolean eth_submitHashrate(String hashrate, String id);
154 }