TTL Implementation (#261)

* refactor address generation code into libwallet, bool to flag whether to include proof, add sender address in init_send_tx

* rustfmt

* require payment proof addr as part of init_tx

* rustfmt

* store payment proof on sender transaction side

* rustfmt

* change sig to ed25519 sig

* rustfmt

* add message creation and signature

* rustfmt

* add payment proof verification function

* rustfmt

* validate proof on sender side, store proof

* rustfmt

* fix json tests

* fixes and updates to tests

* added API functions for converting and retrieving proof addresses

* rustfmt

* add payment proof to init_send_tx example

* rustfmt

* incorrect comment

* add commands for requesting payment proofs

* rustfmt

* wire up payment proofs into command line

* rustfmt

* add address command

* rustfmt

* added tor sending from owner api

* rustfmt

* add TTL to slate, transaction log

* ttl cutoff tests

* add ttl check to recieve functions, add tests, modify doctests

* rustfmt

* fixes from upstream changes and test fixes

* rustfmt

* remove unnecessary block header version check
This commit is contained in:
Yeastplume
2019-12-02 13:54:57 +00:00
committed by GitHub
parent 9fd1d49dda
commit 45480392da
25 changed files with 653 additions and 327 deletions
+3 -3
View File
@@ -58,14 +58,14 @@ fn check_middleware(
// allow coinbases to be built regardless
ForeignCheckMiddlewareFn::BuildCoinbase => Ok(()),
_ => {
let mut bhv = 1;
let mut bhv = 2;
if let Some(n) = node_version_info {
bhv = n.block_header_version;
}
if let Some(s) = slate {
if s.version_info.version < CURRENT_SLATE_VERSION
|| (bhv == 1 && s.version_info.block_header_version != 1)
|| (bhv > 1 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION)
// || (bhv == 3 && s.version_info.block_header_version != 3)
|| (bhv > 3 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION)
{
Err(ErrorKind::Compatibility(
"Incoming Slate is not compatible with this wallet. \
+6
View File
@@ -152,6 +152,7 @@ pub fn txs(
bMG->"Type",
bMG->"Shared Transaction Id",
bMG->"Creation Time",
bMG->"TTL Cutoff Height",
bMG->"Confirmed?",
bMG->"Confirmation Time",
bMG->"Num. \nInputs",
@@ -173,6 +174,10 @@ pub fn txs(
};
let entry_type = format!("{}", t.tx_type);
let creation_ts = format!("{}", t.creation_ts.format("%Y-%m-%d %H:%M:%S"));
let ttl_cutoff_height = match t.ttl_cutoff_height {
Some(b) => format!("{}", b),
None => "None".to_owned(),
};
let confirmation_ts = match t.confirmation_ts {
Some(m) => format!("{}", m.format("%Y-%m-%d %H:%M:%S")),
None => "None".to_owned(),
@@ -212,6 +217,7 @@ pub fn txs(
bFC->entry_type,
bFC->slate_id,
bFB->creation_ts,
bFB->ttl_cutoff_height,
bFC->confirmed,
bFB->confirmation_ts,
bFC->num_inputs,