eteu-technologies/near-api-go

receiptID in tx.receipts is null ?

Closed this issue · 7 comments

when I get receiptID in tx.receipts is null ?is a bug ?

It is. Please provide more information on the issue next time in the form of:

  1. What did you try to do (with code snippet to reproduce)
  2. What did you expect to see?
  3. What did you see instead?

I try to get receiptID from block 65906486,but it is null.
to verify it ,then I query mannet db ,find receiptID is not null.
what I expect is receiptID should be value equal to which in mannet db.

Please provide a code example and the query you use to find the receiptID from the database.

no code example.I just use api to get block,then get tx,receipt .
find receptID is null in every block,just test you can find it.
most likely unmarshal error.

Fixed in e8be92c

Tested with:

package main

import (
	"context"

	"github.com/eteu-technologies/near-api-go/pkg/client"
	"github.com/eteu-technologies/near-api-go/pkg/config"
	"github.com/eteu-technologies/near-api-go/pkg/types/hash"

	"github.com/davecgh/go-spew/spew"
)

var (
	txnHash = hash.MustCryptoHashFromBase58("AFYNx2sJ64Vwqx5LzgFbmhJ5hJbM8xFLvn93KwAW9YaL")
	account = "app.nearcrowd.near"
)

func main() {
	c := config.Networks["archival-mainnet"]
	rpc, err := client.NewClient(c.NodeURL)
	if err != nil {
		panic(err)
	}

	ctx := context.Background()
	res, err := rpc.TransactionStatusWithReceipts(ctx, txnHash, account)
	if err != nil {
		panic(err)
	}

	spew.Dump(res)
}