Skip to content

Commit

Permalink
Run fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Dec 21, 2023
1 parent ed537c6 commit 2fda5b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/channel/channel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const C_PRIME_AS_UINT256_HIGH: u128 =
329648542954659146201578277794459156480; // 31 * 0x8000000000000110000000000000000;
const STARK_PRIME: u256 =
3618502788666131213697322783095070105623107215331596699973092056135872020481;
const MONTGOMERY_R: felt252 = 3618502788666127798953978732740734578953660990361066340291730267701097005025; // 2**256 % STARK_PRIME
const MONTGOMERY_R: felt252 =
3618502788666127798953978732740734578953660990361066340291730267701097005025; // 2**256 % STARK_PRIME
const MONTGOMERY_R_INVERSE_MOD_STARK_PRIME: felt252 =
113078212145816603762751633895895194930089271709401121343797004406777446400;

Expand Down
22 changes: 17 additions & 5 deletions src/channel/tests/test_channel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ fn test_read_from_prover() {
channel.read_felt_from_prover(0xffffffffffffffffffffffffffffffffffffffff);

assert(channel.counter == 0, 'invalid read felt');
assert(channel.digest == 0xb056692f5fc4f27dedd1fb6269b02c542a415f1d84555708a354ffb25cf97ad5, 'invalid read felt');
assert(
channel.digest == 0xb056692f5fc4f27dedd1fb6269b02c542a415f1d84555708a354ffb25cf97ad5,
'invalid read felt'
);

let mut arr = ArrayTrait::<felt252>::new();
arr.append(2);
Expand All @@ -49,15 +52,24 @@ fn test_read_from_prover() {
channel.read_felts_from_prover(arr.span());

assert(channel.counter == 0, 'invalid read felts');
assert(channel.digest == 0x135bc3291210bb6248a09cea1a97b0023c5602b18a9e0786aeed16352972504, 'invalid read felts');
assert(
channel.digest == 0x135bc3291210bb6248a09cea1a97b0023c5602b18a9e0786aeed16352972504,
'invalid read felts'
);

channel.read_felt_vector_from_prover(arr.span());

assert(channel.counter == 0, 'invalid read felts');
assert(channel.digest == 0x413b1e08fe14f181acc48007a89e4d044a9edb54523e8eae5829fde606d4074d, 'invalid read felts');
assert(
channel.digest == 0x413b1e08fe14f181acc48007a89e4d044a9edb54523e8eae5829fde606d4074d,
'invalid read felts'
);

channel.read_uint64_from_prover(6969);

assert(channel.counter == 0, 'invalid read uint64');
assert(channel.digest == 0xeeee1f1910516152d49bea3829151bdd149fcd878fe4e7b52881300c113395ce, 'invalid read uint64');
assert(
channel.digest == 0xeeee1f1910516152d49bea3829151bdd149fcd878fe4e7b52881300c113395ce,
'invalid read uint64'
);
}

0 comments on commit 2fda5b2

Please sign in to comment.