Skip to content

Commit

Permalink
fix(vald): extend type API to reduce underlying ambiguity (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyanokashi authored Oct 2, 2024
1 parent 29bb3e9 commit 6271ef5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vald/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (mgr Mgr) GetTxReceiptsIfFinalized(chain nexus.ChainName, txIDs []common.Ha
}

return slices.Map(receipts, func(receipt rpc.TxReceiptResult) results.Result[geth.Receipt] {
return results.Pipe(results.Result[geth.Receipt](receipt), func(receipt geth.Receipt) results.Result[geth.Receipt] {
return results.Pipe(receipt.AsResult(), func(receipt geth.Receipt) results.Result[geth.Receipt] {

isFinalized, err := mgr.isFinalized(chain, receipt, confHeight)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions vald/evm/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
// results.TxReceiptResult with *types.Receipt.
type TxReceiptResult results.Result[types.Receipt]

// AsResult returns the TxReceiptResult as the underlying type results.Result[types.Receipt]
func (r TxReceiptResult) AsResult() results.Result[types.Receipt] {
return results.Result[types.Receipt](r)
}

// Client provides calls to EVM JSON-RPC endpoints
type Client interface {
// TransactionReceipts returns transaction receipts for the given transaction hashes
Expand Down

0 comments on commit 6271ef5

Please sign in to comment.