-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-606: Initialize start_block to none to use latest block
- Loading branch information
1 parent
99b68bf
commit b7ed3de
Showing
15 changed files
with
225 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,11 +353,8 @@ mod tests { | |
); | ||
assert_value("neighborhoodMode", "zero-hop", &map); | ||
assert_value("schemaVersion", &CURRENT_SCHEMA_VERSION.to_string(), &map); | ||
assert_value( | ||
"startBlock", | ||
&Chain::PolyMainnet.rec().contract_creation_block.to_string(), | ||
&map, | ||
); | ||
assert!(map.contains_key("startBlock")); | ||
assert_none("startBlock", &map); | ||
assert_value( | ||
"exampleEncrypted", | ||
&dao.get("example_encrypted").unwrap().value_opt.unwrap(), | ||
|
@@ -503,11 +500,8 @@ mod tests { | |
assert_value("pastNeighbors", "masq://polygon-mainnet:[email protected]:1234,masq://polygon-mainnet:[email protected]:2345", &map); | ||
assert_value("neighborhoodMode", "consume-only", &map); | ||
assert_value("schemaVersion", &CURRENT_SCHEMA_VERSION.to_string(), &map); | ||
assert_value( | ||
"startBlock", | ||
&Chain::PolyMainnet.rec().contract_creation_block.to_string(), | ||
&map, | ||
); | ||
assert!(map.contains_key("startBlock")); | ||
assert_none("startBlock", &map); | ||
let expected_ee_entry = dao.get("example_encrypted").unwrap().value_opt.unwrap(); | ||
let expected_ee_decrypted = Bip39::decrypt_bytes(&expected_ee_entry, "password").unwrap(); | ||
let expected_ee_string = encode_bytes(Some(expected_ee_decrypted)).unwrap().unwrap(); | ||
|
@@ -620,11 +614,8 @@ mod tests { | |
); | ||
assert_value("neighborhoodMode", "standard", &map); | ||
assert_value("schemaVersion", &CURRENT_SCHEMA_VERSION.to_string(), &map); | ||
assert_value( | ||
"startBlock", | ||
&Chain::PolyMainnet.rec().contract_creation_block.to_string(), | ||
&map, | ||
); | ||
assert!(map.contains_key("startBlock")); | ||
assert_none("startBlock", &map); | ||
assert_value( | ||
"exampleEncrypted", | ||
&dao.get("example_encrypted").unwrap().value_opt.unwrap(), | ||
|
@@ -679,6 +670,10 @@ mod tests { | |
assert_eq!(actual_value, expected_value); | ||
} | ||
|
||
fn assert_none(key: &str, map: &Map<String, Value>) { | ||
assert!(!map.get(key).is_none()); | ||
} | ||
|
||
fn assert_encrypted_value( | ||
key: &str, | ||
expected_value: &str, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.