Skip to content

Commit

Permalink
Cargo update (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeastplume committed Feb 18, 2020
1 parent 4774704 commit b2c973f
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 181 deletions.
330 changes: 162 additions & 168 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions impls/src/backends/lmdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn private_ctx_xor_keys<K>(
where
K: Keychain,
{
let root_key = keychain.derive_key(0, &K::root_key_id(), &SwitchCommitmentType::Regular)?;
let root_key = keychain.derive_key(0, &K::root_key_id(), SwitchCommitmentType::Regular)?;

// derive XOR values for storing secret values in DB
// h(root_key|slate_id|"blind")
Expand Down Expand Up @@ -188,7 +188,7 @@ where
use_test_rng: bool,
) -> Result<Option<SecretKey>, Error> {
// store hash of master key, so it can be verified later after unmasking
let root_key = k.derive_key(0, &K::root_key_id(), &SwitchCommitmentType::Regular)?;
let root_key = k.derive_key(0, &K::root_key_id(), SwitchCommitmentType::Regular)?;
let mut hasher = Blake2b::new(SECRET_KEY_SIZE);
hasher.update(&root_key.0[..]);
self.master_checksum = Box::new(Some(hasher.finalize()));
Expand Down Expand Up @@ -233,7 +233,7 @@ where
}
// Check if master seed is what is expected (especially if it's been xored)
let root_key =
k_masked.derive_key(0, &K::root_key_id(), &SwitchCommitmentType::Regular)?;
k_masked.derive_key(0, &K::root_key_id(), SwitchCommitmentType::Regular)?;
let mut hasher = Blake2b::new(SECRET_KEY_SIZE);
hasher.update(&root_key.0[..]);
if *self.master_checksum != Some(hasher.finalize()) {
Expand Down Expand Up @@ -265,7 +265,7 @@ where
} else {*/
Ok(Some(util::to_hex(
self.keychain(keychain_mask)?
.commit(amount, &id, &SwitchCommitmentType::Regular)?
.commit(amount, &id, SwitchCommitmentType::Regular)?
.0
.to_vec(), // TODO: proper support for different switch commitment schemes
)))
Expand Down
2 changes: 1 addition & 1 deletion impls/src/client_utils/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Client {
/// Helper function to easily issue a HTTP GET request against a given URL that
/// returns a JSON object. Handles request building, JSON deserialization and
/// response code checking.
pub fn get<'a, T>(&self, url: &'a str, api_secret: Option<String>) -> Result<T, Error>
pub fn _get<'a, T>(&self, url: &'a str, api_secret: Option<String>) -> Result<T, Error>
where
for<'de> T: Deserialize<'de>,
{
Expand Down
2 changes: 1 addition & 1 deletion libwallet/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
key_path.depth += 1;
key_path.path[key_path.depth as usize - 1] = ChildNumber::from(index);
let key_id = Identifier::from_path(&key_path);
let sec_key = keychain.derive_key(0, &key_id, &SwitchCommitmentType::None)?;
let sec_key = keychain.derive_key(0, &key_id, SwitchCommitmentType::None)?;
let hashed = blake2b(32, &[], &sec_key.0[..]);
Ok(SecretKey::from_slice(
&keychain.secp(),
Expand Down
2 changes: 1 addition & 1 deletion libwallet/src/internal/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ mod test {
let kernel_excess = {
ExtKeychainPath::new(1, 1, 0, 0, 0).to_identifier();
let keychain = ExtKeychain::from_random_seed(true).unwrap();
let switch = &SwitchCommitmentType::Regular;
let switch = SwitchCommitmentType::Regular;
let id1 = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
let id2 = ExtKeychain::derive_key_id(1, 2, 0, 0, 0);
let skey1 = keychain.derive_key(0, &id1, switch).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions libwallet/src/internal/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ where
let commit = match output.commit.clone() {
Some(c) => pedersen::Commitment::from_vec(util::from_hex(c).unwrap()),
None => keychain
.commit(output.value, &output.key_id, &SwitchCommitmentType::Regular)
.commit(output.value, &output.key_id, SwitchCommitmentType::Regular)
.unwrap(), // TODO: proper support for different switch commitment schemes
};
OutputCommitMapping { output, commit }
Expand Down Expand Up @@ -189,7 +189,7 @@ where
let commit = match out.commit.clone() {
Some(c) => pedersen::Commitment::from_vec(util::from_hex(c).unwrap()),
None => keychain
.commit(out.value, &out.key_id, &SwitchCommitmentType::Regular)
.commit(out.value, &out.key_id, SwitchCommitmentType::Regular)
.unwrap(), // TODO: proper support for different switch commitment schemes
};
wallet_outputs.insert(commit, (out.key_id.clone(), out.mmr_index));
Expand Down
8 changes: 4 additions & 4 deletions libwallet/tests/libwallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn kernel_sig_msg() -> secp::Message {
#[test]
fn aggsig_sender_receiver_interaction() {
let parent = ExtKeychainPath::new(1, 1, 0, 0, 0).to_identifier();
let switch = &SwitchCommitmentType::Regular;
let switch = SwitchCommitmentType::Regular;
let sender_keychain = ExtKeychain::from_random_seed(true).unwrap();
let receiver_keychain = ExtKeychain::from_random_seed(true).unwrap();

Expand Down Expand Up @@ -237,7 +237,7 @@ fn aggsig_sender_receiver_interaction() {
#[test]
fn aggsig_sender_receiver_interaction_offset() {
let parent = ExtKeychainPath::new(1, 1, 0, 0, 0).to_identifier();
let switch = &SwitchCommitmentType::Regular;
let switch = SwitchCommitmentType::Regular;
let sender_keychain = ExtKeychain::from_random_seed(true).unwrap();
let receiver_keychain = ExtKeychain::from_random_seed(true).unwrap();

Expand Down Expand Up @@ -457,7 +457,7 @@ fn test_rewind_range_proof() {
let builder = proof::ProofBuilder::new(&keychain);
let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0);
let key_id2 = ExtKeychain::derive_key_id(1, 2, 0, 0, 0);
let switch = &SwitchCommitmentType::Regular;
let switch = SwitchCommitmentType::Regular;
let commit = keychain.commit(5, &key_id, switch).unwrap();
let extra_data = [99u8; 64];

Expand All @@ -484,7 +484,7 @@ fn test_rewind_range_proof() {
let (r_amount, r_key_id, r_switch) = proof_info.unwrap();
assert_eq!(r_amount, 5);
assert_eq!(r_key_id, key_id);
assert_eq!(&r_switch, switch);
assert_eq!(r_switch, switch);

// cannot rewind with a different commit
let commit2 = keychain.commit(5, &key_id2, switch).unwrap();
Expand Down

0 comments on commit b2c973f

Please sign in to comment.