algorand / algorand/go-algorand

`goal clerk inspect` does not fail when encoded transaction is malformed.

Đang mở
#4,765 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Team Lamprey
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

`goal clerk inspect` does not fail when encoded transaction is malformed.
### Your environment

* Software version: `algod -v`
```
12885557248
3.10.0.stable [rel/stable] (commit #9869cd96)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand
```
* Operating System details.
```
mscOS Monterey 12.6
```

### Steps to reproduce

1. Create a simple transaction using `goal clerk` and write it to a file.
2. Decode the transaction using `msgpacktool -d -b32` and write it to a file.
e.g.
```json
{
"txn": {
"fee": 1000,
"fv": 18317067,
"gen": "testnet-v1.0",
"gh:b32": "JBR3KGFEWPEE5SAQ6IWU6EEBZMHXD4CZU6WCBXWGF57XBZIJHIRA====",
"lv": 18318067,
"note:b32": "DFK4JSUQTAZMW===",
"rcv:b32": "GDJRC6E65LY43F6DSFCLZDN4RJKQXPBHPPYFS37BBSVCYEMKIOWQ====",
"snd:b32": "GDJRC6E65LY43F6DSFCLZDN4RJKQXPBHPPYFS37BBSVCYEMKIOWQ====",
"type": "pay"
}
}
```
3. Edit the decoded transaction using a text editor or use `sed s/rcv:b32/rcv/` to remove the `:b32` suffix from the `rcv` field.
e.g.
```json
{
"txn": {
"fee": 1000,
"fv": 18317067,
"gen": "testnet-v1.0",
"gh:b32": "JBR3KGFEWPEE5SAQ6IWU6EEBZMHXD4CZU6WCBXWGF57XBZIJHIRA====",
"lv": 18318067,
"note:b32": "DFK4JSUQTAZMW===",
"rcv": "GDJRC6E65LY43F6DSFCLZDN4RJKQXPBHPPYFS37BBSVCYEMKIOWQ====",
"snd:b32": "GDJRC6E65LY43F6DSFCLZDN4RJKQXPBHPPYFS37BBSVCYEMKIOWQ====",
"type": "pay"
}
}
```
4. Encode the decoded transaction using `msgpacktool -e -b32` and write it to a file.
5. Inspect the file from the previous step using `goal clerk inspect`.
e.g.
```json
/tmp/tx.d.e[0]
{
"txn": {
"fee": 1000,
"fv": 18317067,
"gen": "testnet-v1.0",
"gh": "SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",
"lv": 18318067,
"note": "GVXEypCYMss=",
"rcv": "I5CEUUSDGZCTMNKMLE2DGRRWIRJUMQ2MLJCE4NCSJJFVCWCQIJEKXL5FQU",
"snd": "GDJRC6E65LY43F6DSFCLZDN4RJKQXPBHPPYFS37BBSVCYEMKIOW7KEK7CQ",
"type": "pay"
}
}
```

### Expected behaviour

`goal clerk inspect` should fail since the `rcv` field is not valid.

### Actual behaviour

`goal clerk inspect` does not fail and displays a wrong value for the `rcv` field.

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.