Skip to content

Commit e4ff025

Browse files
committed
chore: update secp256k1 to 0.7.0
1 parent f37c22c commit e4ff025

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

.github/workflows/rust.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
- name: Update submodules
1313
run: git submodule update --init
1414
- name: Build contract
15-
run: make all-via-docker
15+
run: make all-via-docker && ls -alth build
1616
- name: Run omni_lock tests
17-
run: cd tests/omni_lock_rust && cargo test
18-
- name: Run omni_lock simulator tests
19-
run: cd tests/omni_lock && bash run.sh
17+
run: cd tests/omni_lock_rust && cargo test benchmark -- --nocapture

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
branch = master
99
[submodule "deps/secp256k1-20210801"]
1010
path = deps/secp256k1-20210801
11-
url = https://github.com/nervosnetwork/secp256k1.git
12-
branch = schnorr
11+
url = https://github.com/bitcoin-core/secp256k1.git
12+
branch = master

deps/secp256k1-20210801

tests/omni_lock_rust/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const CKB_HASH_PERSONALIZATION: &[u8] = b"ckb-default-hash";
1515
const BINARIES: &[(&str, &str)] = &[
1616
(
1717
"omni_lock",
18-
"8f3e1e01b6d8fff5c9fe12f773912902397c733c23cdc42635081cd49326db68",
18+
"01618e4bf2c438e95a82bfc0540bbf6594a54c829c11b97ef2ba7f9473883890",
1919
),
2020
];
2121

tests/omni_lock_rust/tests/test_omni_lock.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ fn test_btc_success(vtype: u8) {
524524

525525
verifier.set_debug_printer(debug_printer);
526526
let verify_result = verifier.verify(MAX_CYCLES);
527-
verify_result.expect("pass verification");
527+
let cycles = (verify_result.unwrap() as f64) / 1024. / 1024.;
528+
println!("cycles = {:.2} M", cycles);
528529
}
529530

530531
fn test_btc_err_pubkey(vtype: u8) {
@@ -556,6 +557,11 @@ fn test_btc(vtype: u8) {
556557
test_btc_err_pubkey(vtype);
557558
}
558559

560+
#[test]
561+
fn test_btc_benchmark() {
562+
test_btc_success(BITCOIN_V_TYPE_SEGWITBECH32);
563+
}
564+
559565
#[test]
560566
fn test_btc_unlock() {
561567
test_btc(BITCOIN_V_TYPE_P2PKHUNCOMPRESSED);

0 commit comments

Comments
 (0)