Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
test: #72 Implement wasm-bindgen-test
Browse files Browse the repository at this point in the history
  • Loading branch information
polarbeargo committed Nov 12, 2021
1 parent ce3c3c3 commit 1783222
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 3 deletions.
141 changes: 141 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ mina-crypto = { version = "0.1.0", path = "../crypto" }
mina-rs-base = { version = "0.1.0", path = "../base" }
serde-bin-prot = { git = "https://github.com/ChainSafe/serde-bin-prot", branch = "main" }
thiserror = "1.0.24"
wasm-bindgen-test = "0.3.0"
7 changes: 4 additions & 3 deletions consensus/src/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::common::{Common, ProtocolStateChain};
use mina_crypto::hash::{Hashable, StateHash};
use mina_rs_base::protocol_state::ProtocolState;

use wasm_bindgen_test::*;
const slots_per_epoch: u32 = 7140;

/// init_checkpoints initializes the checkpoints for the genesis block
Expand Down Expand Up @@ -60,7 +60,7 @@ mod tests {
use mina_rs_base::global_slot::GlobalSlot;
use mina_rs_base::numbers::{GlobalSlotNumber, Length};

#[test]
#[wasm_bindgen_test]
fn test_init_checkpoints() {
let mut genesis: ProtocolState = Default::default();
let state_hash = genesis.hash();
Expand Down Expand Up @@ -95,6 +95,7 @@ mod tests {
);
}

#[wasm_bindgen_test]
fn test_update_checkpoints() {
let mut genesis: ProtocolState = Default::default();
let state_hash = genesis.hash();
Expand Down Expand Up @@ -148,6 +149,6 @@ mod tests {
);
}

#[test]
#[wasm_bindgen_test]
fn test_is_short_range() {}
}

0 comments on commit 1783222

Please sign in to comment.