mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
this test was jamming up in azure CI (#3349)
* this test was jamming up in azure CI * peer handshake test requires global chain type
This commit is contained in:
parent
e7f04240fb
commit
6757a3040d
2 changed files with 6 additions and 10 deletions
|
@ -96,7 +96,6 @@ fn tx_double_ser_deser() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Keychain Error")]
|
||||
fn test_zero_commit_fails() {
|
||||
test_setup();
|
||||
let keychain = ExtKeychain::from_random_seed(false).unwrap();
|
||||
|
@ -104,13 +103,13 @@ fn test_zero_commit_fails() {
|
|||
let key_id1 = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
|
||||
|
||||
// blinding should fail as signing with a zero r*G shouldn't work
|
||||
build::transaction(
|
||||
let res = build::transaction(
|
||||
KernelFeatures::Plain { fee: 0 },
|
||||
vec![input(10, key_id1.clone()), output(10, key_id1)],
|
||||
&keychain,
|
||||
&builder,
|
||||
)
|
||||
.unwrap();
|
||||
);
|
||||
assert!(res.is_err());
|
||||
}
|
||||
|
||||
fn verifier_cache() -> Arc<RwLock<dyn VerifierCache>> {
|
||||
|
|
|
@ -38,7 +38,8 @@ fn open_port() -> u16 {
|
|||
|
||||
// Setup test with AutomatedTesting chain_type;
|
||||
fn test_setup() {
|
||||
global::set_local_chain_type(global::ChainTypes::AutomatedTesting);
|
||||
// Set "global" chain type here as we spawn peer threads for read/write.
|
||||
global::init_global_chain_type(global::ChainTypes::AutomatedTesting);
|
||||
util::init_test_logger();
|
||||
}
|
||||
|
||||
|
@ -69,11 +70,7 @@ fn peer_handshake() {
|
|||
);
|
||||
|
||||
let p2p_inner = server.clone();
|
||||
let _ = thread::spawn(move || {
|
||||
// Test setup relies on thread local for chain_type so make sure we setup here.
|
||||
test_setup();
|
||||
p2p_inner.listen()
|
||||
});
|
||||
let _ = thread::spawn(move || p2p_inner.listen());
|
||||
|
||||
thread::sleep(time::Duration::from_secs(1));
|
||||
|
||||
|
|
Loading…
Reference in a new issue