Remove redundant signs
This commit is contained in:
parent
740f6d2258
commit
705228ecc2
|
@ -93,9 +93,7 @@ pub fn test_tx() -> Transaction {
|
|||
let keypair1 = KeyPair::new();
|
||||
let pubkey1 = keypair1.pubkey();
|
||||
let zero = Hash::default();
|
||||
let mut tr = Transaction::new(&keypair1, pubkey1, 42, zero);
|
||||
tr.sign(&keypair1);
|
||||
return tr;
|
||||
Transaction::new(&keypair1, pubkey1, 42, zero)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -174,7 +172,6 @@ mod tests {
|
|||
let keypair = KeyPair::new();
|
||||
let pubkey = keypair.pubkey();
|
||||
let mut tr = Transaction::new(&keypair, pubkey, 42, zero);
|
||||
tr.sign(&keypair);
|
||||
tr.data.tokens = 1_000_000; // <-- attack!
|
||||
assert!(!tr.verify_plan());
|
||||
}
|
||||
|
@ -187,7 +184,6 @@ mod tests {
|
|||
let pubkey1 = keypair1.pubkey();
|
||||
let zero = Hash::default();
|
||||
let mut tr = Transaction::new(&keypair0, pubkey1, 42, zero);
|
||||
tr.sign(&keypair0);
|
||||
if let Plan::Pay(ref mut payment) = tr.data.plan {
|
||||
payment.to = thief_keypair.pubkey(); // <-- attack!
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue