Skip to content

Commit

Permalink
Merge pull request #56 from hyperledger/patch/receipt-check
Browse files Browse the repository at this point in the history
DA-608 Instant receipt check config
  • Loading branch information
denisandreenko authored Aug 8, 2024
2 parents 8d3902d + 3f76efc commit 7b65b4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/tezos/get_receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ type receiptExtraInfo struct {

// TransactionReceipt queries to see if a receipt is available for a given transaction hash
func (c *tezosConnector) TransactionReceipt(ctx context.Context, req *ffcapi.TransactionReceiptRequest) (*ffcapi.TransactionReceiptResponse, ffcapi.ErrorReason, error) {
opts := &rpc.DefaultOptions

// ensure block observer is running
rpcClient := c.client.(*rpc.Client)
rpcClient.Listen()

// wait for confirmations
res := rpc.NewResult(tezos.MustParseOpHash(req.TransactionHash)) // .WithTTL(op.TTL).WithConfirmations(opts.Confirmations)
res := rpc.NewResult(tezos.MustParseOpHash(req.TransactionHash)).WithTTL(opts.TTL).WithConfirmations(opts.Confirmations)
res.Listen(rpcClient.BlockObserver)
res.WaitContext(ctx)
if err := res.Err(); err != nil {
Expand Down
1 change: 1 addition & 0 deletions tezosconnect_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ffcore:
- tezos
confirmations:
required: 0
fetchReceiptUponEntry: true
transactions:
handler:
name: simple

0 comments on commit 7b65b4b

Please sign in to comment.