Michelson: make maximum integer for gas 32 bit compatible (#169)
This commit is contained in:
parent
2d9bbcce90
commit
2fbc60af75
@ -232,18 +232,20 @@ module Cost_of = struct
|
||||
| None -> default
|
||||
| Some x -> x
|
||||
|
||||
let max_int = 1073741823
|
||||
|
||||
let shift_left x y =
|
||||
(alloc_cost @@ words_of_bits @@
|
||||
let (+) = Pervasives.(+) in
|
||||
Z.numbits (Script_int.to_zint x) +
|
||||
(unopt (Script_int.to_int y) ~default:2147483647))
|
||||
(unopt (Script_int.to_int y) ~default:max_int))
|
||||
|
||||
let shift_right x y =
|
||||
(alloc_cost @@ words_of_bits @@
|
||||
max 1 @@
|
||||
let (-) = Pervasives.(-) in
|
||||
Z.numbits (Script_int.to_zint x) -
|
||||
unopt (Script_int.to_int y) ~default:2147483647)
|
||||
unopt (Script_int.to_int y) ~default:max_int)
|
||||
|
||||
|
||||
let exec = step_cost 1
|
||||
|
Loading…
Reference in New Issue
Block a user