aboutsummaryrefslogtreecommitdiffstats
path: root/internal/jsre/deps
diff options
context:
space:
mode:
authorjohnliu-dexon <42129254+johnliu-dexon@users.noreply.github.com>2018-11-27 17:13:22 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:19 +0800
commit54888db8d4e8b17d37509dbb1d8a1513cad3bd06 (patch)
tree7ae2c2bceaa3d95849c27661bae5ba34fa4a7cf3 /internal/jsre/deps
parent29619b5bd6c61ddf763ac7f29dd38ad30b35d459 (diff)
downloadgo-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar.gz
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar.bz2
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar.lz
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar.xz
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.tar.zst
go-tangerine-54888db8d4e8b17d37509dbb1d8a1513cad3bd06.zip
internal/ethapi: add getBlockReceiptsByHash (#56)
* dex: add getBlockReceiptsByHash add rpc method for performance acceleration * Update internal/ethapi/api.go Co-Authored-By: johnliu-dexon <42129254+johnliu-dexon@users.noreply.github.com>
Diffstat (limited to 'internal/jsre/deps')
-rw-r--r--internal/jsre/deps/web3.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/jsre/deps/web3.js b/internal/jsre/deps/web3.js
index 7848393dd..333c32b48 100644
--- a/internal/jsre/deps/web3.js
+++ b/internal/jsre/deps/web3.js
@@ -3811,6 +3811,16 @@ var outputTransactionReceiptFormatter = function (receipt){
return receipt;
};
+var outputTransactionReceiptsFormatter = function (receipts){
+ if(utils.isArray(receipts)) {
+ receipts = receipts.map(function(receipt){
+ return outputTransactionReceiptFormatter(receipt);
+ });
+ }
+
+ return receipts;
+};
+
/**
* Formats the output of a block to its proper values
*
@@ -3957,6 +3967,7 @@ module.exports = {
outputBigNumberFormatter: outputBigNumberFormatter,
outputTransactionFormatter: outputTransactionFormatter,
outputTransactionReceiptFormatter: outputTransactionReceiptFormatter,
+ outputTransactionReceiptsFormatter: outputTransactionReceiptsFormatter,
outputBlockFormatter: outputBlockFormatter,
outputLogFormatter: outputLogFormatter,
outputPostFormatter: outputPostFormatter,
@@ -5289,6 +5300,14 @@ var methods = function () {
inputFormatter: [formatters.inputAddressFormatter, formatters.inputDefaultBlockNumberFormatter]
});
+ var getBlockReceiptsByHash = new Method({
+ name: 'getBlockReceiptsByHash',
+ call: 'eth_getBlockReceiptsByHash',
+ params: 1,
+ inputFormatter: [formatters.inputBlockNumberFormatter],
+ outputFormatter: formatters.outputTransactionReceiptsFormatter,
+ });
+
var getBlock = new Method({
name: 'getBlock',
call: blockCall,
@@ -5435,6 +5454,7 @@ var methods = function () {
getBalance,
getStorageAt,
getCode,
+ getBlockReceiptsByHash,
getBlock,
getUncle,
getCompilers,