algorand / algorand/go-algorand

lastround in /v2/transactions/params can be invalid for encoding

Đang mở
#2,047 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
external contribution FDE
Ngôn ngữ chính
Go
Star
1.4k
Fork
537
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
18

Mô tả

### Subject of the issue

The `last-round` returned from /v2/transactions/params is used in goal and the SDKs for `txn.first-valid`.

However, if used immediately after creating a new network, the last round seen will be 0, which isn't allowed in the transaction encoding.

### Your environment

version 2.4.1 stable on x86-64 linux, using the network template at https://developer.algorand.org/tutorials/create-private-network/

### Steps to reproduce

1. Create a new network
2. Immediately fetch transaction parameters from `/v2/transactions/params`
3. Construct a transaction using an SDK with those as the suggested params
4. Try to encode and send the transaction

### Expected behaviour

The transaction encodes and sends.

### Actual behaviour

Encoding the transaction fails, because `first-valid = 0`, and zero values aren't allowed in encodings (https://github.com/algorand/js-algorand-sdk/blob/dde1044c186f69bf9bf269b8a3970cdd37806e2b/src/encoding/encoding.ts#L45-L46).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.