Simplify tx.validate() and transaction::aggregate() (#1436)

* simplify tx validation and aggregation
we *only* need to account for reward when building a block from txs

* rustfmt

* cleanup and tests passing

* rustfmt

* better comments in with_reward()

* fix wallet tests
This commit is contained in:
Antioch Peverell
2018-08-28 20:00:25 +01:00
committed by GitHub
parent 3dacc6a397
commit c334c557aa
10 changed files with 120 additions and 135 deletions
+3 -3
View File
@@ -299,7 +299,7 @@ mod test {
&keychain,
).unwrap();
tx.validate(false).unwrap();
tx.validate().unwrap();
}
#[test]
@@ -319,7 +319,7 @@ mod test {
&keychain,
).unwrap();
tx.validate(false).unwrap();
tx.validate().unwrap();
}
#[test]
@@ -333,6 +333,6 @@ mod test {
&keychain,
).unwrap();
tx.validate(false).unwrap();
tx.validate().unwrap();
}
}
+1 -1
View File
@@ -398,7 +398,7 @@ impl Slate {
final_tx.kernels()[0].verify()?;
// confirm the overall transaction is valid (including the updated kernel)
let _ = final_tx.validate(false)?;
let _ = final_tx.validate()?;
self.tx = final_tx;
Ok(())
+1 -1
View File
@@ -196,7 +196,7 @@ where
// finalize the burn transaction and send
let tx_burn = build::transaction(parts, &keychain)?;
tx_burn.validate(false)?;
tx_burn.validate()?;
Ok(tx_burn)
}