Skip to content

Commit

Permalink
DA-608 Instant receipt check config
Browse files Browse the repository at this point in the history
Signed-off-by: Dzianis Andreyenka <[email protected]>
  • Loading branch information
denisandreenko committed Aug 8, 2024
1 parent 8d3902d commit 3f76efc
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 3f76efc

Please sign in to comment.