Wallet operation to burn some coins (#172)

* Burn transaction for testing
* Burn bug fixes, embed burn key in keychain
* Better error logging in API, wallet fee calc fix
This commit is contained in:
Ignotus Peverell
2017-10-12 03:35:40 +00:00
committed by GitHub
parent bf7c1fb44f
commit b85006ebe5
9 changed files with 158 additions and 49 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ pub struct Context<'a> {
/// Function type returned by the transaction combinators. Transforms a
/// (Transaction, BlindSum) pair into another, provided some context.
type Append = for<'a> Fn(&'a mut Context, (Transaction, BlindSum)) -> (Transaction, BlindSum);
pub type Append = for<'a> Fn(&'a mut Context, (Transaction, BlindSum)) -> (Transaction, BlindSum);
/// Adds an input with the provided value and blinding key to the transaction
/// being built.
@@ -50,8 +50,8 @@ pub fn input(value: u64, pubkey: Identifier) -> Box<Append> {
})
}
/// Adds an output with the provided value and blinding key to the transaction
/// being built.
/// Adds an output with the provided value and key identifier from the
/// keychain.
pub fn output(value: u64, pubkey: Identifier) -> Box<Append> {
Box::new(move |build, (tx, sum)| -> (Transaction, BlindSum) {
let commit = build.keychain.commit(value, &pubkey).unwrap();