Skip to content

Commit

Permalink
Merge branch 'master' into upgrade/go-ethereum/v1.9.19-2021301114425
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardolyn committed Mar 10, 2021
2 parents 512cd42 + e2397c2 commit 1b3a6b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber, typ *string) (stat
return publicState.RawDump(false, false, true), nil
}

func (api *PublicDebugAPI) PrivateStateRoot(ctx context.Context, blockNr rpc.BlockNumber) (common.Hash, error) {
_, privateState, err := api.getStateDbsFromBlockNumber(blockNr)
if err != nil {
return common.Hash{}, err
}
return privateState.IntermediateRoot(true), nil
}

// Quorum
// DumpAddress retrieves the state of an address at a given block.
// Quorum adds an additional parameter to support private state dump
Expand Down
6 changes: 6 additions & 0 deletions internal/web3ext/web3ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ web3._extend({
params: 2,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, ""]
}),
new web3._extend.Method({
name: 'privateStateRoot',
call: 'debug_privateStateRoot',
params: 1,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
}),
new web3._extend.Method({
name: 'dumpAddress',
call: 'debug_dumpAddress',
Expand Down

0 comments on commit 1b3a6b5

Please sign in to comment.