Skip to content

Commit 56516b8

Browse files
authored
fix: encode int64 values directly in plutus data (#101)
Signed-off-by: Aurora Gaffney <[email protected]>
1 parent db929cc commit 56516b8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

data/encode.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,10 @@ func encodeMap(m *Map) (any, error) {
116116

117117
// encodeInteger encodes an Integer to CBOR format.
118118
func encodeInteger(i *Integer) (any, error) {
119-
// For small integers, encode directly
119+
// Encode directly for values that fit in int64
120120
if i.Inner.IsInt64() {
121121
val := i.Inner.Int64()
122-
// Check if it fits in the standard CBOR integer range
123-
if val >= -2147483648 && val <= 2147483647 {
124-
return val, nil
125-
}
122+
return val, nil
126123
}
127124

128125
// For large integers, use CBOR bignum tags

0 commit comments

Comments
 (0)