@@ -55,9 +55,14 @@ func (e *EVMClient) SubmitTransaction(ctx context.Context, txRequest evmtypes.Su
5555 return nil , net .WrapRPCErr (err )
5656 }
5757
58+ h , err := evmpb .ConvertHashFromProto (reply .TxHash )
59+ if err != nil {
60+ return nil , net .WrapRPCErr (err )
61+ }
62+
5863 return & evmtypes.TransactionResult {
5964 TxStatus : evmpb .ConvertTxStatusFromProto (reply .TxStatus ),
60- TxHash : evmtypes . Hash ( reply . TxHash ) ,
65+ TxHash : h ,
6166 TxIdempotencyKey : reply .TxIdempotencyKey ,
6267 }, nil
6368}
@@ -279,6 +284,25 @@ func (e *EVMClient) GetForwarderForEOA(ctx context.Context, eoa, ocr2AggregatorI
279284 return evmtypes .Address (reply .GetAddr ()), nil
280285}
281286
287+ func (e * EVMClient ) GetLatestLPBlock (ctx context.Context ) (* evmtypes.LPBlock , error ) {
288+ reply , err := e .grpcClient .GetLatestLPBlock (ctx , & emptypb.Empty {})
289+ if err != nil {
290+ return nil , net .WrapRPCErr (err )
291+ }
292+ h , err := evmpb .ConvertHashFromProto (reply .GetLpBlock ().GetHash ())
293+ if err != nil {
294+ return nil , net .WrapRPCErr (err )
295+ }
296+
297+ return & evmtypes.LPBlock {
298+ BlockTimestamp : reply .GetLpBlock ().GetBlockTimestamp (),
299+ LatestBlockNumber : reply .GetLpBlock ().GetLatestBlockNumber (),
300+ FinalizedBlockNumber : reply .GetLpBlock ().GetFinalizedBlockNumber (),
301+ SafeBlockNumber : reply .GetLpBlock ().GetSafeBlockNumber (),
302+ BlockHash : h ,
303+ }, nil
304+ }
305+
282306type evmServer struct {
283307 evmpb.UnimplementedEVMServer
284308
@@ -397,8 +421,12 @@ func (e *evmServer) EstimateGas(ctx context.Context, request *evmpb.EstimateGasR
397421}
398422
399423func (e * evmServer ) GetTransactionByHash (ctx context.Context , request * evmpb.GetTransactionByHashRequest ) (* evmpb.GetTransactionByHashReply , error ) {
424+ h , err := evmpb .ConvertHashFromProto (request .GetHash ())
425+ if err != nil {
426+ return nil , err
427+ }
400428 tx , err := e .impl .GetTransactionByHash (ctx , evmtypes.GetTransactionByHashRequest {
401- Hash : evmtypes . Hash ( request . GetHash ()) ,
429+ Hash : h ,
402430 IsExternal : request .IsExternal ,
403431 })
404432 if err != nil {
@@ -414,8 +442,12 @@ func (e *evmServer) GetTransactionByHash(ctx context.Context, request *evmpb.Get
414442}
415443
416444func (e * evmServer ) GetTransactionReceipt (ctx context.Context , request * evmpb.GetTransactionReceiptRequest ) (* evmpb.GetTransactionReceiptReply , error ) {
445+ h , err := evmpb .ConvertHashFromProto (request .GetHash ())
446+ if err != nil {
447+ return nil , err
448+ }
417449 receipt , err := e .impl .GetTransactionReceipt (ctx , evmtypes.GeTransactionReceiptRequest {
418- Hash : evmtypes . Hash ( request . GetHash ()) ,
450+ Hash : h ,
419451 IsExternal : request .IsExternal ,
420452 })
421453 if err != nil {
@@ -521,6 +553,23 @@ func (e *evmServer) SubmitTransaction(ctx context.Context, request *evmpb.Submit
521553 }, nil
522554}
523555
556+ func (e * evmServer ) GetLatestLPBlock (ctx context.Context , _ * emptypb.Empty ) (* evmpb.GetLatestLPBlockReply , error ) {
557+ b , err := e .impl .GetLatestLPBlock (ctx )
558+ if err != nil {
559+ return nil , err
560+ }
561+
562+ return & evmpb.GetLatestLPBlockReply {
563+ LpBlock : & evmpb.LPBlock {
564+ Hash : b .BlockHash [:],
565+ LatestBlockNumber : b .LatestBlockNumber ,
566+ FinalizedBlockNumber : b .FinalizedBlockNumber ,
567+ SafeBlockNumber : b .SafeBlockNumber ,
568+ BlockTimestamp : b .BlockTimestamp ,
569+ },
570+ }, nil
571+ }
572+
524573func (e * evmServer ) CalculateTransactionFee (ctx context.Context , request * evmpb.CalculateTransactionFeeRequest ) (* evmpb.CalculateTransactionFeeReply , error ) {
525574 txFee , err := e .impl .CalculateTransactionFee (ctx , evmtypes.ReceiptGasInfo {
526575 GasUsed : request .GasInfo .GasUsed ,
0 commit comments