Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into staging #1534

Merged
merged 13 commits into from
Oct 23, 2019
Merged
2 changes: 1 addition & 1 deletion chain/client/tests/process_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ fn test_time_attack() {
let hash = hash(&b1.header.inner.try_to_vec().expect("Failed to serialize"));
b1.header.hash = hash;
b1.header.signature = signer.sign(hash.as_ref());
client.process_block(b1, Provenance::NONE);
let _ = client.process_block(b1, Provenance::NONE);

let b2 = client.produce_block(2, Duration::from_secs(1)).unwrap().unwrap();
assert!(client.process_block(b2, Provenance::PRODUCED).1.is_ok());
Expand Down
1 change: 1 addition & 0 deletions runtime/near-vm-logic/tests/fixtures.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use near_vm_logic::VMContext;

#[allow(dead_code)]
pub fn get_context(input: Vec<u8>, is_view: bool) -> VMContext {
VMContext {
current_account_id: "alice.near".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/tests/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ macro_rules! decl_test_bytes {
let mut logic = VMLogic::new(&mut ext, context, &config, &promise_results, &mut memory);
let res = vec![0u8; $input.len()];
logic.$method(0).expect("read bytes into register from context should be ok");
logic.read_register(0, res.as_ptr() as _).expect("read register should be ok");;
logic.read_register(0, res.as_ptr() as _).expect("read register should be ok");
assert_eq!(res, $input);
}
};
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/tests/test_miscs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn test_hash256() {

logic.sha256(data.len() as _, data.as_ptr() as _, 0).unwrap();
let res = &vec![0u8; 32];
logic.read_register(0, res.as_ptr() as _);
let _ = logic.read_register(0, res.as_ptr() as _);
assert_eq!(
res,
&[
Expand Down
1 change: 1 addition & 0 deletions runtime/near-vm-logic/tests/test_view_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ macro_rules! test_prohibited {
let config = Config::default();
let promise_results = vec![];
let mut memory = MockedMemory::default();
#[allow(unused_mut)]
let mut logic = VMLogic::new(&mut ext, context, &config, &promise_results, &mut memory);

let name = stringify!($f);
Expand Down
2 changes: 2 additions & 0 deletions runtime/near-vm-runner/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ pub fn make_simple_contract_call_with_gas(
run(code_hash, code, method_name, &mut fake_external, context, &config, &promise_results)
}

#[allow(dead_code)]
pub fn make_simple_contract_call(
code: &[u8],
method_name: &[u8],
) -> (Option<VMOutcome>, Option<VMError>) {
make_simple_contract_call_with_gas(code, method_name, 1_000_000)
}

#[allow(dead_code)]
pub fn wat2wasm_no_validate(wat: &str) -> Vec<u8> {
Wat2Wasm::new().validate(false).convert(wat).unwrap().as_ref().to_vec()
}
7 changes: 6 additions & 1 deletion scripts/start_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
print("* Running NEAR validator node for Official TestNet *")
print("****************************************************")

DEFAULT_BOOT_NODE = "AJLCcX4Uymeq5ssavjUCyEA8SV6Y365Mh5h4shqMSTDA@34.94.33.164:24567"
DEFAULT_BOOT_NODE = ','.join([
"AJLCcX4Uymeq5ssavjUCyEA8SV6Y365Mh5h4shqMSTDA@34.94.33.164:24567",
"EY9mX5FYyR1sqrGwkqCbUrmjgAtXs4DeNaf1sjG9MrkY@35.226.146.230:24567",
"8K7NG5v2yvSq4A1wQuqSNvyY334BVq3ohvdu9wgpgjLG@104.154.188.160:24567",
"FNCMYTt9Gexq6Nq3Z67gRX7eeZAh27swd1nrwN3smT9Q@35.246.133.183:24567",
])

parser = argparse.ArgumentParser()
parser.add_argument('--local', action='store_true', help='deprecated: use --nodocker')
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rejoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mod test {
// to ensure they are not run in parallel.

fn send_transaction(
nodes: &Vec<Arc<RwLock<Node>>>,
nodes: &Vec<Arc<RwLock<dyn Node>>>,
account_names: &Vec<AccountId>,
nonces: &Vec<u64>,
from: usize,
Expand Down Expand Up @@ -147,7 +147,7 @@ mod test {
}
})
.collect();
let nodes: Vec<Arc<RwLock<Node>>> =
let nodes: Vec<Arc<RwLock<dyn Node>>> =
nodes.into_iter().map(|cfg| Node::new_sharable(cfg)).collect();
let account_names: Vec<_> =
nodes.iter().map(|node| node.read().unwrap().account_id().unwrap()).collect();
Expand Down