diff --git a/Cargo.lock b/Cargo.lock index d9a1268d..61747d8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aho-corasick" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -26,11 +26,6 @@ name = "antidote" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "anyhow" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "arc-swap" version = "0.3.11" @@ -75,7 +70,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "async-trait 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -858,22 +853,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "grin_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "easy-jsonrpc-mw 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_chain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_p2p 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_pool 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_store 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_chain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_p2p 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_pool 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_store 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-timeout 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -884,15 +879,15 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-rustls 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "grin_chain" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "bit-vec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -901,10 +896,10 @@ dependencies = [ "croaring 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_keychain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_store 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_keychain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_store 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -914,8 +909,8 @@ dependencies = [ [[package]] name = "grin_core" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -924,8 +919,8 @@ dependencies = [ "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_keychain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_keychain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -940,13 +935,13 @@ dependencies = [ [[package]] name = "grin_keychain" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -962,16 +957,16 @@ dependencies = [ [[package]] name = "grin_p2p" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_chain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_store 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_chain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_store 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -983,16 +978,16 @@ dependencies = [ [[package]] name = "grin_pool" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_keychain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_keychain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1016,15 +1011,15 @@ dependencies = [ [[package]] name = "grin_store" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "croaring 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", "lmdb-zero 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1036,8 +1031,8 @@ dependencies = [ [[package]] name = "grin_util" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "4.0.0-alpha.1" +source = "git+https://github.com/mimblewimble/grin#5f5b1d2f135ab375d42c2efaf2477d8e180ae439" dependencies = [ "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1052,7 +1047,7 @@ dependencies = [ "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "zeroize 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "zip 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "zip 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1134,7 +1129,7 @@ dependencies = [ "grin_wallet_impls 4.0.0-alpha.1", "grin_wallet_libwallet 4.0.0-alpha.1", "grin_wallet_util 4.0.0-alpha.1", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "prettytable-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1144,7 +1139,7 @@ dependencies = [ "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1166,7 +1161,7 @@ dependencies = [ "grin_wallet_libwallet 4.0.0-alpha.1", "grin_wallet_util 4.0.0-alpha.1", "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-socks2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-timeout 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1179,7 +1174,7 @@ dependencies = [ "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "sysinfo 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", "timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1212,12 +1207,12 @@ version = "4.0.0-alpha.1" dependencies = [ "data-encoding 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ed25519-dalek 1.0.0-pre.3 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_chain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_keychain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_store 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "grin_api 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_chain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_keychain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_store 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", + "grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1227,7 +1222,7 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1239,7 +1234,7 @@ dependencies = [ "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1312,14 +1307,14 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1328,7 +1323,7 @@ dependencies = [ "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1341,10 +1336,10 @@ dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustls-native-certs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-rustls 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1357,10 +1352,10 @@ dependencies = [ "async-socks5 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1369,8 +1364,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io-timeout 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1381,9 +1376,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1438,10 +1433,10 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.35" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1556,7 +1551,7 @@ name = "lock_api" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1975,7 +1970,7 @@ dependencies = [ [[package]] name = "owning_ref" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2390,15 +2385,15 @@ name = "regex" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.14" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2419,7 +2414,7 @@ dependencies = [ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2746,11 +2741,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sourcefile" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "spin" version = "0.5.2" @@ -2952,7 +2942,7 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2969,7 +2959,7 @@ dependencies = [ "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-macros 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2989,12 +2979,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-macros" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3009,7 +2999,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3019,7 +3009,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3032,7 +3022,7 @@ dependencies = [ "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3208,16 +3198,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3226,60 +3216,42 @@ dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "wasm-bindgen-webidl" -version = "0.2.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "web-sys" -version = "0.3.35" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", - "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3291,14 +3263,6 @@ dependencies = [ "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "weedle" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "which" version = "3.1.0" @@ -3392,7 +3356,7 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3401,10 +3365,9 @@ dependencies = [ [metadata] "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum aho-corasick 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "743ad5a418686aad3b87fd14c43badd828cf26e214a00f92a384291cf22e1811" +"checksum aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e63fd144e18ba274ae7095c0197a870a7b9468abc801dd62f190d80817d2ec" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" "checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" "checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" @@ -3505,16 +3468,16 @@ dependencies = [ "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum grin_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "80fd5dd5ccc5bdcb4d2ea546bc27d85d444692512abaef3cdff390474b6f9bfc" -"checksum grin_chain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "260586a9a718de2d6bf8ce331a41009c9b0a6d48587887bcec4b80df566c4b58" -"checksum grin_core 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8821bc0a9441018f44018ab98d7c206f3dbf6a748528db5f6198559569990845" -"checksum grin_keychain 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d62113eca73786f3d0037775c2a193c184209c11eb41c214f75fcbcf903e37ee" -"checksum grin_p2p 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99d76ea20c7916fd9ca20746463266f227b024dd2908fc0d7d8f7c63bdee9033" -"checksum grin_pool 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d1892699ec9b3b4109e0f1246c76696a8a0d2038d30017dd1ab8ba103063a1" +"checksum grin_api 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_chain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_core 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_keychain 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_p2p 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_pool 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" "checksum grin_secp256k1zkp 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "23027a7673df2c2b20fb9589d742ff400a10a9c3e4c769a77e9fa3bd19586822" -"checksum grin_store 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2356f87415943d303b12296c7b2ea3184674d7c106d1eda1685f3860105914f2" -"checksum grin_util 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34c570edcdc419e0e083fdc850d60deb45054533cd6da33df3e4e4d246a98f7" -"checksum h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" +"checksum grin_store 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum grin_util 4.0.0-alpha.1 (git+https://github.com/mimblewimble/grin)" = "" +"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" "checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a" @@ -3523,7 +3486,7 @@ dependencies = [ "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fa1c527bbc634be72aa7ba31e4e4def9bbb020f5416916279b7c705cd838893e" +"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" "checksum hyper-rustls 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6ea6215c7314d450ee45970ab8b3851ab447a0e6bafdd19e31b20a42dbb7faf" "checksum hyper-socks2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b950dc6d3ea74cbb1f4c4ad217c20ca3e846b3f39468baef13d222c80a386bd6" "checksum hyper-timeout 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e98d46e385ee702f80447f78f7703ff7afb6d7080e51535400f5924746023f" @@ -3534,7 +3497,7 @@ dependencies = [ "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" -"checksum js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "7889c7c36282151f6bf465be4700359318aef36baa951462382eae49e9577cf9" +"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" "checksum jsonrpc-core 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc15eef5f8b6bef5ac5f7440a957ff95d036e2f98706947741bfc93d1976db4c" "checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" @@ -3591,7 +3554,7 @@ dependencies = [ "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" +"checksum owning_ref 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum pbkdf2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0c09cddfbfc98de7f76931acf44460972edb4023eb14d0c6d4018800e552d8e0" @@ -3640,7 +3603,7 @@ dependencies = [ "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" "checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" -"checksum regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b28dfe3fe9badec5dbf0a79a9cccad2cfc2ab5484bdb3e44cbd1ae8b3ba2be06" +"checksum regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum ring 0.16.11 (registry+https://github.com/rust-lang/crates.io-index)" = "741ba1704ae21999c00942f9f5944f801e977f54302af346b596287599ad1862" "checksum ripemd160 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "482aa56cc68aaeccdaaff1cc5a72c247da8bbad3beb174ca5741f274c22883fb" @@ -3682,7 +3645,6 @@ dependencies = [ "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" "checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" -"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" @@ -3706,10 +3668,10 @@ dependencies = [ "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" -"checksum tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8fdd17989496f49cdc57978c96f0c9fe5e4a58a8bddc6813c449a4624f6a030b" +"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" "checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" "checksum tokio-io-timeout 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9390a43272c8a6ac912ed1d1e2b6abeafd5047e05530a2fa304deee041a06215" -"checksum tokio-macros 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4b1e7ed7d5d4c2af3d999904b0eebe76544897cdbfb2b9684bed2174ab20f7c" +"checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" "checksum tokio-rustls 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "141afec0978abae6573065a48882c6bae44c5cc61db9b511ac4abf6a09bfd9cc" "checksum tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" @@ -3739,15 +3701,13 @@ dependencies = [ "checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -"checksum wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "5205e9afdf42282b192e2310a5b463a6d1c1d774e30dc3c791ac37ab42d2616c" -"checksum wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "11cdb95816290b525b32587d76419facd99662a07e59d3cdb560488a819d9a45" -"checksum wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "574094772ce6921576fb6f2e3f7497b8a76273b6db092be18fc48a082de09dc3" -"checksum wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" -"checksum wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e7e61fc929f4c0dddb748b102ebf9f632e2b8d739f2016542b4de2965a9601" -"checksum wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ef012a0d93fc0432df126a8eaf547b2dce25a8ce9212e1d3cbeef5c11157975d" -"checksum web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf97caf6aa8c2b1dac90faf0db529d9d63c93846cca4911856f78a83cebf53b" +"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" +"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" +"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" +"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" +"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum webpki 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" -"checksum weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" "checksum which 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5475d47078209a02e60614f7ba5e645ef3ed60f771920ac1906d7c1cc65024c8" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" @@ -3761,4 +3721,4 @@ dependencies = [ "checksum zeroize 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "45af6a010d13e4cf5b54c94ba5a2b2eba5596b9e46bf5875612d332a1f2b3f86" "checksum zeroize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" "checksum zeroize_derive 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "080616bd0e31f36095288bb0acdf1f78ef02c2fa15527d7e993f2a6c7591643e" -"checksum zip 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e41ff37ba788e2169b19fa70253b70cb53d9f2db9fb9aea9bcfc5047e02c3bae" +"checksum zip 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6df134e83b8f0f8153a094c7b0fd79dfebe437f1d76e7715afa18ed95ebe2fd7" diff --git a/api/src/foreign_rpc.rs b/api/src/foreign_rpc.rs index fb34e419..31cbd4e2 100644 --- a/api/src/foreign_rpc.rs +++ b/api/src/foreign_rpc.rs @@ -53,8 +53,8 @@ pub trait ForeignRpc { "Ok": { "foreign_api_version": 2, "supported_slate_versions": [ - "V3", - "V2" + "V4", + "V3" ] } } diff --git a/api/src/owner_rpc.rs b/api/src/owner_rpc.rs index 378d7e07..d3cf2110 100644 --- a/api/src/owner_rpc.rs +++ b/api/src/owner_rpc.rs @@ -19,7 +19,7 @@ use crate::config::{TorConfig, WalletConfig}; use crate::core::core::Transaction; use crate::core::global; use crate::keychain::{Identifier, Keychain}; -use crate::libwallet::slate_versions::v3::TransactionV3; +use crate::libwallet::slate_versions::v4::TransactionV4; use crate::libwallet::{ AcctPathMapping, ErrorKind, InitTxArgs, IssueInvoiceTxArgs, NodeClient, NodeHeightResult, OutputCommitMapping, PaymentProof, Slate, SlateVersion, StatusMessage, TxLogEntry, @@ -444,8 +444,8 @@ pub trait OwnerRpc { "offset": "d202964900000000d302964900000000d402964900000000d502964900000000" }, "version_info": { - "orig_version": 3, - "version": 3, + "orig_version": 4, + "version": 4, "block_header_version": 2 } } @@ -527,8 +527,8 @@ pub trait OwnerRpc { "offset": "d202964900000000d302964900000000d402964900000000d502964900000000" }, "version_info": { - "orig_version": 3, - "version": 3, + "orig_version": 4, + "version": 4, "block_header_version": 2 } } @@ -598,8 +598,8 @@ pub trait OwnerRpc { "offset": "d202964900000000d302964900000000d402964900000000d502964900000000" }, "version_info": { - "orig_version": 3, - "version": 3, + "orig_version": 4, + "version": 4, "block_header_version": 2 } }, @@ -686,8 +686,8 @@ pub trait OwnerRpc { "offset": "d202964900000000d302964900000000d402964900000000d502964900000000" }, "version_info": { - "orig_version": 3, - "version": 3, + "orig_version": 4, + "version": 4, "block_header_version": 2 } } @@ -764,8 +764,8 @@ pub trait OwnerRpc { "offset": "d202964900000000d302964900000000d402964900000000d502964900000000" }, "version_info": { - "orig_version": 3, - "version": 3, + "orig_version": 4, + "version": 4, "block_header_version": 2 } }, @@ -1028,7 +1028,7 @@ pub trait OwnerRpc { ``` */ - fn post_tx(&self, token: Token, tx: TransactionV3, fluff: bool) -> Result<(), ErrorKind>; + fn post_tx(&self, token: Token, tx: TransactionV4, fluff: bool) -> Result<(), ErrorKind>; /** Networked version of [Owner::cancel_tx](struct.Owner.html#method.cancel_tx). @@ -1168,7 +1168,7 @@ pub trait OwnerRpc { &self, token: Token, tx: &TxLogEntry, - ) -> Result, ErrorKind>; + ) -> Result, ErrorKind>; /** Networked version of [Owner::verify_slate_messages](struct.Owner.html#method.verify_slate_messages). @@ -2055,7 +2055,7 @@ where fn init_send_tx(&self, token: Token, args: InitTxArgs) -> Result { let slate = Owner::init_send_tx(self, (&token.keychain_mask).as_ref(), args) .map_err(|e| e.kind())?; - let version = SlateVersion::V3; + let version = SlateVersion::V4; Ok(VersionedSlate::into_version(slate, version)) } @@ -2066,7 +2066,7 @@ where ) -> Result { let slate = Owner::issue_invoice_tx(self, (&token.keychain_mask).as_ref(), args) .map_err(|e| e.kind())?; - let version = SlateVersion::V3; + let version = SlateVersion::V4; Ok(VersionedSlate::into_version(slate, version)) } @@ -2083,7 +2083,7 @@ where args, ) .map_err(|e| e.kind())?; - let version = SlateVersion::V3; + let version = SlateVersion::V4; Ok(VersionedSlate::into_version(out_slate, version)) } @@ -2098,7 +2098,7 @@ where &Slate::from(in_slate), ) .map_err(|e| e.kind())?; - let version = SlateVersion::V3; + let version = SlateVersion::V4; Ok(VersionedSlate::into_version(out_slate, version)) } @@ -2131,13 +2131,13 @@ where &self, token: Token, tx: &TxLogEntry, - ) -> Result, ErrorKind> { + ) -> Result, ErrorKind> { Owner::get_stored_tx(self, (&token.keychain_mask).as_ref(), tx) - .map(|x| x.map(TransactionV3::from)) + .map(|x| x.map(TransactionV4::from)) .map_err(|e| e.kind()) } - fn post_tx(&self, token: Token, tx: TransactionV3, fluff: bool) -> Result<(), ErrorKind> { + fn post_tx(&self, token: Token, tx: TransactionV4, fluff: bool) -> Result<(), ErrorKind> { Owner::post_tx( self, (&token.keychain_mask).as_ref(), diff --git a/impls/src/adapters/file.rs b/impls/src/adapters/file.rs index d7a0e343..650fb9ad 100644 --- a/impls/src/adapters/file.rs +++ b/impls/src/adapters/file.rs @@ -26,16 +26,18 @@ pub struct PathToSlate(pub PathBuf); impl SlatePutter for PathToSlate { fn put_tx(&self, slate: &Slate) -> Result<(), Error> { let mut pub_tx = File::create(&self.0)?; + let _r: crate::adapters::Reminder; let out_slate = { - if slate.payment_proof.is_some() || slate.ttl_cutoff_height.is_some() { - warn!("Transaction contains features that require grin-wallet 3.0.0 or later"); - warn!("Please ensure the other party is running grin-wallet v3.0.0 or later before sending"); - VersionedSlate::into_version(slate.clone(), SlateVersion::V3) + // TODO: This will need to be filled with any incompatibilities in the V4 Slate + if false { + warn!("Transaction contains features that require grin-wallet 4.0.0 or later"); + warn!("Please ensure the other party is running grin-wallet v4.0.0 or later before sending"); + VersionedSlate::into_version(slate.clone(), SlateVersion::V4) } else { let mut s = slate.clone(); - s.version_info.version = 2; - s.version_info.orig_version = 2; - VersionedSlate::into_version(s, SlateVersion::V2) + s.version_info.version = 3; + s.version_info.orig_version = 3; + VersionedSlate::into_version(s, SlateVersion::V3) } }; pub_tx.write_all( diff --git a/impls/src/adapters/http.rs b/impls/src/adapters/http.rs index 9393ae39..1abd5ddc 100644 --- a/impls/src/adapters/http.rs +++ b/impls/src/adapters/http.rs @@ -111,12 +111,12 @@ impl HttpSlateSender { return Err(ErrorKind::ClientCallback(report).into()); } + if supported_slate_versions.contains(&"V4".to_owned()) { + return Ok(SlateVersion::V4); + } if supported_slate_versions.contains(&"V3".to_owned()) { return Ok(SlateVersion::V3); } - if supported_slate_versions.contains(&"V2".to_owned()) { - return Ok(SlateVersion::V2); - } let report = "Unable to negotiate slate format with other wallet.".to_string(); error!("{}", report); @@ -143,6 +143,10 @@ impl HttpSlateSender { } } +#[deprecated( + since = "3.0.0", + note = "Remember to handle SlateV4 incompatibilities here" +)] impl SlateSender for HttpSlateSender { fn send_tx(&self, slate: &Slate) -> Result { let trailing = match self.base_url.ends_with('/') { @@ -177,18 +181,17 @@ impl SlateSender for HttpSlateSender { } let slate_send = match self.check_other_version(&url_str)? { - SlateVersion::V3 => VersionedSlate::into_version(slate.clone(), SlateVersion::V3), - SlateVersion::V2 => { + SlateVersion::V4 => VersionedSlate::into_version(slate.clone(), SlateVersion::V4), + SlateVersion::V3 => { let mut slate = slate.clone(); - if slate.payment_proof.is_some() { - return Err(ErrorKind::ClientCallback("Payment proof requested, but other wallet does not support payment proofs. Please urge other user to upgrade, or re-send tx without a payment proof".into()).into()); + let _r: crate::adapters::Reminder; + //TODO: Fill out with Slate V4 incompatibilities + if false { + return Err(ErrorKind::ClientCallback("feature x requested, but other wallet does not support feature x. Please urge other user to upgrade, or re-send tx without feature x".into()).into()); } - if slate.ttl_cutoff_height.is_some() { - warn!("Slate TTL value will be ignored and removed by other wallet, as other wallet does not support this feature. Please urge other user to upgrade"); - } - slate.version_info.version = 2; - slate.version_info.orig_version = 2; - VersionedSlate::into_version(slate, SlateVersion::V2) + slate.version_info.version = 3; + slate.version_info.orig_version = 3; + VersionedSlate::into_version(slate, SlateVersion::V3) } }; // Note: not using easy-jsonrpc as don't want the dependencies in this crate diff --git a/impls/src/adapters/mod.rs b/impls/src/adapters/mod.rs index 9b2480e9..c6704552 100644 --- a/impls/src/adapters/mod.rs +++ b/impls/src/adapters/mod.rs @@ -25,6 +25,13 @@ use crate::libwallet::{Error, ErrorKind, Slate}; use crate::tor::config::complete_tor_address; use crate::util::ZeroingString; +/// Little SlateV4 reminder warning helper +#[deprecated( + since = "3.0.0", + note = "Remember to handle SlateV4 incompatibilities here" +)] +pub struct Reminder; + /// Sends transactions to a corresponding SlateReceiver pub trait SlateSender { /// Send a transaction slate to another listening wallet and return result diff --git a/impls/src/test_framework/testclient.rs b/impls/src/test_framework/testclient.rs index 816dddcd..8b6ddf11 100644 --- a/impls/src/test_framework/testclient.rs +++ b/impls/src/test_framework/testclient.rs @@ -26,7 +26,7 @@ use crate::core::pow; use crate::keychain::Keychain; use crate::libwallet; use crate::libwallet::api_impl::foreign; -use crate::libwallet::slate_versions::v3::SlateV3; +use crate::libwallet::slate_versions::v4::SlateV4; use crate::libwallet::{NodeClient, NodeVersionInfo, Slate, WalletInst, WalletLCProvider}; use crate::util; use crate::util::secp::key::SecretKey; @@ -205,7 +205,7 @@ where Some(w) => w, }; - let slate: SlateV3 = serde_json::from_str(&m.body).context( + let slate: SlateV4 = serde_json::from_str(&m.body).context( libwallet::ErrorKind::ClientCallback("Error parsing TxWrapper".to_owned()), )?; @@ -238,7 +238,7 @@ where sender_id: m.dest, dest: m.sender_id, method: m.method, - body: serde_json::to_string(&SlateV3::from(slate)).unwrap(), + body: serde_json::to_string(&SlateV4::from(slate)).unwrap(), }) } @@ -399,7 +399,7 @@ impl LocalWalletClient { sender_id: self.id.clone(), dest: dest.to_owned(), method: "send_tx_slate".to_owned(), - body: serde_json::to_string(&SlateV3::from(slate)).unwrap(), + body: serde_json::to_string(&SlateV4::from(slate)).unwrap(), }; { let p = self.proxy_tx.lock(); @@ -410,7 +410,7 @@ impl LocalWalletClient { let r = self.rx.lock(); let m = r.recv().unwrap(); trace!("Received send_tx_slate response: {:?}", m.clone()); - let slate: SlateV3 = serde_json::from_str(&m.body).context( + let slate: SlateV4 = serde_json::from_str(&m.body).context( libwallet::ErrorKind::ClientCallback("Parsing send_tx_slate response".to_owned()), )?; Ok(Slate::from(slate)) diff --git a/libwallet/src/slate.rs b/libwallet/src/slate.rs index e643b602..603138d1 100644 --- a/libwallet/src/slate.rs +++ b/libwallet/src/slate.rs @@ -42,10 +42,10 @@ use std::fmt; use std::sync::Arc; use uuid::Uuid; -use crate::slate_versions::v2::SlateV2; -use crate::slate_versions::v3::{ - CoinbaseV3, InputV3, OutputV3, ParticipantDataV3, PaymentInfoV3, SlateV3, TransactionBodyV3, - TransactionV3, TxKernelV3, VersionCompatInfoV3, +use crate::slate_versions::v3::SlateV3; +use crate::slate_versions::v4::{ + CoinbaseV4, InputV4, OutputV4, ParticipantDataV4, PaymentInfoV4, SlateV4, TransactionBodyV4, + TransactionV4, TxKernelV4, VersionCompatInfoV4, }; use crate::slate_versions::{CURRENT_SLATE_VERSION, GRIN_BLOCK_HEADER_VERSION}; use crate::types::CbData; @@ -231,16 +231,16 @@ impl Slate { /// Recieve a slate, upgrade it to the latest version internally pub fn deserialize_upgrade(slate_json: &str) -> Result { let version = Slate::parse_slate_version(slate_json)?; - let v3: SlateV3 = match version { - 3 => serde_json::from_str(slate_json).context(ErrorKind::SlateDeser)?, - 2 => { - let v2: SlateV2 = + let v4: SlateV4 = match version { + 4 => serde_json::from_str(slate_json).context(ErrorKind::SlateDeser)?, + 3 => { + let v3: SlateV3 = serde_json::from_str(slate_json).context(ErrorKind::SlateDeser)?; - SlateV3::from(v2) + SlateV4::from(v3) } _ => return Err(ErrorKind::SlateVersion(version).into()), }; - Ok(v3.into()) + Ok(v4.into()) } /// Create a new slate @@ -725,13 +725,13 @@ impl Serialize for Slate { { use serde::ser::Error; - let v3 = SlateV3::from(self); + let v4 = SlateV4::from(self); match self.version_info.orig_version { - 3 => v3.serialize(serializer), + 4 => v4.serialize(serializer), // left as a reminder - 2 => { - let v2 = SlateV2::from(&v3); - v2.serialize(serializer) + 3 => { + let v3 = SlateV3::from(&v4); + v3.serialize(serializer) } v => Err(S::Error::custom(format!("Unknown slate version {}", v))), } @@ -759,11 +759,11 @@ impl SlateVersionProbe { } // Coinbase data to versioned. -impl From for CoinbaseV3 { - fn from(cb: CbData) -> CoinbaseV3 { - CoinbaseV3 { - output: OutputV3::from(&cb.output), - kernel: TxKernelV3::from(&cb.kernel), +impl From for CoinbaseV4 { + fn from(cb: CbData) -> CoinbaseV4 { + CoinbaseV4 { + output: OutputV4::from(&cb.output), + kernel: TxKernelV4::from(&cb.kernel), key_id: cb.key_id, } } @@ -772,8 +772,8 @@ impl From for CoinbaseV3 { // Current slate version to versioned conversions // Slate to versioned -impl From for SlateV3 { - fn from(slate: Slate) -> SlateV3 { +impl From for SlateV4 { + fn from(slate: Slate) -> SlateV4 { let Slate { num_participants, id, @@ -787,14 +787,14 @@ impl From for SlateV3 { version_info, payment_proof, } = slate; - let participant_data = map_vec!(participant_data, |data| ParticipantDataV3::from(data)); - let version_info = VersionCompatInfoV3::from(&version_info); + let participant_data = map_vec!(participant_data, |data| ParticipantDataV4::from(data)); + let version_info = VersionCompatInfoV4::from(&version_info); let payment_proof = match payment_proof { - Some(p) => Some(PaymentInfoV3::from(&p)), + Some(p) => Some(PaymentInfoV4::from(&p)), None => None, }; - let tx = TransactionV3::from(tx); - SlateV3 { + let tx = TransactionV4::from(tx); + SlateV4 { num_participants, id, tx, @@ -810,8 +810,8 @@ impl From for SlateV3 { } } -impl From<&Slate> for SlateV3 { - fn from(slate: &Slate) -> SlateV3 { +impl From<&Slate> for SlateV4 { + fn from(slate: &Slate) -> SlateV4 { let Slate { num_participants, id, @@ -827,19 +827,19 @@ impl From<&Slate> for SlateV3 { } = slate; let num_participants = *num_participants; let id = *id; - let tx = TransactionV3::from(tx); + let tx = TransactionV4::from(tx); let amount = *amount; let fee = *fee; let height = *height; let lock_height = *lock_height; let ttl_cutoff_height = *ttl_cutoff_height; - let participant_data = map_vec!(participant_data, |data| ParticipantDataV3::from(data)); - let version_info = VersionCompatInfoV3::from(version_info); + let participant_data = map_vec!(participant_data, |data| ParticipantDataV4::from(data)); + let version_info = VersionCompatInfoV4::from(version_info); let payment_proof = match payment_proof { - Some(p) => Some(PaymentInfoV3::from(p)), + Some(p) => Some(PaymentInfoV4::from(p)), None => None, }; - SlateV3 { + SlateV4 { num_participants, id, tx, @@ -855,8 +855,8 @@ impl From<&Slate> for SlateV3 { } } -impl From<&ParticipantData> for ParticipantDataV3 { - fn from(data: &ParticipantData) -> ParticipantDataV3 { +impl From<&ParticipantData> for ParticipantDataV4 { + fn from(data: &ParticipantData) -> ParticipantDataV4 { let ParticipantData { id, public_blind_excess, @@ -871,7 +871,7 @@ impl From<&ParticipantData> for ParticipantDataV3 { let part_sig = *part_sig; let message: Option = message.as_ref().map(|t| String::from(&**t)); let message_sig = *message_sig; - ParticipantDataV3 { + ParticipantDataV4 { id, public_blind_excess, public_nonce, @@ -882,8 +882,8 @@ impl From<&ParticipantData> for ParticipantDataV3 { } } -impl From<&VersionCompatInfo> for VersionCompatInfoV3 { - fn from(data: &VersionCompatInfo) -> VersionCompatInfoV3 { +impl From<&VersionCompatInfo> for VersionCompatInfoV4 { + fn from(data: &VersionCompatInfo) -> VersionCompatInfoV4 { let VersionCompatInfo { version, orig_version, @@ -892,7 +892,7 @@ impl From<&VersionCompatInfo> for VersionCompatInfoV3 { let version = *version; let orig_version = *orig_version; let block_header_version = *block_header_version; - VersionCompatInfoV3 { + VersionCompatInfoV4 { version, orig_version, block_header_version, @@ -900,8 +900,8 @@ impl From<&VersionCompatInfo> for VersionCompatInfoV3 { } } -impl From<&PaymentInfo> for PaymentInfoV3 { - fn from(data: &PaymentInfo) -> PaymentInfoV3 { +impl From<&PaymentInfo> for PaymentInfoV4 { + fn from(data: &PaymentInfo) -> PaymentInfoV4 { let PaymentInfo { sender_address, receiver_address, @@ -910,7 +910,7 @@ impl From<&PaymentInfo> for PaymentInfoV3 { let sender_address = *sender_address; let receiver_address = *receiver_address; let receiver_signature = *receiver_signature; - PaymentInfoV3 { + PaymentInfoV4 { sender_address, receiver_address, receiver_signature, @@ -918,35 +918,35 @@ impl From<&PaymentInfo> for PaymentInfoV3 { } } -impl From for TransactionV3 { - fn from(tx: Transaction) -> TransactionV3 { +impl From for TransactionV4 { + fn from(tx: Transaction) -> TransactionV4 { let Transaction { offset, body } = tx; - let body = TransactionBodyV3::from(&body); - TransactionV3 { offset, body } + let body = TransactionBodyV4::from(&body); + TransactionV4 { offset, body } } } -impl From<&Transaction> for TransactionV3 { - fn from(tx: &Transaction) -> TransactionV3 { +impl From<&Transaction> for TransactionV4 { + fn from(tx: &Transaction) -> TransactionV4 { let Transaction { offset, body } = tx; let offset = offset.clone(); - let body = TransactionBodyV3::from(body); - TransactionV3 { offset, body } + let body = TransactionBodyV4::from(body); + TransactionV4 { offset, body } } } -impl From<&TransactionBody> for TransactionBodyV3 { - fn from(body: &TransactionBody) -> TransactionBodyV3 { +impl From<&TransactionBody> for TransactionBodyV4 { + fn from(body: &TransactionBody) -> TransactionBodyV4 { let TransactionBody { inputs, outputs, kernels, } = body; - let inputs = map_vec!(inputs, |inp| InputV3::from(inp)); - let outputs = map_vec!(outputs, |out| OutputV3::from(out)); - let kernels = map_vec!(kernels, |kern| TxKernelV3::from(kern)); - TransactionBodyV3 { + let inputs = map_vec!(inputs, |inp| InputV4::from(inp)); + let outputs = map_vec!(outputs, |out| OutputV4::from(out)); + let kernels = map_vec!(kernels, |kern| TxKernelV4::from(kern)); + TransactionBodyV4 { inputs, outputs, kernels, @@ -954,21 +954,21 @@ impl From<&TransactionBody> for TransactionBodyV3 { } } -impl From<&Input> for InputV3 { - fn from(input: &Input) -> InputV3 { +impl From<&Input> for InputV4 { + fn from(input: &Input) -> InputV4 { let Input { features, commit } = *input; - InputV3 { features, commit } + InputV4 { features, commit } } } -impl From<&Output> for OutputV3 { - fn from(output: &Output) -> OutputV3 { +impl From<&Output> for OutputV4 { + fn from(output: &Output) -> OutputV4 { let Output { features, commit, proof, } = *output; - OutputV3 { + OutputV4 { features, commit, proof, @@ -976,8 +976,8 @@ impl From<&Output> for OutputV3 { } } -impl From<&TxKernel> for TxKernelV3 { - fn from(kernel: &TxKernel) -> TxKernelV3 { +impl From<&TxKernel> for TxKernelV4 { + fn from(kernel: &TxKernel) -> TxKernelV4 { let (features, fee, lock_height) = match kernel.features { KernelFeatures::Plain { fee } => (CompatKernelFeatures::Plain, fee, 0), KernelFeatures::Coinbase => (CompatKernelFeatures::Coinbase, 0, 0), @@ -985,7 +985,7 @@ impl From<&TxKernel> for TxKernelV3 { (CompatKernelFeatures::HeightLocked, fee, lock_height) } }; - TxKernelV3 { + TxKernelV4 { features, fee, lock_height, @@ -996,9 +996,9 @@ impl From<&TxKernel> for TxKernelV3 { } // Versioned to current slate -impl From for Slate { - fn from(slate: SlateV3) -> Slate { - let SlateV3 { +impl From for Slate { + fn from(slate: SlateV4) -> Slate { + let SlateV4 { num_participants, id, tx, @@ -1034,9 +1034,9 @@ impl From for Slate { } } -impl From<&ParticipantDataV3> for ParticipantData { - fn from(data: &ParticipantDataV3) -> ParticipantData { - let ParticipantDataV3 { +impl From<&ParticipantDataV4> for ParticipantData { + fn from(data: &ParticipantDataV4) -> ParticipantData { + let ParticipantDataV4 { id, public_blind_excess, public_nonce, @@ -1061,9 +1061,9 @@ impl From<&ParticipantDataV3> for ParticipantData { } } -impl From<&VersionCompatInfoV3> for VersionCompatInfo { - fn from(data: &VersionCompatInfoV3) -> VersionCompatInfo { - let VersionCompatInfoV3 { +impl From<&VersionCompatInfoV4> for VersionCompatInfo { + fn from(data: &VersionCompatInfoV4) -> VersionCompatInfo { + let VersionCompatInfoV4 { version, orig_version, block_header_version, @@ -1079,9 +1079,9 @@ impl From<&VersionCompatInfoV3> for VersionCompatInfo { } } -impl From<&PaymentInfoV3> for PaymentInfo { - fn from(data: &PaymentInfoV3) -> PaymentInfo { - let PaymentInfoV3 { +impl From<&PaymentInfoV4> for PaymentInfo { + fn from(data: &PaymentInfoV4) -> PaymentInfo { + let PaymentInfoV4 { sender_address, receiver_address, receiver_signature, @@ -1097,17 +1097,17 @@ impl From<&PaymentInfoV3> for PaymentInfo { } } -impl From for Transaction { - fn from(tx: TransactionV3) -> Transaction { - let TransactionV3 { offset, body } = tx; +impl From for Transaction { + fn from(tx: TransactionV4) -> Transaction { + let TransactionV4 { offset, body } = tx; let body = TransactionBody::from(&body); Transaction { offset, body } } } -impl From<&TransactionBodyV3> for TransactionBody { - fn from(body: &TransactionBodyV3) -> TransactionBody { - let TransactionBodyV3 { +impl From<&TransactionBodyV4> for TransactionBody { + fn from(body: &TransactionBodyV4) -> TransactionBody { + let TransactionBodyV4 { inputs, outputs, kernels, @@ -1124,16 +1124,16 @@ impl From<&TransactionBodyV3> for TransactionBody { } } -impl From<&InputV3> for Input { - fn from(input: &InputV3) -> Input { - let InputV3 { features, commit } = *input; +impl From<&InputV4> for Input { + fn from(input: &InputV4) -> Input { + let InputV4 { features, commit } = *input; Input { features, commit } } } -impl From<&OutputV3> for Output { - fn from(output: &OutputV3) -> Output { - let OutputV3 { +impl From<&OutputV4> for Output { + fn from(output: &OutputV4) -> Output { + let OutputV4 { features, commit, proof, @@ -1146,8 +1146,8 @@ impl From<&OutputV3> for Output { } } -impl From<&TxKernelV3> for TxKernel { - fn from(kernel: &TxKernelV3) -> TxKernel { +impl From<&TxKernelV4> for TxKernel { + fn from(kernel: &TxKernelV4) -> TxKernel { let (fee, lock_height) = (kernel.fee, kernel.lock_height); let features = match kernel.features { CompatKernelFeatures::Plain => KernelFeatures::Plain { fee }, diff --git a/libwallet/src/slate_versions/mod.rs b/libwallet/src/slate_versions/mod.rs index efe4145e..438944a2 100644 --- a/libwallet/src/slate_versions/mod.rs +++ b/libwallet/src/slate_versions/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2019 The Grin Developers +// Copyright 2020 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,19 +18,19 @@ //! remains for future needs use crate::slate::Slate; -use crate::slate_versions::v2::{CoinbaseV2, SlateV2}; use crate::slate_versions::v3::{CoinbaseV3, SlateV3}; +use crate::slate_versions::v4::{CoinbaseV4, SlateV4}; use crate::types::CbData; pub mod ser; -#[allow(missing_docs)] -pub mod v2; #[allow(missing_docs)] pub mod v3; +#[allow(missing_docs)] +pub mod v4; /// The most recent version of the slate -pub const CURRENT_SLATE_VERSION: u16 = 3; +pub const CURRENT_SLATE_VERSION: u16 = 4; /// The grin block header this slate is intended to be compatible with pub const GRIN_BLOCK_HEADER_VERSION: u16 = 3; @@ -38,10 +38,10 @@ pub const GRIN_BLOCK_HEADER_VERSION: u16 = 3; /// Existing versions of the slate #[derive(EnumIter, Serialize, Deserialize, Clone, Debug, PartialEq, PartialOrd, Eq, Ord)] pub enum SlateVersion { - /// V3 (most current) + /// V4 (most current) + V4, + /// V3 (3.0.0 - 4.0.0) V3, - /// V2 (2.0.0 - Onwards) - V2, } #[derive(Debug, Serialize, Deserialize)] @@ -49,31 +49,29 @@ pub enum SlateVersion { /// Versions are ordered newest to oldest so serde attempts to /// deserialize newer versions first, then falls back to older versions. pub enum VersionedSlate { - /// Current (3.0.0 Onwards ) + /// Current (4.0.0 Onwards ) + V4(SlateV4), + /// V2 (2.0.0 - 3.0.0) V3(SlateV3), - /// V2 (2.0.0 - Onwards) - V2(SlateV2), } impl VersionedSlate { /// Return slate version pub fn version(&self) -> SlateVersion { match *self { + VersionedSlate::V4(_) => SlateVersion::V4, VersionedSlate::V3(_) => SlateVersion::V3, - VersionedSlate::V2(_) => SlateVersion::V2, } } /// convert this slate type to a specified older version pub fn into_version(slate: Slate, version: SlateVersion) -> VersionedSlate { match version { - SlateVersion::V3 => VersionedSlate::V3(slate.into()), - // Left here as a reminder of what needs to be inserted on - // the release of a new slate - SlateVersion::V2 => { - let s = SlateV3::from(slate); - let s = SlateV2::from(&s); - VersionedSlate::V2(s) + SlateVersion::V4 => VersionedSlate::V4(slate.into()), + SlateVersion::V3 => { + let s = SlateV4::from(slate); + let s = SlateV3::from(&s); + VersionedSlate::V3(s) } } } @@ -82,9 +80,9 @@ impl VersionedSlate { impl From for Slate { fn from(slate: VersionedSlate) -> Slate { match slate { - VersionedSlate::V3(s) => Slate::from(s), - VersionedSlate::V2(s) => { - let s = SlateV3::from(s); + VersionedSlate::V4(s) => Slate::from(s), + VersionedSlate::V3(s) => { + let s = SlateV4::from(s); Slate::from(s) } } @@ -97,17 +95,17 @@ impl From for Slate { /// deserialize newer versions first, then falls back to older versions. pub enum VersionedCoinbase { /// Current supported coinbase version. + V4(CoinbaseV4), + /// Previous supported coinbase version. V3(CoinbaseV3), - /// Previous - V2(CoinbaseV2), } impl VersionedCoinbase { /// convert this coinbase data to a specific versioned representation for the json api. pub fn into_version(cb: CbData, version: SlateVersion) -> VersionedCoinbase { match version { + SlateVersion::V4 => VersionedCoinbase::V4(cb.into()), SlateVersion::V3 => VersionedCoinbase::V3(cb.into()), - SlateVersion::V2 => VersionedCoinbase::V2(cb.into()), } } } diff --git a/libwallet/src/slate_versions/v2.rs b/libwallet/src/slate_versions/v2.rs deleted file mode 100644 index e62939b1..00000000 --- a/libwallet/src/slate_versions/v2.rs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2019 The Grin Developers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Contains V2 of the slate (grin-wallet 1.1.0) -//! Changes from V1: -//! * ParticipantData struct fields serialized as hex strings instead of arrays: -//! * public_blind_excess -//! * public_nonce -//! * part_sig -//! * message_sig -//! * Transaction fields serialized as hex strings instead of arrays: -//! * offset -//! * Input field serialized as hex strings instead of arrays: -//! commit -//! * Output fields serialized as hex strings instead of arrays: -//! commit -//! proof -//! * TxKernel fields serialized as hex strings instead of arrays: -//! commit -//! signature -//! * version field removed -//! * VersionCompatInfo struct created with fields and added to beginning of struct -//! version: u16 -//! orig_version: u16, -//! block_header_version: u16, - -use crate::grin_core::core::transaction::OutputFeatures; -use crate::grin_core::libtx::secp_ser; -use crate::grin_keychain::{BlindingFactor, Identifier}; -use crate::grin_util::secp; -use crate::grin_util::secp::key::PublicKey; -use crate::grin_util::secp::pedersen::{Commitment, RangeProof}; -use crate::grin_util::secp::Signature; -use crate::slate::CompatKernelFeatures; -use crate::slate_versions::v3::{OutputV3, TxKernelV3}; -use crate::types::CbData; -use uuid::Uuid; - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct SlateV2 { - /// Versioning info - pub version_info: VersionCompatInfoV2, - /// The number of participants intended to take part in this transaction - pub num_participants: usize, - /// Unique transaction ID, selected by sender - pub id: Uuid, - /// The core transaction data: - /// inputs, outputs, kernels, kernel offset - pub tx: TransactionV2, - /// base amount (excluding fee) - #[serde(with = "secp_ser::string_or_u64")] - pub amount: u64, - /// fee amount - #[serde(with = "secp_ser::string_or_u64")] - pub fee: u64, - /// Block height for the transaction - #[serde(with = "secp_ser::string_or_u64")] - pub height: u64, - /// Lock height - #[serde(with = "secp_ser::string_or_u64")] - pub lock_height: u64, - /// Participant data, each participant in the transaction will - /// insert their public data here. For now, 0 is sender and 1 - /// is receiver, though this will change for multi-party - pub participant_data: Vec, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct VersionCompatInfoV2 { - /// The current version of the slate format - pub version: u16, - /// Original version this slate was converted from - pub orig_version: u16, - /// Version of grin block header this slate is compatible with - pub block_header_version: u16, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct ParticipantDataV2 { - /// Id of participant in the transaction. (For now, 0=sender, 1=rec) - #[serde(with = "secp_ser::string_or_u64")] - pub id: u64, - /// Public key corresponding to private blinding factor - #[serde(with = "secp_ser::pubkey_serde")] - pub public_blind_excess: PublicKey, - /// Public key corresponding to private nonce - #[serde(with = "secp_ser::pubkey_serde")] - pub public_nonce: PublicKey, - /// Public partial signature - #[serde(with = "secp_ser::option_sig_serde")] - pub part_sig: Option, - /// A message for other participants - pub message: Option, - /// Signature, created with private key corresponding to 'public_blind_excess' - #[serde(with = "secp_ser::option_sig_serde")] - pub message_sig: Option, -} - -/// A transaction -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct TransactionV2 { - /// The kernel "offset" k2 - /// excess is k1G after splitting the key k = k1 + k2 - #[serde( - serialize_with = "secp_ser::as_hex", - deserialize_with = "secp_ser::blind_from_hex" - )] - pub offset: BlindingFactor, - /// The transaction body - inputs/outputs/kernels - pub body: TransactionBodyV2, -} - -/// TransactionBody is a common abstraction for transaction and block -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct TransactionBodyV2 { - /// List of inputs spent by the transaction. - pub inputs: Vec, - /// List of outputs the transaction produces. - pub outputs: Vec, - /// List of kernels that make up this transaction (usually a single kernel). - pub kernels: Vec, -} -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct InputV2 { - /// The features of the output being spent. - /// We will check maturity for coinbase output. - pub features: OutputFeatures, - /// The commit referencing the output being spent. - #[serde( - serialize_with = "secp_ser::as_hex", - deserialize_with = "secp_ser::commitment_from_hex" - )] - pub commit: Commitment, -} - -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] -pub struct OutputV2 { - /// Options for an output's structure or use - pub features: OutputFeatures, - /// The homomorphic commitment representing the output amount - #[serde( - serialize_with = "secp_ser::as_hex", - deserialize_with = "secp_ser::commitment_from_hex" - )] - pub commit: Commitment, - /// A proof that the commitment is in the right range - #[serde( - serialize_with = "secp_ser::as_hex", - deserialize_with = "secp_ser::rangeproof_from_hex" - )] - pub proof: RangeProof, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct TxKernelV2 { - /// Options for a kernel's structure or use - pub features: CompatKernelFeatures, - /// Fee originally included in the transaction this proof is for. - #[serde(with = "secp_ser::string_or_u64")] - pub fee: u64, - /// This kernel is not valid earlier than lock_height blocks - /// The max lock_height of all *inputs* to this transaction - #[serde(with = "secp_ser::string_or_u64")] - pub lock_height: u64, - /// Remainder of the sum of all transaction commitments. If the transaction - /// is well formed, amounts components should sum to zero and the excess - /// is hence a valid public key. - #[serde( - serialize_with = "secp_ser::as_hex", - deserialize_with = "secp_ser::commitment_from_hex" - )] - pub excess: Commitment, - /// The signature proving the excess is a valid public key, which signs - /// the transaction fee. - #[serde(with = "secp_ser::sig_serde")] - pub excess_sig: secp::Signature, -} - -/// A mining node requests new coinbase via the foreign api every time a new candidate block is built. -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct CoinbaseV2 { - /// Output - pub output: OutputV2, - /// Kernel - pub kernel: TxKernelV2, - /// Key Id - pub key_id: Option, -} - -// Coinbase data to versioned. -impl From for CoinbaseV2 { - fn from(cb: CbData) -> CoinbaseV2 { - let output = OutputV3::from(&cb.output); - let output = OutputV2::from(&output); - let kernel = TxKernelV3::from(&cb.kernel); - let kernel = TxKernelV2::from(&kernel); - CoinbaseV2 { - output, - kernel, - key_id: cb.key_id, - } - } -} diff --git a/libwallet/src/slate_versions/v3.rs b/libwallet/src/slate_versions/v3.rs index 4deaf657..b8125ae5 100644 --- a/libwallet/src/slate_versions/v3.rs +++ b/libwallet/src/slate_versions/v3.rs @@ -1,4 +1,4 @@ -// Copyright 2019 The Grin Developers +// Copyright 2020 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ use crate::grin_core::core::transaction::OutputFeatures; use crate::grin_core::libtx::secp_ser; -use crate::grin_core::map_vec; use crate::grin_keychain::{BlindingFactor, Identifier}; use crate::grin_util::secp; use crate::grin_util::secp::key::PublicKey; @@ -27,15 +26,12 @@ use crate::grin_util::secp::pedersen::{Commitment, RangeProof}; use crate::grin_util::secp::Signature; use crate::slate::CompatKernelFeatures; use crate::slate_versions::ser as dalek_ser; +use crate::slate_versions::v4::{OutputV4, TxKernelV4}; +use crate::types::CbData; use ed25519_dalek::PublicKey as DalekPublicKey; use ed25519_dalek::Signature as DalekSignature; use uuid::Uuid; -use crate::slate_versions::v2::{ - InputV2, OutputV2, ParticipantDataV2, SlateV2, TransactionBodyV2, TransactionV2, TxKernelV2, - VersionCompatInfoV2, -}; - #[derive(Serialize, Deserialize, Debug, Clone)] pub struct SlateV3 { /// Versioning info @@ -209,297 +205,17 @@ pub struct CoinbaseV3 { pub key_id: Option, } -// V2 to V3 For Slate -impl From for SlateV3 { - fn from(slate: SlateV2) -> SlateV3 { - let SlateV2 { - num_participants, - id, - tx, - amount, - fee, - height, - lock_height, - participant_data, - version_info, - } = slate; - let participant_data = map_vec!(participant_data, |data| ParticipantDataV3::from(data)); - let version_info = VersionCompatInfoV3::from(&version_info); - let tx = TransactionV3::from(tx); - SlateV3 { - num_participants, - id, - tx, - amount, - fee, - height, - lock_height, - ttl_cutoff_height: None, - participant_data, - version_info, - payment_proof: None, - } - } -} - -impl From<&ParticipantDataV2> for ParticipantDataV3 { - fn from(data: &ParticipantDataV2) -> ParticipantDataV3 { - let ParticipantDataV2 { - id, - public_blind_excess, - public_nonce, - part_sig, - message, - message_sig, - } = data; - let id = *id; - let public_blind_excess = *public_blind_excess; - let public_nonce = *public_nonce; - let part_sig = *part_sig; - let message: Option = message.as_ref().map(|t| String::from(&**t)); - let message_sig = *message_sig; - ParticipantDataV3 { - id, - public_blind_excess, - public_nonce, - part_sig, - message, - message_sig, - } - } -} - -impl From<&VersionCompatInfoV2> for VersionCompatInfoV3 { - fn from(data: &VersionCompatInfoV2) -> VersionCompatInfoV3 { - let VersionCompatInfoV2 { - version, - orig_version, - block_header_version, - } = data; - let version = *version; - let orig_version = *orig_version; - let block_header_version = *block_header_version; - VersionCompatInfoV3 { - version, - orig_version, - block_header_version, - } - } -} - -impl From for TransactionV3 { - fn from(tx: TransactionV2) -> TransactionV3 { - let TransactionV2 { offset, body } = tx; - let body = TransactionBodyV3::from(&body); - TransactionV3 { offset, body } - } -} - -impl From<&TransactionBodyV2> for TransactionBodyV3 { - fn from(body: &TransactionBodyV2) -> TransactionBodyV3 { - let TransactionBodyV2 { - inputs, - outputs, - kernels, - } = body; - - let inputs = map_vec!(inputs, |inp| InputV3::from(inp)); - let outputs = map_vec!(outputs, |out| OutputV3::from(out)); - let kernels = map_vec!(kernels, |kern| TxKernelV3::from(kern)); - TransactionBodyV3 { - inputs, - outputs, - kernels, - } - } -} - -impl From<&InputV2> for InputV3 { - fn from(input: &InputV2) -> InputV3 { - let InputV2 { features, commit } = *input; - InputV3 { features, commit } - } -} - -impl From<&OutputV2> for OutputV3 { - fn from(output: &OutputV2) -> OutputV3 { - let OutputV2 { - features, - commit, - proof, - } = *output; - OutputV3 { - features, - commit, - proof, - } - } -} - -impl From<&TxKernelV2> for TxKernelV3 { - fn from(kernel: &TxKernelV2) -> TxKernelV3 { - let (fee, lock_height) = (kernel.fee, kernel.lock_height); - TxKernelV3 { - features: kernel.features, - fee, - lock_height, - excess: kernel.excess, - excess_sig: kernel.excess_sig, - } - } -} - -// V3 to V2 -#[allow(unused_variables)] -impl From<&SlateV3> for SlateV2 { - fn from(slate: &SlateV3) -> SlateV2 { - let SlateV3 { - num_participants, - id, - tx, - amount, - fee, - height, - lock_height, - ttl_cutoff_height, - participant_data, - version_info, - payment_proof, - } = slate; - let num_participants = *num_participants; - let id = *id; - let tx = TransactionV2::from(tx); - let amount = *amount; - let fee = *fee; - let height = *height; - let lock_height = *lock_height; - let participant_data = map_vec!(participant_data, |data| ParticipantDataV2::from(data)); - let version_info = VersionCompatInfoV2::from(version_info); - SlateV2 { - num_participants, - id, - tx, - amount, - fee, - height, - lock_height, - participant_data, - version_info, - } - } -} - -impl From<&ParticipantDataV3> for ParticipantDataV2 { - fn from(data: &ParticipantDataV3) -> ParticipantDataV2 { - let ParticipantDataV3 { - id, - public_blind_excess, - public_nonce, - part_sig, - message, - message_sig, - } = data; - let id = *id; - let public_blind_excess = *public_blind_excess; - let public_nonce = *public_nonce; - let part_sig = *part_sig; - let message: Option = message.as_ref().map(|t| String::from(&**t)); - let message_sig = *message_sig; - ParticipantDataV2 { - id, - public_blind_excess, - public_nonce, - part_sig, - message, - message_sig, - } - } -} - -impl From<&VersionCompatInfoV3> for VersionCompatInfoV2 { - fn from(data: &VersionCompatInfoV3) -> VersionCompatInfoV2 { - let VersionCompatInfoV3 { - version, - orig_version, - block_header_version, - } = data; - let version = *version; - let orig_version = *orig_version; - let block_header_version = *block_header_version; - VersionCompatInfoV2 { - version, - orig_version, - block_header_version, - } - } -} - -impl From for TransactionV2 { - fn from(tx: TransactionV3) -> TransactionV2 { - let TransactionV3 { offset, body } = tx; - let body = TransactionBodyV2::from(&body); - TransactionV2 { offset, body } - } -} - -impl From<&TransactionV3> for TransactionV2 { - fn from(tx: &TransactionV3) -> TransactionV2 { - let TransactionV3 { offset, body } = tx; - let offset = offset.clone(); - let body = TransactionBodyV2::from(body); - TransactionV2 { offset, body } - } -} - -impl From<&TransactionBodyV3> for TransactionBodyV2 { - fn from(body: &TransactionBodyV3) -> TransactionBodyV2 { - let TransactionBodyV3 { - inputs, - outputs, - kernels, - } = body; - - let inputs = map_vec!(inputs, |inp| InputV2::from(inp)); - let outputs = map_vec!(outputs, |out| OutputV2::from(out)); - let kernels = map_vec!(kernels, |kern| TxKernelV2::from(kern)); - TransactionBodyV2 { - inputs, - outputs, - kernels, - } - } -} - -impl From<&InputV3> for InputV2 { - fn from(input: &InputV3) -> InputV2 { - let InputV3 { features, commit } = *input; - InputV2 { features, commit } - } -} - -impl From<&OutputV3> for OutputV2 { - fn from(output: &OutputV3) -> OutputV2 { - let OutputV3 { - features, - commit, - proof, - } = *output; - OutputV2 { - features, - commit, - proof, - } - } -} - -impl From<&TxKernelV3> for TxKernelV2 { - fn from(kernel: &TxKernelV3) -> TxKernelV2 { - TxKernelV2 { - features: kernel.features, - fee: kernel.fee, - lock_height: kernel.lock_height, - excess: kernel.excess, - excess_sig: kernel.excess_sig, +// Coinbase data to versioned. +impl From for CoinbaseV3 { + fn from(cb: CbData) -> CoinbaseV3 { + let output = OutputV4::from(&cb.output); + let output = OutputV3::from(&output); + let kernel = TxKernelV4::from(&cb.kernel); + let kernel = TxKernelV3::from(&kernel); + CoinbaseV3 { + output, + kernel, + key_id: cb.key_id, } } } diff --git a/libwallet/src/slate_versions/v4.rs b/libwallet/src/slate_versions/v4.rs new file mode 100644 index 00000000..13bf3167 --- /dev/null +++ b/libwallet/src/slate_versions/v4.rs @@ -0,0 +1,548 @@ +// Copyright 2020 The Grin Developers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Contains V4 of the slate (grin-wallet 4.0.0) +//! Changes from V3: +//! * TBD + +use crate::grin_core::core::transaction::OutputFeatures; +use crate::grin_core::libtx::secp_ser; +use crate::grin_core::map_vec; +use crate::grin_keychain::{BlindingFactor, Identifier}; +use crate::grin_util::secp; +use crate::grin_util::secp::key::PublicKey; +use crate::grin_util::secp::pedersen::{Commitment, RangeProof}; +use crate::grin_util::secp::Signature; +use crate::slate::CompatKernelFeatures; +use crate::slate_versions::ser as dalek_ser; +use ed25519_dalek::PublicKey as DalekPublicKey; +use ed25519_dalek::Signature as DalekSignature; +use uuid::Uuid; + +use crate::slate_versions::v3::{ + InputV3, OutputV3, ParticipantDataV3, PaymentInfoV3, SlateV3, TransactionBodyV3, TransactionV3, + TxKernelV3, VersionCompatInfoV3, +}; + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct SlateV4 { + /// Versioning info + pub version_info: VersionCompatInfoV4, + /// The number of participants intended to take part in this transaction + pub num_participants: usize, + /// Unique transaction ID, selected by sender + pub id: Uuid, + /// The core transaction data: + /// inputs, outputs, kernels, kernel offset + pub tx: TransactionV4, + /// base amount (excluding fee) + #[serde(with = "secp_ser::string_or_u64")] + pub amount: u64, + /// fee amount + #[serde(with = "secp_ser::string_or_u64")] + pub fee: u64, + /// Block height for the transaction + #[serde(with = "secp_ser::string_or_u64")] + pub height: u64, + /// Lock height + #[serde(with = "secp_ser::string_or_u64")] + pub lock_height: u64, + /// TTL, the block height at which wallets + /// should refuse to process the transaction and unlock all + /// associated outputs + #[serde(with = "secp_ser::opt_string_or_u64")] + pub ttl_cutoff_height: Option, + /// Participant data, each participant in the transaction will + /// insert their public data here. For now, 0 is sender and 1 + /// is receiver, though this will change for multi-party + pub participant_data: Vec, + /// Payment Proof + #[serde(default = "default_payment_none")] + pub payment_proof: Option, +} + +fn default_payment_none() -> Option { + None +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct VersionCompatInfoV4 { + /// The current version of the slate format + pub version: u16, + /// Original version this slate was converted from + pub orig_version: u16, + /// Version of grin block header this slate is compatible with + pub block_header_version: u16, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct ParticipantDataV4 { + /// Id of participant in the transaction. (For now, 0=sender, 1=rec) + #[serde(with = "secp_ser::string_or_u64")] + pub id: u64, + /// Public key corresponding to private blinding factor + #[serde(with = "secp_ser::pubkey_serde")] + pub public_blind_excess: PublicKey, + /// Public key corresponding to private nonce + #[serde(with = "secp_ser::pubkey_serde")] + pub public_nonce: PublicKey, + /// Public partial signature + #[serde(with = "secp_ser::option_sig_serde")] + pub part_sig: Option, + /// A message for other participants + pub message: Option, + /// Signature, created with private key corresponding to 'public_blind_excess' + #[serde(with = "secp_ser::option_sig_serde")] + pub message_sig: Option, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct PaymentInfoV4 { + #[serde(with = "dalek_ser::dalek_pubkey_serde")] + pub sender_address: DalekPublicKey, + #[serde(with = "dalek_ser::dalek_pubkey_serde")] + pub receiver_address: DalekPublicKey, + #[serde(with = "dalek_ser::option_dalek_sig_serde")] + pub receiver_signature: Option, +} + +/// A transaction +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct TransactionV4 { + /// The kernel "offset" k2 + /// excess is k1G after splitting the key k = k1 + k2 + #[serde( + serialize_with = "secp_ser::as_hex", + deserialize_with = "secp_ser::blind_from_hex" + )] + pub offset: BlindingFactor, + /// The transaction body - inputs/outputs/kernels + pub body: TransactionBodyV4, +} + +/// TransactionBody is a common abstraction for transaction and block +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct TransactionBodyV4 { + /// List of inputs spent by the transaction. + pub inputs: Vec, + /// List of outputs the transaction produces. + pub outputs: Vec, + /// List of kernels that make up this transaction (usually a single kernel). + pub kernels: Vec, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct InputV4 { + /// The features of the output being spent. + /// We will check maturity for coinbase output. + pub features: OutputFeatures, + /// The commit referencing the output being spent. + #[serde( + serialize_with = "secp_ser::as_hex", + deserialize_with = "secp_ser::commitment_from_hex" + )] + pub commit: Commitment, +} + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct OutputV4 { + /// Options for an output's structure or use + pub features: OutputFeatures, + /// The homomorphic commitment representing the output amount + #[serde( + serialize_with = "secp_ser::as_hex", + deserialize_with = "secp_ser::commitment_from_hex" + )] + pub commit: Commitment, + /// A proof that the commitment is in the right range + #[serde( + serialize_with = "secp_ser::as_hex", + deserialize_with = "secp_ser::rangeproof_from_hex" + )] + pub proof: RangeProof, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct TxKernelV4 { + /// Options for a kernel's structure or use + pub features: CompatKernelFeatures, + /// Fee originally included in the transaction this proof is for. + #[serde(with = "secp_ser::string_or_u64")] + pub fee: u64, + /// This kernel is not valid earlier than lock_height blocks + /// The max lock_height of all *inputs* to this transaction + #[serde(with = "secp_ser::string_or_u64")] + pub lock_height: u64, + /// Remainder of the sum of all transaction commitments. If the transaction + /// is well formed, amounts components should sum to zero and the excess + /// is hence a valid public key. + #[serde( + serialize_with = "secp_ser::as_hex", + deserialize_with = "secp_ser::commitment_from_hex" + )] + pub excess: Commitment, + /// The signature proving the excess is a valid public key, which signs + /// the transaction fee. + #[serde(with = "secp_ser::sig_serde")] + pub excess_sig: secp::Signature, +} + +/// A mining node requests new coinbase via the foreign api every time a new candidate block is built. +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct CoinbaseV4 { + /// Output + pub output: OutputV4, + /// Kernel + pub kernel: TxKernelV4, + /// Key Id + pub key_id: Option, +} + +// V3 to V4 For Slate +impl From for SlateV4 { + fn from(slate: SlateV3) -> SlateV4 { + let SlateV3 { + version_info, + num_participants, + id, + tx, + amount, + fee, + height, + lock_height, + ttl_cutoff_height, + participant_data, + payment_proof, + } = slate; + let participant_data = map_vec!(participant_data, |data| ParticipantDataV4::from(data)); + let version_info = VersionCompatInfoV4::from(&version_info); + + let payment_proof = match payment_proof { + Some(p) => Some(PaymentInfoV4::from(&p)), + None => None, + }; + let tx = TransactionV4::from(tx); + SlateV4 { + version_info, + num_participants, + id, + tx, + amount, + fee, + height, + lock_height, + ttl_cutoff_height, + participant_data, + payment_proof, + } + } +} + +impl From<&ParticipantDataV3> for ParticipantDataV4 { + fn from(data: &ParticipantDataV3) -> ParticipantDataV4 { + let ParticipantDataV3 { + id, + public_blind_excess, + public_nonce, + part_sig, + message, + message_sig, + } = data; + let id = *id; + let public_blind_excess = *public_blind_excess; + let public_nonce = *public_nonce; + let part_sig = *part_sig; + let message: Option = message.as_ref().map(|t| String::from(&**t)); + let message_sig = *message_sig; + ParticipantDataV4 { + id, + public_blind_excess, + public_nonce, + part_sig, + message, + message_sig, + } + } +} + +impl From<&VersionCompatInfoV3> for VersionCompatInfoV4 { + fn from(data: &VersionCompatInfoV3) -> VersionCompatInfoV4 { + let VersionCompatInfoV3 { + version, + orig_version, + block_header_version, + } = data; + let version = *version; + let orig_version = *orig_version; + let block_header_version = *block_header_version; + VersionCompatInfoV4 { + version, + orig_version, + block_header_version, + } + } +} + +impl From for TransactionV4 { + fn from(tx: TransactionV3) -> TransactionV4 { + let TransactionV3 { offset, body } = tx; + let body = TransactionBodyV4::from(&body); + TransactionV4 { offset, body } + } +} + +impl From<&TransactionBodyV3> for TransactionBodyV4 { + fn from(body: &TransactionBodyV3) -> TransactionBodyV4 { + let TransactionBodyV3 { + inputs, + outputs, + kernels, + } = body; + + let inputs = map_vec!(inputs, |inp| InputV4::from(inp)); + let outputs = map_vec!(outputs, |out| OutputV4::from(out)); + let kernels = map_vec!(kernels, |kern| TxKernelV4::from(kern)); + TransactionBodyV4 { + inputs, + outputs, + kernels, + } + } +} + +impl From<&InputV3> for InputV4 { + fn from(input: &InputV3) -> InputV4 { + let InputV3 { features, commit } = *input; + InputV4 { features, commit } + } +} + +impl From<&OutputV3> for OutputV4 { + fn from(output: &OutputV3) -> OutputV4 { + let OutputV3 { + features, + commit, + proof, + } = *output; + OutputV4 { + features, + commit, + proof, + } + } +} + +impl From<&TxKernelV3> for TxKernelV4 { + fn from(kernel: &TxKernelV3) -> TxKernelV4 { + let (fee, lock_height) = (kernel.fee, kernel.lock_height); + TxKernelV4 { + features: kernel.features, + fee, + lock_height, + excess: kernel.excess, + excess_sig: kernel.excess_sig, + } + } +} + +impl From<&PaymentInfoV3> for PaymentInfoV4 { + fn from(input: &PaymentInfoV3) -> PaymentInfoV4 { + let PaymentInfoV3 { + sender_address, + receiver_address, + receiver_signature, + } = *input; + PaymentInfoV4 { + sender_address, + receiver_address, + receiver_signature, + } + } +} + +// V4 to V3 +#[allow(unused_variables)] +impl From<&SlateV4> for SlateV3 { + fn from(slate: &SlateV4) -> SlateV3 { + let SlateV4 { + num_participants, + id, + tx, + amount, + fee, + height, + lock_height, + ttl_cutoff_height, + participant_data, + version_info, + payment_proof, + } = slate; + let num_participants = *num_participants; + let id = *id; + let tx = TransactionV3::from(tx); + let amount = *amount; + let fee = *fee; + let height = *height; + let lock_height = *lock_height; + let participant_data = map_vec!(participant_data, |data| ParticipantDataV3::from(data)); + let version_info = VersionCompatInfoV3::from(version_info); + let payment_proof = match payment_proof { + Some(p) => Some(PaymentInfoV3::from(p)), + None => None, + }; + let ttl_cutoff_height = *ttl_cutoff_height; + SlateV3 { + num_participants, + id, + tx, + amount, + fee, + height, + lock_height, + ttl_cutoff_height, + participant_data, + version_info, + payment_proof, + } + } +} + +impl From<&ParticipantDataV4> for ParticipantDataV3 { + fn from(data: &ParticipantDataV4) -> ParticipantDataV3 { + let ParticipantDataV4 { + id, + public_blind_excess, + public_nonce, + part_sig, + message, + message_sig, + } = data; + let id = *id; + let public_blind_excess = *public_blind_excess; + let public_nonce = *public_nonce; + let part_sig = *part_sig; + let message: Option = message.as_ref().map(|t| String::from(&**t)); + let message_sig = *message_sig; + ParticipantDataV3 { + id, + public_blind_excess, + public_nonce, + part_sig, + message, + message_sig, + } + } +} + +impl From<&VersionCompatInfoV4> for VersionCompatInfoV3 { + fn from(data: &VersionCompatInfoV4) -> VersionCompatInfoV3 { + let VersionCompatInfoV4 { + version, + orig_version, + block_header_version, + } = data; + let version = *version; + let orig_version = *orig_version; + let block_header_version = *block_header_version; + VersionCompatInfoV3 { + version, + orig_version, + block_header_version, + } + } +} + +impl From for TransactionV3 { + fn from(tx: TransactionV4) -> TransactionV3 { + let TransactionV4 { offset, body } = tx; + let body = TransactionBodyV3::from(&body); + TransactionV3 { offset, body } + } +} + +impl From<&TransactionV4> for TransactionV3 { + fn from(tx: &TransactionV4) -> TransactionV3 { + let TransactionV4 { offset, body } = tx; + let offset = offset.clone(); + let body = TransactionBodyV3::from(body); + TransactionV3 { offset, body } + } +} + +impl From<&TransactionBodyV4> for TransactionBodyV3 { + fn from(body: &TransactionBodyV4) -> TransactionBodyV3 { + let TransactionBodyV4 { + inputs, + outputs, + kernels, + } = body; + + let inputs = map_vec!(inputs, |inp| InputV3::from(inp)); + let outputs = map_vec!(outputs, |out| OutputV3::from(out)); + let kernels = map_vec!(kernels, |kern| TxKernelV3::from(kern)); + TransactionBodyV3 { + inputs, + outputs, + kernels, + } + } +} + +impl From<&InputV4> for InputV3 { + fn from(input: &InputV4) -> InputV3 { + let InputV4 { features, commit } = *input; + InputV3 { features, commit } + } +} + +impl From<&OutputV4> for OutputV3 { + fn from(output: &OutputV4) -> OutputV3 { + let OutputV4 { + features, + commit, + proof, + } = *output; + OutputV3 { + features, + commit, + proof, + } + } +} + +impl From<&TxKernelV4> for TxKernelV3 { + fn from(kernel: &TxKernelV4) -> TxKernelV3 { + TxKernelV3 { + features: kernel.features, + fee: kernel.fee, + lock_height: kernel.lock_height, + excess: kernel.excess, + excess_sig: kernel.excess_sig, + } + } +} + +impl From<&PaymentInfoV4> for PaymentInfoV3 { + fn from(input: &PaymentInfoV4) -> PaymentInfoV3 { + let PaymentInfoV4 { + sender_address, + receiver_address, + receiver_signature, + } = *input; + PaymentInfoV3 { + sender_address, + receiver_address, + receiver_signature, + } + } +} diff --git a/util/Cargo.toml b/util/Cargo.toml index 83e2536c..5167cd0e 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -18,12 +18,12 @@ data-encoding = "2" sha3 = "0.8" # For Release -grin_core = "3.1.0" -grin_keychain = "3.1.0" -grin_chain = "3.1.0" -grin_util = "3.1.0" -grin_api = "3.1.0" -grin_store = "3.1.0" +# grin_core = "3.1.0" +# grin_keychain = "3.1.0" +# grin_chain = "3.1.0" +# grin_util = "3.1.0" +# grin_api = "3.1.0" +# grin_store = "3.1.0" # For beta release @@ -35,12 +35,12 @@ grin_store = "3.1.0" # grin_store = { git = "https://github.com/mimblewimble/grin", tag = "v3.1.0-beta.1" } # For bleeding edge -#grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -#grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -#grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -#grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } -#grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } -#grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } +grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"}