mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
RequiredBlockState declarations on api
This commit is contained in:
parent
07eeb7d86a
commit
530cea02f8
3 changed files with 25 additions and 0 deletions
|
|
@ -125,6 +125,15 @@ func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []s
|
|||
return &result, err
|
||||
}
|
||||
|
||||
type RequiredBlockState struct {
|
||||
}
|
||||
|
||||
// GetRequiredBlockState returns all state required to execute a single historical block.
|
||||
func (ec *Client) GetRequiredBlockState(ctx context.Context, blockNumber *big.Int) (*RequiredBlockState, error) {
|
||||
result := RequiredBlockState{}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// CallContract executes a message call transaction, which is directly executed in the VM
|
||||
// of the node, but never mined into the blockchain.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -933,6 +933,18 @@ func (s *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// GetRequiredBlockState returns all state required to execute a single historical block.
|
||||
func (s *BlockChainAPI) GetRequiredBlockState(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error) {
|
||||
block, err := s.b.BlockByNumberOrHash(ctx, blockNrOrHash)
|
||||
if block == nil || err != nil {
|
||||
// When the block doesn't exist, the RPC method should return JSON null
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
result := make([]map[string]interface{}, 1)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// OverrideAccount indicates the overriding fields of account during the execution
|
||||
// of a message call.
|
||||
// Note, state and stateDiff can't be specified at the same time. If state is
|
||||
|
|
|
|||
|
|
@ -1619,6 +1619,10 @@ func TestRPCGetBlockReceipts(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestRPCGetRequiredBlockState(t *testing.T) {
|
||||
//
|
||||
}
|
||||
|
||||
func testRPCResponseWithFile(t *testing.T, testid int, result interface{}, rpc string, file string) {
|
||||
data, err := json.MarshalIndent(result, "", " ")
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue