File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ func ReadUint128(r io.Reader, order ByteOrder) uint128 {
345
345
bs := make([]byte, 16)
346
346
n, err := io.ReadFull(r, bs)
347
347
if err.NotNone() {
348
- return uint128(0)
348
+ return 0u128
349
349
}
350
350
return order.Uint128(bs)
351
351
}
Original file line number Diff line number Diff line change @@ -42,17 +42,17 @@ func main() {
42
42
// sudt cell
43
43
// data: amount uint128
44
44
// https://docs-xi-two.vercel.app/docs/rfcs/0025-simple-udt/0025-simple-udt#sudt-cell
45
- inSum := 0
45
+ inSum := 0u128
46
46
for i := 0; i < ckb.scriptInputCells(); i++ {
47
47
raw := ckb.loadInputCellData(i)
48
- amount := binary.ReadUint64FromSlice (raw, binary.LittleEndian)
48
+ amount := binary.ReadUint128FromSlice (raw, binary.LittleEndian)
49
49
inSum += amount
50
50
}
51
51
52
- outSum := 0
52
+ outSum := 0u128
53
53
for i := 0; i < ckb.scriptOutputCells(); i++ {
54
54
raw := ckb.loadOutputCellData(i)
55
- amount := binary.ReadUint64FromSlice (raw, binary.LittleEndian)
55
+ amount := binary.ReadUint128FromSlice (raw, binary.LittleEndian)
56
56
inSum += amount
57
57
}
58
58
You can’t perform that action at this time.
0 commit comments