Skip to content

Commit

Permalink
add TEN headers
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Jul 24, 2024
1 parent ad61bdb commit 789987e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/walletextension/rpcapi/blockchain_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (api *BlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.Block
// convert to geth header and marshall
header := subscription.ConvertBatchHeader(resp)
fields := RPCMarshalHeader(header)
addExtraTenFields(fields, resp)
return fields, err
}

Expand All @@ -128,6 +129,7 @@ func (api *BlockChainAPI) GetBlockByHash(ctx context.Context, hash gethcommon.Ha
// convert to geth header and marshall
header := subscription.ConvertBatchHeader(resp)
fields := RPCMarshalHeader(header)
addExtraTenFields(fields, resp)
return fields, err
}

Expand Down Expand Up @@ -386,3 +388,13 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
}
return result
}

func addExtraTenFields(fields map[string]interface{}, header *common.BatchHeader) {
fields["l1Proof"] = header.L1Proof
fields["signature"] = header.Signature
fields["crossChainMessages"] = header.CrossChainMessages
fields["inboundCrossChainHash"] = header.LatestInboundCrossChainHash
fields["inboundCrossChainHeight"] = header.LatestInboundCrossChainHeight
fields["crossChainTreeHash"] = header.CrossChainRoot
fields["crossChainTree"] = header.CrossChainTree
}

0 comments on commit 789987e

Please sign in to comment.