Commit 03bd4af
authored
fix(jsonrpc): correct TransactionResult.nonce per JSON-RPC spec (tronprotocol#6709)
Per ethereum/execution-apis, TransactionInfo.nonce is `uint` (QUANTITY)
and must match `^0x(0|[1-9a-f][0-9a-f]*)$`. java-tron emitted the field
as `0x0000000000000000` via `ByteArray.toJsonHex(new byte[8])`, which
violates the pattern. Both `TransactionResult` constructors now emit
`"0x0"`.
Block.nonce is intentionally left at `0x0000000000000000` because the
Block schema defines it as `bytes8`, so that value is already compliant
and shortening it would break conformance.
Closes tronprotocol#65471 parent 16190df commit 03bd4af
2 files changed
Lines changed: 14 additions & 3 deletions
File tree
- framework/src
- main/java/org/tron/core/services/jsonrpc/types
- test/java/org/tron/core/services/jsonrpc
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
| |||
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
68 | | - | |
| 78 | + | |
| 79 | + | |
69 | 80 | | |
70 | 81 | | |
71 | 82 | | |
0 commit comments