Commit 988bc0a4 authored by vicotor's avatar vicotor

implement OutputV0AtBlock

parent 8d1e1080
...@@ -34,13 +34,27 @@ func (e *ExChainAPI) BlockRefByNumber(ctx context.Context, num uint64) (eth.Bloc ...@@ -34,13 +34,27 @@ func (e *ExChainAPI) BlockRefByNumber(ctx context.Context, num uint64) (eth.Bloc
} }
func (e *ExChainAPI) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error) { func (e *ExChainAPI) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error) {
//TODO implement me return nil, nil, errors.New("FetchReceipts is not implemented in exchain currently")
panic("implement me")
} }
func (e *ExChainAPI) OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error) { func (e *ExChainAPI) OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error) {
//TODO implement me blk := e.chain.BlockByHash(blockHash)
panic("implement me") if blk == nil {
return nil, errors.New("block not found in exchain")
}
wblk := wrapper.NewBlkWrapper(blk)
root := eth.Bytes32{}
storageRoot := eth.Bytes32{}
// todo: vicotor implement this.
copy(root[:], wblk.Header().AppRoot)
copy(storageRoot[:], wblk.Header().AppRoot)
return &eth.OutputV0{
BlockHash: wblk.Hash(),
StateRoot: root,
MessagePasserStorageRoot: storageRoot,
}, nil
} }
func (e *ExChainAPI) GetPayload(id eth.PayloadInfo) (*eth.ExecutionPayloadEnvelope, error) { func (e *ExChainAPI) GetPayload(id eth.PayloadInfo) (*eth.ExecutionPayloadEnvelope, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment