[WIP] Aggsig Transactions (#530)

* First steps converting transaction workflow to be aggsig-enable

* integrating updated version of aggsig, which gives greater control over the contents of e

* added wallet transaction test to testing framework to enable testing the whole thing, completed interaction as far as inital response from recipient

* more aggsig work, final signature is produced now

* Construction of aggsig transaction now working to the point of the signature being built

* aggsig transactions working end-to-end in the nominal case

* refactor aggsig verify from commit and fix some tests

* more cleanup and test fixing

* cleaning up automated tests

* test+formatting fix
This commit is contained in:
Yeastplume
2018-01-10 19:36:27 +00:00
committed by GitHub
parent 6a9a584c43
commit 1199ed2cc1
23 changed files with 721 additions and 206 deletions
+11 -14
View File
@@ -33,8 +33,6 @@ extern crate grin_wallet as wallet;
mod client;
use std::thread;
use std::io::Read;
use std::fs::File;
use std::time::Duration;
use std::env::current_dir;
@@ -211,10 +209,8 @@ fn main() {
.takes_value(true)))
.subcommand(SubCommand::with_name("send")
.about("Builds a transaction to send someone some coins. By default, \
the transaction will just be printed to stdout. If a destination is \
provided, the command will attempt to contact the receiver at that \
address and send the transaction directly.")
.about("Builds a transaction to send coins and sends it to the specified \
listener directly.")
.arg(Arg::with_name("amount")
.help("Number of coins to send with optional fraction, e.g. 12.423")
.index(1))
@@ -417,7 +413,7 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
let passphrase = wallet_args.value_of("pass").expect(
"Failed to read passphrase.",
);
let keychain = wallet_seed.derive_keychain(&passphrase).expect(
let mut keychain = wallet_seed.derive_keychain(&passphrase).expect(
"Failed to derive keychain from seed file and passphrase.",
);
@@ -428,7 +424,9 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
}
wallet::server::start_rest_apis(wallet_config, keychain);
}
("receive", Some(receive_args)) => {
// The following is gone for now, as a result of aggsig transactions
// being implemented
/*("receive", Some(receive_args)) => {
let input = receive_args.value_of("input").expect("Input file required");
let mut file = File::open(input).expect("Unable to open transaction file.");
let mut contents = String::new();
@@ -444,7 +442,7 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
println!(" * your node isn't running or can't be reached");
println!("\nDetailed error: {:?}", e);
}
}
}*/
("send", Some(send_args)) => {
let amount = send_args.value_of("amount").expect(
"Amount to send required",
@@ -461,14 +459,13 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
let selection_strategy = send_args.value_of("selection_strategy").expect(
"Selection strategy required",
);
let mut dest = "stdout";
if let Some(d) = send_args.value_of("dest") {
dest = d;
}
let dest = send_args.value_of("dest").expect(
"Destination wallet address required",
);
let max_outputs = 500;
let result = wallet::issue_send_tx(
&wallet_config,
&keychain,
&mut keychain,
amount,
minimum_confirmations,
dest.to_string(),