From 36e32ade7a14dc2d78dc8fd1e3eedc822e0bc19e Mon Sep 17 00:00:00 2001 From: Filip Krawczyk Date: Fri, 22 Dec 2023 10:37:57 +0100 Subject: [PATCH] Use BoundedU128::max() --- src/channel/channel.cairo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo index 2aab970c9..80d6ea4d2 100644 --- a/src/channel/channel.cairo +++ b/src/channel/channel.cairo @@ -2,6 +2,7 @@ use cairo_verifier::common::{ flip_endiannes::FlipEndiannessTrait, to_array::ToArrayTrait, blake2s::blake2s }; use poseidon::poseidon_hash_span; +use core::integer::BoundedU128; const C_PRIME_AS_UINT256_LOW: u128 = 31; const C_PRIME_AS_UINT256_HIGH: u128 = @@ -59,7 +60,7 @@ impl ChannelImpl of ChannelTrait { let value_u256: u256 = value.into(); let mut hash_data = ArrayTrait::::new(); - assert(self.digest.low != 0xffffffffffffffffffffffffffffffff, 'digest low is 2^128-1'); + assert(self.digest.low != BoundedU128::max(), 'digest low is 2^128-1'); (self.digest + 1).to_array_be(ref hash_data); value_u256.to_array_be(ref hash_data);