Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TEN headers #1998

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}