Skip to content

Commit d83f339

Browse files
committed
Added tests.
1 parent 1c55673 commit d83f339

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

Taskfile.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ silent: true
44

55
vars:
66
COSMWASM_CHECK_VERSION: 3.0.1
7-
TOOLCHAIN: +1.82.0
7+
TOOLCHAIN: +1.88.0
88

99
tasks:
1010

@@ -26,10 +26,10 @@ tasks:
2626
desc: Installs cosmwasm-check tool (released version and currently developed version)
2727
cmds:
2828
# Install recently released cosmwasm-check and rename it to cosmwasm-check-release
29-
- cmd: cargo +1.88.0 install cosmwasm-check@{{.COSMWASM_CHECK_VERSION}} --locked --force
29+
- cmd: cargo {{.TOOLCHAIN}} install cosmwasm-check@{{.COSMWASM_CHECK_VERSION}} --locked --force
3030
- cmd: mv ~/.cargo/bin/cosmwasm-check ~/.cargo/bin/cosmwasm-check-release
3131
# Install currently developed version of cosmwasm-check
32-
- cmd: cargo +1.88.0 install --path ./packages/check --locked --force
32+
- cmd: cargo {{.TOOLCHAIN}} install --path ./packages/check --locked --force
3333

3434
check-contracts:
3535
desc: Performs checks for all contracts
@@ -58,3 +58,13 @@ tasks:
5858
cmds:
5959
- cmd: cargo clean
6060
- cmd: ./devtools/clean-contracts.sh
61+
62+
test:
63+
desc: Runs all tests
64+
cmds:
65+
- task: test-cosmwasm-core
66+
67+
test-cosmwasm-core:
68+
desc: Runs tests for cosmwasm-core
69+
cmds:
70+
- cmd: cargo {{.TOOLCHAIN}} test -p cosmwasm-core
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use cosmwasm_core::{
2+
BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_GENERATOR, BLS12_381_G2_POINT_LEN,
3+
};
4+
5+
#[test]
6+
fn ensure_lengths() {
7+
assert_eq!(BLS12_381_G1_POINT_LEN, 48);
8+
assert_eq!(BLS12_381_G2_POINT_LEN, 96);
9+
}
10+
11+
#[test]
12+
fn ensure_generators() {
13+
assert_eq!(
14+
BLS12_381_G1_GENERATOR,
15+
[
16+
151, 241, 211, 167, 49, 151, 215, 148, 38, 149, 99, 140, 79, 169, 172, 15, 195, 104,
17+
140, 79, 151, 116, 185, 5, 161, 78, 58, 63, 23, 27, 172, 88, 108, 85, 232, 63, 249,
18+
122, 26, 239, 251, 58, 240, 10, 219, 34, 198, 187,
19+
]
20+
);
21+
assert_eq!(
22+
BLS12_381_G2_GENERATOR,
23+
[
24+
147, 224, 43, 96, 82, 113, 159, 96, 125, 172, 211, 160, 136, 39, 79, 101, 89, 107, 208,
25+
208, 153, 32, 182, 26, 181, 218, 97, 187, 220, 127, 80, 73, 51, 76, 241, 18, 19, 148,
26+
93, 87, 229, 172, 125, 5, 93, 4, 43, 126, 2, 74, 162, 178, 240, 143, 10, 145, 38, 8, 5,
27+
39, 45, 197, 16, 81, 198, 228, 122, 212, 250, 64, 59, 2, 180, 81, 11, 100, 122, 227,
28+
209, 119, 11, 172, 3, 38, 168, 5, 187, 239, 212, 128, 86, 200, 193, 33, 189, 184,
29+
]
30+
);
31+
}

0 commit comments

Comments
 (0)