Skip to content

Commit

Permalink
core, internal: add back web extend methods and missing WriteTransfer…
Browse files Browse the repository at this point in the history
…Logs
  • Loading branch information
CaraWang authored and vicky-sunshine committed Aug 23, 2023
1 parent e238d61 commit 2872722
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
rawdb.WriteTd(blockBatch, block.Hash(), block.NumberU64(), externTd)
rawdb.WriteBlock(blockBatch, block)
rawdb.WriteReceipts(blockBatch, block.Hash(), block.NumberU64(), receipts)
rawdb.WriteTransferLogs(blockBatch, block.Hash(), block.NumberU64(), state.TransferLogs())
rawdb.WritePreimages(blockBatch, state.Preimages())
if err := blockBatch.Write(); err != nil {
log.Crit("Failed to write block into disk", "err", err)
Expand Down
12 changes: 12 additions & 0 deletions internal/web3ext/web3ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,18 @@ web3._extend({
params: 2,
inputFormatter:[web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter],
}),
new web3._extend.Method({
name: 'getTotalDifficulty',
call: 'debug_getTotalDifficulty',
params: 1,
inputFormatter: [null],
}),
new web3._extend.Method({
name: 'getTransferLogs',
call: 'debug_getTransferLogs',
params: 1,
inputFormatter: [null],
}),
new web3._extend.Method({
name: 'getBlockReceipts',
call: 'debug_getBlockReceipts',
Expand Down

0 comments on commit 2872722

Please sign in to comment.