Rename pk variables to pubkey
This commit is contained in:
parent
ad331e6d56
commit
9d436fc5f8
|
@ -285,8 +285,8 @@ mod tests {
|
|||
remote.insert(key1, 0);
|
||||
|
||||
for i in 0..num_peers {
|
||||
let pk = Keypair::new().pubkey();
|
||||
rumors.insert(pk, i);
|
||||
let pubkey = Keypair::new().pubkey();
|
||||
rumors.insert(pubkey, i);
|
||||
}
|
||||
|
||||
external_liveness.insert(key1, rumors);
|
||||
|
@ -316,8 +316,8 @@ mod tests {
|
|||
remote.insert(key1, old_index);
|
||||
|
||||
for _i in 0..num_peers {
|
||||
let pk = Keypair::new().pubkey();
|
||||
rumors.insert(pk, old_index);
|
||||
let pubkey = Keypair::new().pubkey();
|
||||
rumors.insert(pubkey, old_index);
|
||||
}
|
||||
|
||||
external_liveness.insert(key1, rumors);
|
||||
|
|
|
@ -909,8 +909,8 @@ impl Crdt {
|
|||
}
|
||||
inc_new_counter_info!("crdt-update-count", insert_total);
|
||||
|
||||
for (pk, external_remote_index) in external_liveness {
|
||||
let remote_entry = if let Some(v) = self.remote.get(pk) {
|
||||
for (pubkey, external_remote_index) in external_liveness {
|
||||
let remote_entry = if let Some(v) = self.remote.get(pubkey) {
|
||||
*v
|
||||
} else {
|
||||
0
|
||||
|
@ -922,7 +922,7 @@ impl Crdt {
|
|||
|
||||
let liveness_entry = self
|
||||
.external_liveness
|
||||
.entry(*pk)
|
||||
.entry(*pubkey)
|
||||
.or_insert_with(HashMap::new);
|
||||
let peer_index = *liveness_entry.entry(from).or_insert(*external_remote_index);
|
||||
if *external_remote_index > peer_index {
|
||||
|
|
Loading…
Reference in New Issue