Skip to content

Commit

Permalink
Fix valset upd keccak hash test
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Aug 26, 2022
1 parent 0f22330 commit c018ae5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions shared/src/types/vote_extensions/validator_set_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,22 @@ mod tests {
//
// const output = abiEncoder.encode(
// ['string', 'address[]', 'uint256[]', 'uint256'],
// ['bridge', [], [], 0],
// ['bridge', [], [], 1],
// );
//
// const hash = keccak256(output).toString('hex');
//
// console.log(hash);
// ```
const EXPECTED: &str =
"36bcf52e7ae929b6df7489d012c8ca63eddb35c1b0baf10f46cac81f6728e0a6";
"694d9bc27d5da7444e5742b13394b2c8a7e73b43d6acd52b6e23b26b612f7c86";

let KeccakHash(got) =
compute_hash(Epoch(0), BRIDGE_CONTRACT_NAMESPACE, vec![], vec![]);
let KeccakHash(got) = compute_hash(
1u64.into(),
BRIDGE_CONTRACT_NAMESPACE,
vec![],
vec![],
);

assert_eq!(&hex::encode(got), EXPECTED);
}
Expand Down

0 comments on commit c018ae5

Please sign in to comment.