V2 Foreign API RPC Tests (#28)

* build_coinbase api doctest

* rustfmt

* foreign api recieve tx rpc

* rustfmt

* re-export grin dependencies

* re-export grin dependencies

* all foreign API rpc tests working
This commit is contained in:
Yeastplume 2019-03-26 16:02:31 +00:00 committed by GitHub
parent 94960b3edd
commit afa6003a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 686 additions and 439 deletions

165
Cargo.lock generated
View file

@ -555,17 +555,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "grin_api" name = "grin_api"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_chain 1.1.0",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_core 1.1.0",
"grin_p2p 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_p2p 1.1.0",
"grin_pool 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_pool 1.1.0",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_store 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -587,7 +586,6 @@ dependencies = [
[[package]] [[package]]
name = "grin_chain" name = "grin_chain"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -595,10 +593,10 @@ dependencies = [
"croaring 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "croaring 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_core 1.1.0",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_keychain 1.1.0",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_store 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -610,7 +608,6 @@ dependencies = [
[[package]] [[package]]
name = "grin_core" name = "grin_core"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -619,8 +616,8 @@ dependencies = [
"enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_keychain 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -636,12 +633,11 @@ dependencies = [
[[package]] [[package]]
name = "grin_keychain" name = "grin_keychain"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -658,15 +654,14 @@ dependencies = [
[[package]] [[package]]
name = "grin_p2p" name = "grin_p2p"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_core 1.1.0",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_store 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
@ -678,16 +673,15 @@ dependencies = [
[[package]] [[package]]
name = "grin_pool" name = "grin_pool"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_core 1.1.0",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_keychain 1.1.0",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_store 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.6 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
@ -711,15 +705,14 @@ dependencies = [
[[package]] [[package]]
name = "grin_store" name = "grin_store"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"croaring 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "croaring 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_core 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_util 1.1.0",
"libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
"lmdb-zero 0.4.4 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -731,7 +724,6 @@ dependencies = [
[[package]] [[package]]
name = "grin_util" name = "grin_util"
version = "1.1.0" version = "1.1.0"
source = "git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0#2e72ed91f3d1616d9c553e97d489bc2e6b4032b1"
dependencies = [ dependencies = [
"backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -758,17 +750,12 @@ dependencies = [
"ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_api 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_wallet_api 1.1.0", "grin_wallet_api 1.1.0",
"grin_wallet_config 1.1.0", "grin_wallet_config 1.1.0",
"grin_wallet_controller 1.1.0", "grin_wallet_controller 1.1.0",
"grin_wallet_impls 1.1.0", "grin_wallet_impls 1.1.0",
"grin_wallet_libwallet 1.1.0", "grin_wallet_libwallet 1.1.0",
"grin_wallet_util 1.1.0",
"linefeed 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "linefeed 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"prettytable-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "prettytable-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -783,19 +770,14 @@ dependencies = [
"easy-jsonrpc 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "easy-jsonrpc 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_api 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_wallet_config 1.1.0", "grin_wallet_config 1.1.0",
"grin_wallet_impls 1.1.0", "grin_wallet_impls 1.1.0",
"grin_wallet_libwallet 1.1.0", "grin_wallet_libwallet 1.1.0",
"grin_wallet_util 1.1.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -803,8 +785,7 @@ name = "grin_wallet_config"
version = "1.1.0" version = "1.1.0"
dependencies = [ dependencies = [
"dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)", "grin_wallet_util 1.1.0",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
@ -820,15 +801,11 @@ dependencies = [
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_api 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_wallet_api 1.1.0", "grin_wallet_api 1.1.0",
"grin_wallet_config 1.1.0", "grin_wallet_config 1.1.0",
"grin_wallet_impls 1.1.0", "grin_wallet_impls 1.1.0",
"grin_wallet_libwallet 1.1.0", "grin_wallet_libwallet 1.1.0",
"grin_wallet_util 1.1.0",
"hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"prettytable-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "prettytable-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -842,7 +819,7 @@ dependencies = [
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-retry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-retry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (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.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -854,14 +831,9 @@ dependencies = [
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_api 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_wallet_config 1.1.0", "grin_wallet_config 1.1.0",
"grin_wallet_libwallet 1.1.0", "grin_wallet_libwallet 1.1.0",
"grin_wallet_util 1.1.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -871,7 +843,7 @@ dependencies = [
"tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-retry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-retry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -882,18 +854,33 @@ dependencies = [
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)",
"grin_wallet_config 1.1.0", "grin_wallet_config 1.1.0",
"grin_wallet_util 1.1.0",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.6 (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.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "grin_wallet_util"
version = "1.1.0"
dependencies = [
"dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"grin_api 1.1.0",
"grin_chain 1.1.0",
"grin_core 1.1.0",
"grin_keychain 1.1.0",
"grin_store 1.1.0",
"grin_util 1.1.0",
"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.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -970,11 +957,11 @@ dependencies = [
"net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-threadpool 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1356,7 +1343,7 @@ dependencies = [
[[package]] [[package]]
name = "nom" name = "nom"
version = "4.2.2" version = "4.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2154,7 +2141,7 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2214,13 +2201,13 @@ dependencies = [
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-current-thread 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-threadpool 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2248,7 +2235,7 @@ dependencies = [
"mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2256,16 +2243,16 @@ dependencies = [
[[package]] [[package]]
name = "tokio-current-thread" name = "tokio-current-thread"
version = "0.1.5" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "tokio-executor" name = "tokio-executor"
version = "0.1.6" version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2279,7 +2266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-threadpool 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -2305,7 +2292,7 @@ dependencies = [
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2363,7 +2350,7 @@ dependencies = [
[[package]] [[package]]
name = "tokio-threadpool" name = "tokio-threadpool"
version = "0.1.12" version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2374,7 +2361,7 @@ dependencies = [
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -2385,7 +2372,7 @@ dependencies = [
"crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -2526,7 +2513,7 @@ dependencies = [
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2751,15 +2738,7 @@ dependencies = [
"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d"
"checksum git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "591f8be1674b421644b6c030969520bc3fa12114d2eb467471982ed3e9584e71" "checksum git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "591f8be1674b421644b6c030969520bc3fa12114d2eb467471982ed3e9584e71"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum grin_api 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_chain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_core 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_keychain 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_p2p 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_pool 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_secp256k1zkp 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "75e9a265f3eeea4c204470f7262e2c6fe18f3d8ddf5fb24340cb550ac4f909c5" "checksum grin_secp256k1zkp 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "75e9a265f3eeea4c204470f7262e2c6fe18f3d8ddf5fb24340cb550ac4f909c5"
"checksum grin_store 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum grin_util 1.1.0 (git+https://github.com/mimblewimble/grin?branch=milestone/1.1.0)" = "<none>"
"checksum h2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "910a5e7be6283a9c91b3982fa5188368c8719cce2a3cf3b86048673bf9d9c36b" "checksum h2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "910a5e7be6283a9c91b3982fa5188368c8719cce2a3cf3b86048673bf9d9c36b"
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
"checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a" "checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a"
@ -2807,7 +2786,7 @@ dependencies = [
"checksum nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d95c5fa8b641c10ad0b8887454ebaafa3c92b5cd5350f8fc693adafd178e7b" "checksum nix 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d95c5fa8b641c10ad0b8887454ebaafa3c92b5cd5350f8fc693adafd178e7b"
"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
"checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
"checksum nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22293d25d3f33a8567cc8a1dc20f40c7eeb761ce83d0fcca059858580790cac3" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e"
"checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" "checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db"
"checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" "checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1"
@ -2910,8 +2889,8 @@ dependencies = [
"checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" "checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895"
"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f"
"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71"
"checksum tokio-current-thread 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c756b04680eea21902a46fca4e9f410a2332c04995af590e07ff262e2193a9a3" "checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443"
"checksum tokio-executor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30c6dbf2d1ad1de300b393910e8a3aa272b724a400b6531da03eed99e329fbf0" "checksum tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "83ea44c6c0773cc034771693711c35c677b4b5a4b21b9e7071704c54de7d555e"
"checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" "checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af"
"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" "checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926"
"checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" "checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce"
@ -2920,7 +2899,7 @@ dependencies = [
"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
"checksum tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fda385df506bf7546e70872767f71e81640f1f251bdf2fd8eb81a0eaec5fe022" "checksum tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fda385df506bf7546e70872767f71e81640f1f251bdf2fd8eb81a0eaec5fe022"
"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119"
"checksum tokio-threadpool 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "742e511f6ce2298aeb86fc9ea0d8df81c2388c6ebae3dc8a7316e8c9df0df801" "checksum tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ec5759cf26cf9659555f36c431b515e3d05f66831741c85b4b5d5dfb9cf1323c"
"checksum tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2910970404ba6fa78c5539126a9ae2045d62e3713041e447f695f41405a120c6" "checksum tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2910970404ba6fa78c5539126a9ae2045d62e3713041e447f695f41405a120c6"
"checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" "checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92"
"checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445"
@ -2940,7 +2919,7 @@ dependencies = [
"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" "checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
"checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363" "checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363"
"checksum uuid 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0238db0c5b605dd1cf51de0f21766f97fba2645897024461d6a00c036819a768" "checksum uuid 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "600ef8213e9f8a0ac1f876e470e90780ae0478eabce7f76aff41b0f4ef0fd5c0"
"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"

View file

@ -16,7 +16,7 @@ name = "grin-wallet"
path = "src/bin/grin-wallet.rs" path = "src/bin/grin-wallet.rs"
[workspace] [workspace]
members = ["api", "config", "controller", "impls", "libwallet"] members = ["api", "config", "controller", "impls", "libwallet", "util"]
exclude = ["integration"] exclude = ["integration"]
[dependencies] [dependencies]
@ -35,12 +35,7 @@ grin_wallet_libwallet = { path = "./libwallet", version = "1.1.0" }
grin_wallet_controller = { path = "./controller", version = "1.1.0" } grin_wallet_controller = { path = "./controller", version = "1.1.0" }
grin_wallet_config = { path = "./config", version = "1.1.0" } grin_wallet_config = { path = "./config", version = "1.1.0" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" } grin_wallet_util = { path = "./util", version = "1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
[build-dependencies] [build-dependencies]
built = "0.3" built = "0.3"

View file

@ -23,12 +23,7 @@ grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" }
grin_wallet_config = { path = "../config", version = "1.1.0" } grin_wallet_config = { path = "../config", version = "1.1.0" }
grin_wallet_impls = { path = "../impls", version = "1.1.0" } grin_wallet_impls = { path = "../impls", version = "1.1.0" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" } grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
[dev-dependencies] [dev-dependencies]
serde_json = "1" serde_json = "1"

View file

@ -46,6 +46,8 @@ where
/// Wallet, contains its keychain (TODO: Split these up into 2 traits /// Wallet, contains its keychain (TODO: Split these up into 2 traits
/// perhaps) /// perhaps)
pub wallet: Arc<Mutex<W>>, pub wallet: Arc<Mutex<W>>,
/// Flag to normalize some output during testing. Can mostly be ignored.
pub doctest_mode: bool,
phantom: PhantomData<K>, phantom: PhantomData<K>,
phantom_c: PhantomData<C>, phantom_c: PhantomData<C>,
} }
@ -57,19 +59,20 @@ where
K: Keychain, K: Keychain,
{ {
/// Create new API instance /// Create new API instance
pub fn new(wallet_in: Arc<Mutex<W>>) -> Box<Self> { pub fn new(wallet_in: Arc<Mutex<W>>) -> Self {
Box::new(Foreign { Foreign {
wallet: wallet_in, wallet: wallet_in,
doctest_mode: false,
phantom: PhantomData, phantom: PhantomData,
phantom_c: PhantomData, phantom_c: PhantomData,
}) }
} }
/// Build a new (potential) coinbase transaction in the wallet /// Build a new (potential) coinbase transaction in the wallet
pub fn build_coinbase(&self, block_fees: &BlockFees) -> Result<CbData, Error> { pub fn build_coinbase(&self, block_fees: &BlockFees) -> Result<CbData, Error> {
let mut w = self.wallet.lock(); let mut w = self.wallet.lock();
w.open_with_credentials()?; w.open_with_credentials()?;
let res = foreign::build_coinbase(&mut *w, block_fees); let res = foreign::build_coinbase(&mut *w, block_fees, self.doctest_mode);
w.close()?; w.close()?;
res res
} }
@ -88,7 +91,7 @@ where
) -> Result<(), Error> { ) -> Result<(), Error> {
let mut w = self.wallet.lock(); let mut w = self.wallet.lock();
w.open_with_credentials()?; w.open_with_credentials()?;
let res = foreign::receive_tx(&mut *w, slate, dest_acct_name, message, false); let res = foreign::receive_tx(&mut *w, slate, dest_acct_name, message, self.doctest_mode);
w.close()?; w.close()?;
res res
} }

View file

@ -31,28 +31,45 @@ pub trait ForeignRpc {
``` ```
# grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!( # grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!(
# r#"
{ {
"jsonrpc": "2.0", "jsonrpc": "2.0",
"method": "build_coinbase", "method": "build_coinbase",
"id": 1,
"params": [ "params": [
{ {
"fees": 0, "fees": 0,
"height": 0, "height": 0,
"key_id": null "key_id": null
} }
], ]
"id": 1 }
}, # "#
# ,
# r#"
{ {
"id": 1,
"jsonrpc": "2.0", "jsonrpc": "2.0",
"result": { "result": {
"Err": { "Ok": {
"CallbackImpl": "Error opening wallet" "kernel": {
"excess": "08dfe86d732f2dd24bac36aa7502685221369514197c26d33fac03041d47e4b490",
"excess_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f4f0471a33b6465cdb9e72b635f5611aa6c89ebd51aeee038f69b4cc598a02fe0",
"features": "Coinbase",
"fee": "0",
"lock_height": "0"
},
"key_id": "0300000000000000000000000400000000",
"output": {
"commit": "08fe198e525a5937d0c5d01fa354394d2679be6df5d42064a0f7550c332fce3d9d",
"features": "Coinbase",
"proof": "9166dc13a374a50d99f16ddfb228ce6010ea22d1676de755c34123402b5a8e68871b37d716c14e07be14ceb0771cca62a302358aa82922fa87f1387cff3a4507027f04f3fcf54ed16bd97e40a06c6f969139188daca366bb78ccbc7ff0203de62e30077f8b4a8b314901666205d24ca93d54581aa082e37c370e178dea267ff11fa4669756a31c026348255108c4de4b7abe3636ebdd67f25387c9c2868d16fab9209ebee6d19c6395eaf313da67f164d8e997ed97de9478ddb24c34d8a0dcedc24c5d0a9d1c9f15de3264323fc768271d7981b1e2ae1e59675537115fdcd1ea7d60a7bd276865698d1c1598b7c22a1a6e212db4d0a0ba98706a746f63f2d8460a9d28b4e8a7d2ad1f531b32046e2285a034c2d49f7896026fa186f9665766ae158435157f94bd31b8ebf5c0637a9d72036348c1d1fb70659b6ca5e64427a9eb51569074311e970316fd370373149067a0781cd49cc450e80e14a84f9818ae8caf6c02877f15ab11397d60309249658e5a03f49354dce3873118be6f43ca436aa81165ca44d624fd6f504b8d186bca2ef7e3c5ff2b85db86b29ddd0fb58173960caf2b437c8190511685303ab0eb1b5a757e1509529063a145f5242350edb8e1a1807f505866fdb5689fd39d4595cf5084d30a1ba2af882969bf64aecad342926b16930a3d93781dcebc839b7bf5762146e0016c502aad33d24c9e708c810505bd9c6648bd8303ddbbe5c5cf82eb420784223182e1b59286249e38458c885f089e9211b3aafe7c6f85097878679775287423ebca7557cd3be9e44bb454c6b1914b9012e100d601d7a2ecb0c2a07b5e6f0c293b671e45a425d97169eb793834a40a0a64277e68b2809ca4556eed7d130c2ea973021fda08a01c771111b1cc12b647029fe19f1018486a0ef82bbe5ca7ff484c71d52f3238766d771eaf4204793809dc27"
}
} }
}, }
"id": 1
} }
# ); # "#
# , 4, false);
``` ```
*/ */
fn build_coinbase(&self, block_fees: &BlockFees) -> Result<CbData, ErrorKind>; fn build_coinbase(&self, block_fees: &BlockFees) -> Result<CbData, ErrorKind>;
@ -64,95 +81,228 @@ pub trait ForeignRpc {
``` ```
# grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!( # grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!(
# r#"
{ {
"jsonrpc": "2.0", "jsonrpc": "2.0",
"method": "verify_slate_messages", "method": "verify_slate_messages",
"params": [ "id": 1,
{ "params": [ {
"version_info": { "amount": "6000000000",
"version": 2, "fee": "8000000",
"orig_version": 2, "height": "4",
"min_compat_version": 0 "id": "0436430c-2b02-624c-2032-570501212b00",
}, "lock_height": "4",
"amount": 0,
"fee": 0,
"height": 0,
"id": "414bad48-3386-4fa7-8483-72384c886ba3",
"lock_height": 0,
"num_participants": 2, "num_participants": 2,
"participant_data": [], "participant_data": [
{
"id": "0",
"message": "my message",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f756f655333250204644c1cb169e7a78f21b57437930db91e808f39be58134c1d",
"part_sig": null,
"public_blind_excess": "034b4df2f0558b73ea72a1ca5c4ab20217c66bbe0829056fca7abe76888e9349ee",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
],
"tx": { "tx": {
"body": { "body": {
"inputs": [], "inputs": [
"kernels": [], {
"outputs": [] "commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7",
"features": "Coinbase"
}
],
"kernels": [
{
"excess": "000000000000000000000000000000000000000000000000000000000000000000",
"excess_sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"features": "HeightLocked",
"fee": "8000000",
"lock_height": "4"
}
],
"outputs": [
{
"commit": "094be57c91787fc2033d5d97fae099f1a6ddb37ea48370f1a138f09524c767fdd3",
"features": "Plain",
"proof": "2a42e9e902b70ce44e1fccb14de87ee0a97100bddf12c6bead1b9c5f4eb60300f29c13094fa12ffeee238fb4532b18f6b61cf51b23c1c7e1ad2e41560dc27edc0a2b9e647a0b3e4e806fced5b65e61d0f1f5197d3e2285c632d359e27b6b9206b2caffea4f67e0c7a2812e7a22c134b98cf89bd43d9f28b8bec25cce037a0ac5b1ae8f667e54e1250813a5263004486b4465ad4e641ab2b535736ea26535a11013564f08f483b7dab1c2bcc3ee38eadf2f7850eff7e3459a4bbabf9f0cf6c50d0c0a4120565cd4a2ce3e354c11721cd695760a24c70e0d5a0dfc3c5dcd51dfad6de2c237a682f36dc0b271f21bb3655e5333016aaa42c2efa1446e5f3c0a79ec417c4d30f77556951cb0f05dbfafb82d9f95951a9ea241fda2a6388f73ace036b98acce079f0e4feebccc96290a86dcc89118a901210b245f2d114cf94396e4dbb461e82aa26a0581389707957968c7cdc466213bb1cd417db207ef40c05842ab67a01a9b96eb1430ebc26e795bb491258d326d5174ad549401059e41782121e506744af8af9d8e493644a87d613600888541cbbe538c625883f3eb4aa3102c5cfcc25de8e97af8927619ce6a731b3b8462d51d993066b935b0648d2344ad72e4fd70f347fbd81041042e5ea31cc7b2e3156a920b80ecba487b950ca32ca95fae85b759c936246ecf441a9fdd95e8fee932d6782cdec686064018c857efc47fb4b2a122600d5fdd79af2486f44df7e629184e1c573bc0a9b3feb40b190ef2861a1ab45e2ac2201b9cd42e495deea247269820ed32389a2810ad6c0f9a296d2a2d9c54089fed50b7f5ecfcd33ab9954360e1d7f5598c32128cfcf2a1d8bf14616818da8a5343bfa88f0eedf392e9d4ab1ace1b60324129cd4852c2e27813a9cf71a6ae6229a4fcecc1a756b3e664c5f50af333082616815a3bec8fc0b75b8e4e767d719"
}
]
}, },
"offset": "0000000000000000000000000000000000000000000000000000000000000000" "offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"min_compat_version": 0,
"orig_version": 2,
"version": 2
} }
} }
], ]
"id": 1 }
}, # "#
# ,
# r#"
{ {
"jsonrpc": "2.0", "jsonrpc": "2.0",
"id": 1,
"result": { "result": {
"Ok": null "Ok": null
}, }
"id": 1
} }
# ); # "#
# ,1 ,false);
``` ```
*/ */
fn verify_slate_messages(&self, slate: &Slate) -> Result<(), ErrorKind>; fn verify_slate_messages(&self, slate: &Slate) -> Result<(), ErrorKind>;
/** /**
Networked version of [Foreign::receive_tx](struct.Foreign.html#method.receive_tx). Networked version of [Foreign::receive_tx](struct.Foreign.html#method.receive_tx).
# Json rpc example # Json rpc example
```ignore //TODO: No idea why this isn't expanding properly, check as we adjust the API ```
# grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!( # grin_wallet_api::doctest_helper_json_rpc_foreign_assert_response!(
# r#"
{ {
"jsonrpc": "2.0", "jsonrpc": "2.0",
"method": "receive_tx", "method": "receive_tx",
"id": 1,
"params": [ "params": [
{ {
"version_info": { "version_info": {
"version": 2, "version": 2,
"orig_version": 2, "orig_version": 2,
"min_compat_version": 0 "min_compat_version": 0
}, },
"amount": 0, "num_participants": 2,
"fee": 0, "id": "0436430c-2b02-624c-2032-570501212b00",
"height": 0, "tx": {
"id": "414bad48-3386-4fa7-8483-72384c886ba3", "offset": "d202964900000000d302964900000000d402964900000000d502964900000000",
"lock_height": 0, "body": {
"num_participants": 2, "inputs": [
"participant_data": [], {
"tx": { "features": "Coinbase",
"body": { "commit": "087df32304c5d4ae8b2af0bc31e700019d722910ef87dd4eec3197b80b207e3045"
"inputs": [], },
"kernels": [], {
"outputs": [] "features": "Coinbase",
}, "commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7"
"offset": "0000000000000000000000000000000000000000000000000000000000000000" }
],
"outputs": [
{
"features": "Plain",
"commit": "0812276cc788e6870612296d926cba9f0e7b9810670710b5a6e6f1ba006d395774",
"proof": "dcff6175390c602bfa92c2ffd1a9b2d84dcc9ea941f6f317bdd0f875244ef23e696fd17c71df79760ce5ce1a96aab1d15dd057358dc835e972febeb86d50ccec0dad7cfe0246d742eb753cf7b88c045d15bc7123f8cf7155647ccf663fca92a83c9a65d0ed756ea7ebffd2cac90c380a102ed9caaa355d175ed0bf58d3ac2f5e909d6c447dfc6b605e04925c2b17c33ebd1908c965a5541ea5d2ed45a0958e6402f89d7a56df1992e036d836e74017e73ccad5cb3a82b8e139e309792a31b15f3ffd72ed033253428c156c2b9799458a25c1da65b719780a22de7fe7f437ae2fccd22cf7ea357ab5aa66a5ef7d71fb0dc64aa0b5761f68278062bb39bb296c787e4cabc5e2a2933a416ce1c9a9696160386449c437e9120f7bb26e5b0e74d1f2e7d5bcd7aafb2a92b87d1548f1f911fb06af7bd6cc13cee29f7c9cb79021aed18186272af0e9d189ec107c81a8a3aeb4782b0d950e4881aa51b776bb6844b25bce97035b48a9bdb2aea3608687bcdd479d4fa998b5a839ff88558e4a29dff0ed13b55900abb5d439b70793d902ae9ad34587b18c919f6b875c91d14deeb1c373f5e76570d59a6549758f655f1128a54f162dfe8868e1587028e26ad91e528c5ae7ee9335fa58fb59022b5de29d80f0764a9917390d46db899acc6a5b416e25ecc9dccb7153646addcc81cadb5f0078febc7e05d7735aba494f39ef05697bbcc9b47b2ccc79595d75fc13c80678b5e237edce58d731f34c05b1ddcaa649acf2d865bbbc3ceda10508bcdd29d0496744644bf1c3516f6687dfeef5649c7dff90627d642739a59d91a8d1d0c4dc55d74a949e1074427664b467992c9e0f7d3af9d6ea79513e8946ddc0d356bac49878e64e6a95b0a30214214faf2ce317fa622ff3266b32a816e10a18e6d789a5da1f23e67b4f970a68a7bcd9e18825ee274b0483896a40"
}
],
"kernels": [
{
"features": "Plain",
"fee": "7000000",
"lock_height": "0",
"excess": "000000000000000000000000000000000000000000000000000000000000000000",
"excess_sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
]
} }
}, },
null, "amount": "60000000000",
null "fee": "7000000",
], "height": "5",
"id": 1 "lock_height": "0",
}, "participant_data": [
{ {
"jsonrpc": "2.0", "id": "0",
"result": { "public_blind_excess": "033ac2158fa0077f087de60c19d8e431753baa5b63b6e1477f05a2a6e7190d4592",
"Err": { "public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f",
"CallbackImpl": "Error opening wallet" "part_sig": null,
} "message": null,
"message_sig": null
}
]
}, },
"id": 1 null,
"Thanks, Yeastplume"
]
} }
# ); # "#
# ,
# r#"
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"Ok": {
"amount": "60000000000",
"fee": "7000000",
"height": "5",
"id": "0436430c-2b02-624c-2032-570501212b00",
"lock_height": "0",
"num_participants": 2,
"participant_data": [
{
"id": "0",
"message": null,
"message_sig": null,
"part_sig": null,
"public_blind_excess": "033ac2158fa0077f087de60c19d8e431753baa5b63b6e1477f05a2a6e7190d4592",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
},
{
"id": "1",
"message": "Thanks, Yeastplume",
"message_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078ff97f43f2eda0f695161ba23dc48db7a1bcbd7f131f1e21bdb4e1ad1eb2f1a130",
"part_sig": "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078ffc965b05962362aee43e5264bd3fd0f26dbd7092cfe070069e26d2df28bd352b",
"public_blind_excess": "038fe0443243dab173c068ef5fa891b242d2b5eb890ea09475e6e381170442ee16",
"public_nonce": "031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f"
}
],
"tx": {
"body": {
"inputs": [
{
"commit": "087df32304c5d4ae8b2af0bc31e700019d722910ef87dd4eec3197b80b207e3045",
"features": "Coinbase"
},
{
"commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7",
"features": "Coinbase"
}
],
"kernels": [
{
"excess": "000000000000000000000000000000000000000000000000000000000000000000",
"excess_sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"features": "Plain",
"fee": "7000000",
"lock_height": "0"
}
],
"outputs": [
{
"commit": "084ee97defa8c37124d4c69baa753e2532535faa81f79ea5e0489db25297d5beb8",
"features": "Plain",
"proof": "bffb26e7df4bf753f4d8e810c67fb5106b1746c1870f5cb96585537eb8e2f66b372ed05fd35ae18c6e8515cd9f2aaae85d5a7655361c6a8573e20fbdfdda6e0a0b25817fc0db23dc25297382af379659d846bd8044f807c467722708d3a3797b84fceb09eb29f11c77b79c7c93c578d06d95b58d845930531e5cac6346d1373ee1c5db69c14d0aa1a9c22e187dc346156c468540ad166a04902d3faf357ed31a50775d274913ccc9ba976ca3977e18f383b20f0cd02a0866b7b44847bfbba35c099f5eba9c9747cad961033321925f3e0ad43e357aaecc50989bbbcb5b44ead58fe359c59903530c58bf1c9a6f9fb120a3492e835fabc01bb8b31b52b15ace4785a08c3ea9a82bd15c41c744544286b114b1be733fa6237300cf2dc99e8af6f8557bd9a083ba59cc1a500bdfba228b53785a7fdbf576f7dce035769058bc7644041ec5731485e5641eac5c75a6eb57e4abc287b0be8eab77c7e8a5122ee8d49f02f103a3af6fe38b8fcecd1aa9bb342b3e110f4003ee6c771ed93401ca3438dcf0d751a36dbb7a7a45d32709525686f3d2e5f542c747c9c745fe50cd789a0aa55419934afff363044d3c3f5f7669ebb9f2245b449bfdc4e09dfb1661552485107afbd9a2b571a0647b1fc330089a65e4b5df07f58f1a9c11c3da51d56cd854f227c5111d25ca8c4bec4bb0fbcb4a23fc3288418423dd0649d731b6a6c08851954ea920046ce67a4114d35c3876c25361e7a99474aa04354a4ed0555f9bef527d902fbb0d1d5c2b42f5eea5ced359005121167f9908729939dba610cdabca41f714e144ab148faec77f4d70566287671e6786459bd7d16787a24e12f2328b9faab1c7ac80a916d2f83f12a7351a2bedff610d33dfb2df7d8e57b68fb4a5dcc0d8e4fa807b2077877aa96ba7bc22e627a4f6a308d3abc091f56d518258f073cc1b70ef81"
},
{
"commit": "0812276cc788e6870612296d926cba9f0e7b9810670710b5a6e6f1ba006d395774",
"features": "Plain",
"proof": "dcff6175390c602bfa92c2ffd1a9b2d84dcc9ea941f6f317bdd0f875244ef23e696fd17c71df79760ce5ce1a96aab1d15dd057358dc835e972febeb86d50ccec0dad7cfe0246d742eb753cf7b88c045d15bc7123f8cf7155647ccf663fca92a83c9a65d0ed756ea7ebffd2cac90c380a102ed9caaa355d175ed0bf58d3ac2f5e909d6c447dfc6b605e04925c2b17c33ebd1908c965a5541ea5d2ed45a0958e6402f89d7a56df1992e036d836e74017e73ccad5cb3a82b8e139e309792a31b15f3ffd72ed033253428c156c2b9799458a25c1da65b719780a22de7fe7f437ae2fccd22cf7ea357ab5aa66a5ef7d71fb0dc64aa0b5761f68278062bb39bb296c787e4cabc5e2a2933a416ce1c9a9696160386449c437e9120f7bb26e5b0e74d1f2e7d5bcd7aafb2a92b87d1548f1f911fb06af7bd6cc13cee29f7c9cb79021aed18186272af0e9d189ec107c81a8a3aeb4782b0d950e4881aa51b776bb6844b25bce97035b48a9bdb2aea3608687bcdd479d4fa998b5a839ff88558e4a29dff0ed13b55900abb5d439b70793d902ae9ad34587b18c919f6b875c91d14deeb1c373f5e76570d59a6549758f655f1128a54f162dfe8868e1587028e26ad91e528c5ae7ee9335fa58fb59022b5de29d80f0764a9917390d46db899acc6a5b416e25ecc9dccb7153646addcc81cadb5f0078febc7e05d7735aba494f39ef05697bbcc9b47b2ccc79595d75fc13c80678b5e237edce58d731f34c05b1ddcaa649acf2d865bbbc3ceda10508bcdd29d0496744644bf1c3516f6687dfeef5649c7dff90627d642739a59d91a8d1d0c4dc55d74a949e1074427664b467992c9e0f7d3af9d6ea79513e8946ddc0d356bac49878e64e6a95b0a30214214faf2ce317fa622ff3266b32a816e10a18e6d789a5da1f23e67b4f970a68a7bcd9e18825ee274b0483896a40"
}
]
},
"offset": "d202964900000000d302964900000000d402964900000000d502964900000000"
},
"version_info": {
"min_compat_version": 0,
"orig_version": 2,
"version": 2
}
}
}
}
# "#
# , 5, true);
``` ```
*/ */
fn receive_tx( fn receive_tx(
@ -194,52 +344,124 @@ where
} }
} }
/// helper to set up a real environment to run integrated doctests
pub fn run_doctest_foreign(
request: serde_json::Value,
test_dir: &str,
blocks_to_mine: u64,
init_tx: bool,
) -> Result<Option<serde_json::Value>, String> {
use crate::{Foreign, ForeignRpc};
use easy_jsonrpc::Handler;
use grin_wallet_impls::test_framework::{self, LocalWalletClient, WalletProxy};
use grin_wallet_libwallet::api_impl;
use grin_wallet_util::grin_keychain::ExtKeychain;
use crate::core::global;
use crate::core::global::ChainTypes;
use grin_wallet_util::grin_util as util;
use std::fs;
use std::thread;
util::init_test_logger();
let _ = fs::remove_dir_all(test_dir);
global::set_mining_mode(ChainTypes::AutomatedTesting);
let mut wallet_proxy: WalletProxy<LocalWalletClient, ExtKeychain> = WalletProxy::new(test_dir);
let chain = wallet_proxy.chain.clone();
let rec_phrase_1 =
"fat twenty mean degree forget shell check candy immense awful \
flame next during february bulb bike sun wink theory day kiwi embrace peace lunch";
let client1 = LocalWalletClient::new("wallet1", wallet_proxy.tx.clone());
let wallet1 = test_framework::create_wallet(
&format!("{}/wallet1", test_dir),
client1.clone(),
Some(rec_phrase_1),
);
wallet_proxy.add_wallet("wallet1", client1.get_send_instance(), wallet1.clone());
let rec_phrase_2 =
"hour kingdom ripple lunch razor inquiry coyote clay stamp mean \
sell finish magic kid tiny wage stand panther inside settle feed song hole exile";
let client2 = LocalWalletClient::new("wallet2", wallet_proxy.tx.clone());
let wallet2 = test_framework::create_wallet(
&format!("{}/wallet2", test_dir),
client2.clone(),
Some(rec_phrase_2),
);
wallet_proxy.add_wallet("wallet2", client2.get_send_instance(), wallet2.clone());
// Set the wallet proxy listener running
thread::spawn(move || {
if let Err(e) = wallet_proxy.run() {
error!("Wallet Proxy error: {}", e);
}
});
// Mine a few blocks to wallet 1 so there's something to send
for _ in 0..blocks_to_mine {
let _ = test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), 1 as usize, false);
//update local outputs after each block, so transaction IDs stay consistent
let mut w = wallet1.lock();
w.open_with_credentials().unwrap();
let (wallet_refreshed, _) =
api_impl::owner::retrieve_summary_info(&mut *w, true, 1).unwrap();
assert!(wallet_refreshed);
w.close().unwrap();
}
if init_tx {
let amount = 60_000_000_000;
let mut w = wallet1.lock();
w.open_with_credentials().unwrap();
let slate = api_impl::owner::initiate_tx(
&mut *w, None, // account
amount, // amount
2, // minimum confirmations
500, // max outputs
1, // num change outputs
true, // select all outputs
None, None, true,
)
.unwrap();
println!("INIT SLATE");
// Spit out slate for input to finalize_tx
println!("{}", serde_json::to_string_pretty(&slate).unwrap());
}
let mut api_foreign = Foreign::new(wallet1.clone());
api_foreign.doctest_mode = true;
let foreign_api = &api_foreign as &dyn ForeignRpc;
Ok(foreign_api.handle_request(request))
}
#[doc(hidden)] #[doc(hidden)]
#[macro_export] #[macro_export]
macro_rules! doctest_helper_json_rpc_foreign_assert_response { macro_rules! doctest_helper_json_rpc_foreign_assert_response {
($request:tt, $expected_response:tt) => { ($request:expr, $expected_response:expr, $blocks_to_mine:expr, $init_tx:expr) => {
// create temporary wallet, run jsonrpc request on api of wallet, delete wallet, return // create temporary wallet, run jsonrpc request on owner api of wallet, delete wallet, return
// json response. // json response.
// In order to prevent leaking tempdirs, This function should not panic. // In order to prevent leaking tempdirs, This function should not panic.
fn rpc_owner_result( use grin_wallet_api::run_doctest_foreign;
request: serde_json::Value, use serde_json;
) -> Result<Option<serde_json::Value>, String> { use serde_json::Value;
use easy_jsonrpc::Handler; use tempfile::tempdir;
use grin_keychain::ExtKeychain;
use grin_util::Mutex;
use grin_wallet_api::{Foreign, ForeignRpc};
use grin_wallet_config::WalletConfig;
use grin_wallet_impls::{HTTPNodeClient, LMDBBackend};
use grin_wallet_libwallet::types::WalletBackend;
use serde_json;
use std::sync::Arc;
use tempfile::tempdir;
let dir = tempdir().map_err(|e| format!("{:#?}", e))?; let dir = tempdir().map_err(|e| format!("{:#?}", e)).unwrap();
{ let dir = dir
let mut wallet_config = WalletConfig::default(); .path()
wallet_config.data_file_dir = dir .to_str()
.path() .ok_or("Failed to convert tmpdir path to string.".to_owned())
.to_str() .unwrap();
.ok_or("Failed to convert tmpdir path to string.".to_owned())?
.to_owned();
let node_client =
HTTPNodeClient::new(&wallet_config.check_node_api_http_addr, None);
let wallet: Arc<Mutex<WalletBackend<HTTPNodeClient, ExtKeychain>>> =
Arc::new(Mutex::new(
LMDBBackend::new(wallet_config.clone(), "", node_client)
.map_err(|e| format!("{:#?}", e))?,
));
let api_foreign = *Foreign::new(wallet);
let foreign_api = &api_foreign as &dyn ForeignRpc;
Ok(foreign_api.handle_request(request))
}
}
let response = rpc_owner_result(serde_json::json!($request)) let request_val: Value = serde_json::from_str($request).unwrap();
let expected_response: Value = serde_json::from_str($expected_response).unwrap();
let response = run_doctest_foreign(request_val, dir, $blocks_to_mine, $init_tx)
.unwrap() .unwrap()
.unwrap(); .unwrap();
let expected_response = serde_json::json!($expected_response);
if response != expected_response { if response != expected_response {
panic!( panic!(

View file

@ -22,10 +22,9 @@
#![deny(unused_mut)] #![deny(unused_mut)]
#![warn(missing_docs)] #![warn(missing_docs)]
extern crate grin_core as core; use grin_wallet_util::grin_core as core;
extern crate grin_keychain as keychain; use grin_wallet_util::grin_keychain as keychain;
extern crate grin_store as store; use grin_wallet_util::grin_util as util;
extern crate grin_util as util;
extern crate grin_wallet_libwallet as libwallet; extern crate grin_wallet_libwallet as libwallet;
extern crate failure_derive; extern crate failure_derive;
@ -43,4 +42,5 @@ pub use crate::foreign_rpc::ForeignRpc;
pub use crate::owner::Owner; pub use crate::owner::Owner;
pub use crate::owner_rpc::OwnerRpc; pub use crate::owner_rpc::OwnerRpc;
pub use crate::owner_rpc::run_doctest; pub use crate::foreign_rpc::run_doctest_foreign;
pub use crate::owner_rpc::run_doctest_owner;

View file

@ -81,8 +81,8 @@ where
/// ///
/// # Example /// # Example
/// ``` /// ```
/// use grin_keychain as keychain; /// use grin_wallet_util::grin_keychain as keychain;
/// use grin_util as util; /// use grin_wallet_util::grin_util as util;
/// use grin_wallet_api as api; /// use grin_wallet_api as api;
/// use grin_wallet_config as config; /// use grin_wallet_config as config;
/// use grin_wallet_impls as impls; /// use grin_wallet_impls as impls;
@ -946,12 +946,12 @@ where
#[macro_export] #[macro_export]
macro_rules! doctest_helper_setup_doc_env { macro_rules! doctest_helper_setup_doc_env {
($wallet:ident, $wallet_config:ident) => { ($wallet:ident, $wallet_config:ident) => {
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_api as api; use grin_wallet_api as api;
use grin_wallet_config as config; use grin_wallet_config as config;
use grin_wallet_impls as impls; use grin_wallet_impls as impls;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use keychain::ExtKeychain; use keychain::ExtKeychain;
use tempfile::tempdir; use tempfile::tempdir;

View file

@ -22,7 +22,7 @@ use crate::libwallet::types::{
AcctPathMapping, NodeClient, OutputCommitMapping, TxEstimation, TxLogEntry, WalletBackend, AcctPathMapping, NodeClient, OutputCommitMapping, TxEstimation, TxLogEntry, WalletBackend,
WalletInfo, WalletInfo,
}; };
use crate::libwallet::{api_impl, ErrorKind}; use crate::libwallet::ErrorKind;
use crate::Owner; use crate::Owner;
use easy_jsonrpc; use easy_jsonrpc;
@ -1171,7 +1171,7 @@ where
} }
/// helper to set up a real environment to run integrated doctests /// helper to set up a real environment to run integrated doctests
pub fn run_doctest( pub fn run_doctest_owner(
request: serde_json::Value, request: serde_json::Value,
test_dir: &str, test_dir: &str,
blocks_to_mine: u64, blocks_to_mine: u64,
@ -1181,12 +1181,13 @@ pub fn run_doctest(
) -> Result<Option<serde_json::Value>, String> { ) -> Result<Option<serde_json::Value>, String> {
use crate::{Owner, OwnerRpc}; use crate::{Owner, OwnerRpc};
use easy_jsonrpc::Handler; use easy_jsonrpc::Handler;
use grin_keychain::ExtKeychain;
use grin_wallet_impls::test_framework::{self, LocalWalletClient, WalletProxy}; use grin_wallet_impls::test_framework::{self, LocalWalletClient, WalletProxy};
use grin_wallet_libwallet::api_impl;
use grin_wallet_util::grin_keychain::ExtKeychain;
use crate::core::global; use crate::core::global;
use crate::core::global::ChainTypes; use crate::core::global::ChainTypes;
use grin_util as util; use grin_wallet_util::grin_util as util;
use std::fs; use std::fs;
use std::thread; use std::thread;
@ -1289,7 +1290,7 @@ macro_rules! doctest_helper_json_rpc_owner_assert_response {
// create temporary wallet, run jsonrpc request on owner api of wallet, delete wallet, return // create temporary wallet, run jsonrpc request on owner api of wallet, delete wallet, return
// json response. // json response.
// In order to prevent leaking tempdirs, This function should not panic. // In order to prevent leaking tempdirs, This function should not panic.
use grin_wallet_api::run_doctest; use grin_wallet_api::run_doctest_owner;
use serde_json; use serde_json;
use serde_json::Value; use serde_json::Value;
use tempfile::tempdir; use tempfile::tempdir;
@ -1304,7 +1305,7 @@ macro_rules! doctest_helper_json_rpc_owner_assert_response {
let request_val: Value = serde_json::from_str($request).unwrap(); let request_val: Value = serde_json::from_str($request).unwrap();
let expected_response: Value = serde_json::from_str($expected_response).unwrap(); let expected_response: Value = serde_json::from_str($expected_response).unwrap();
let response = run_doctest( let response = run_doctest_owner(
request_val, request_val,
dir, dir,
$blocks_to_mine, $blocks_to_mine,

View file

@ -16,8 +16,7 @@ serde_derive = "1"
toml = "0.4" toml = "0.4"
dirs = "1.0.3" dirs = "1.0.3"
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" } grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
[dev-dependencies] [dev-dependencies]
pretty_assertions = "0.5.1" pretty_assertions = "0.5.1"

View file

@ -27,11 +27,9 @@ use toml;
use crate::comments::insert_comments; use crate::comments::insert_comments;
use crate::core::global; use crate::core::global;
use crate::types::{
ConfigError, GlobalWalletConfig, GlobalWalletConfigMembers,
};
use crate::util::LoggingConfig;
use crate::types::WalletConfig; use crate::types::WalletConfig;
use crate::types::{ConfigError, GlobalWalletConfig, GlobalWalletConfigMembers};
use crate::util::LoggingConfig;
/// Wallet configuration file name /// Wallet configuration file name
pub const WALLET_CONFIG_FILE_NAME: &'static str = "grin-wallet.toml"; pub const WALLET_CONFIG_FILE_NAME: &'static str = "grin-wallet.toml";

View file

@ -23,8 +23,8 @@
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
use grin_core as core; use grin_wallet_util::grin_core as core;
use grin_util as util; use grin_wallet_util::grin_util as util;
mod comments; mod comments;
pub mod config; pub mod config;

View file

@ -31,13 +31,9 @@ uuid = { version = "0.7", features = ["serde", "v4"] }
url = "1.7.0" url = "1.7.0"
chrono = { version = "0.4.4", features = ["serde"] } chrono = { version = "0.4.4", features = ["serde"] }
grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_wallet_api = { path = "../api", version = "1.1.0" } grin_wallet_api = { path = "../api", version = "1.1.0" }
grin_wallet_impls = { path = "../impls", version = "1.1.0" } grin_wallet_impls = { path = "../impls", version = "1.1.0" }
grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" } grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" }
grin_wallet_config = { path = "../config", version = "1.1.0" } grin_wallet_config = { path = "../config", version = "1.1.0" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }

View file

@ -138,7 +138,7 @@ pub fn listen(config: &WalletConfig, args: &ListenArgs, g_args: &GlobalArgs) ->
)?; )?;
let listen_addr = params.get("api_listen_addr").unwrap(); let listen_addr = params.get("api_listen_addr").unwrap();
let tls_conf = match params.get("certificate") { let tls_conf = match params.get("certificate") {
Some(s) => Some(grin_api::TLSConfig::new( Some(s) => Some(TLSConfig::new(
s.to_owned(), s.to_owned(),
params.get("private_key").unwrap().to_owned(), params.get("private_key").unwrap().to_owned(),
)), )),

View file

@ -684,7 +684,7 @@ where
} }
fn handle_request(&self, req: Request<Body>) -> WalletResponseFuture { fn handle_request(&self, req: Request<Body>) -> WalletResponseFuture {
let api = *Foreign::new(self.wallet.clone()); let api = Foreign::new(self.wallet.clone());
match req match req
.uri() .uri()
.path() .path()

View file

@ -20,14 +20,14 @@ extern crate prettytable;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
use failure; use failure;
use grin_api as api;
extern crate grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_api as apiwallet; use grin_wallet_api as apiwallet;
use grin_wallet_config as config;
use grin_wallet_impls as impls; use grin_wallet_impls as impls;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
extern crate grin_wallet_config as config; use grin_wallet_util::grin_api as api;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
pub mod command; pub mod command;
pub mod controller; pub mod controller;

View file

@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet; extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::{ExtKeychain, Keychain}; use self::keychain::{ExtKeychain, Keychain};
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs; use std::fs;

View file

@ -17,13 +17,14 @@ extern crate log;
extern crate grin_wallet_controller as wallet; extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::consensus; use self::core::consensus;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::ExtKeychain; use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter; use impls::FileWalletCommAdapter;

View file

@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet; extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::ExtKeychain; use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter; use impls::FileWalletCommAdapter;

View file

@ -18,13 +18,14 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet; extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::ExtKeychain; use self::keychain::ExtKeychain;
use self::libwallet::slate::Slate; use self::libwallet::slate::Slate;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use impls::FileWalletCommAdapter; use impls::FileWalletCommAdapter;
use std::fs; use std::fs;

View file

@ -18,14 +18,15 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet; extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::{ExtKeychain, Identifier, Keychain}; use self::keychain::{ExtKeychain, Identifier, Keychain};
use self::libwallet::slate::Slate; use self::libwallet::slate::Slate;
use self::libwallet::types::AcctPathMapping; use self::libwallet::types::AcctPathMapping;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs; use std::fs;
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;

View file

@ -17,12 +17,13 @@ extern crate log;
extern crate grin_wallet_controller as wallet; extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::ExtKeychain; use self::keychain::ExtKeychain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs; use std::fs;

View file

@ -18,15 +18,16 @@ extern crate grin_wallet_controller as wallet;
extern crate grin_wallet_impls as impls; extern crate grin_wallet_impls as impls;
extern crate grin_wallet_libwallet as libwallet; extern crate grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_util as util;
use self::core::core::transaction; use self::core::core::transaction;
use self::core::global; use self::core::global;
use self::core::global::ChainTypes; use self::core::global::ChainTypes;
use self::keychain::ExtKeychain; use self::keychain::ExtKeychain;
use self::libwallet::slate::Slate; use self::libwallet::slate::Slate;
use self::libwallet::types::OutputStatus; use self::libwallet::types::OutputStatus;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use impls::test_framework::{self, LocalWalletClient, WalletProxy}; use impls::test_framework::{self, LocalWalletClient, WalletProxy};
use std::fs; use std::fs;
use std::thread; use std::thread;

View file

@ -27,12 +27,7 @@ tokio-retry = "0.1"
uuid = { version = "0.7", features = ["serde", "v4"] } uuid = { version = "0.7", features = ["serde", "v4"] }
chrono = { version = "0.4.4", features = ["serde"] } chrono = { version = "0.4.4", features = ["serde"] }
grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" } grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0" }
grin_wallet_config = { path = "../config", version = "1.1.0" } grin_wallet_config = { path = "../config", version = "1.1.0" }
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }

View file

@ -22,12 +22,13 @@ use blake2_rfc as blake2;
extern crate serde_derive; extern crate serde_derive;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
extern crate grin_core as core;
use grin_api as api;
use grin_keychain as keychain;
use grin_store as store;
use grin_util as util;
use grin_wallet_libwallet as libwallet; use grin_wallet_libwallet as libwallet;
use grin_wallet_util::grin_api as api;
use grin_wallet_util::grin_chain as chain;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use grin_wallet_util::grin_store as store;
use grin_wallet_util::grin_util as util;
extern crate grin_wallet_config as config; extern crate grin_wallet_config as config;
mod adapters; mod adapters;

View file

@ -12,25 +12,25 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use self::chain::Chain; use crate::api;
use self::core::core::{OutputFeatures, OutputIdentifier, Transaction}; use crate::chain;
use self::core::{consensus, global, pow, ser}; use crate::chain::Chain;
use self::util::secp::pedersen;
use self::util::Mutex;
use crate::config::WalletConfig; use crate::config::WalletConfig;
use crate::core;
use crate::core::core::{OutputFeatures, OutputIdentifier, Transaction};
use crate::core::{consensus, global, pow};
use crate::keychain;
use crate::libwallet; use crate::libwallet;
use crate::libwallet::api_impl::{foreign, owner}; use crate::libwallet::api_impl::{foreign, owner};
use crate::libwallet::types::{ use crate::libwallet::types::{
BlockFees, CbData, NodeClient, WalletBackend, WalletInfo, WalletInst, BlockFees, CbData, NodeClient, WalletBackend, WalletInfo, WalletInst,
}; };
use crate::lmdb_wallet::LMDBBackend; use crate::lmdb_wallet::LMDBBackend;
use crate::util;
use crate::util::secp::pedersen;
use crate::util::Mutex;
use crate::WalletSeed; use crate::WalletSeed;
use chrono::Duration; use chrono::Duration;
use grin_api as api;
use grin_chain as chain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use std::sync::Arc; use std::sync::Arc;
use std::thread; use std::thread;
@ -79,15 +79,11 @@ fn get_outputs_by_pmmr_index_local(
pub fn add_block_with_reward(chain: &Chain, txs: Vec<&Transaction>, reward: CbData) { pub fn add_block_with_reward(chain: &Chain, txs: Vec<&Transaction>, reward: CbData) {
let prev = chain.head_header().unwrap(); let prev = chain.head_header().unwrap();
let next_header_info = consensus::next_difficulty(1, chain.difficulty_iter()); let next_header_info = consensus::next_difficulty(1, chain.difficulty_iter());
let out_bin = util::from_hex(reward.output).unwrap();
let kern_bin = util::from_hex(reward.kernel).unwrap();
let output = ser::deserialize(&mut &out_bin[..]).unwrap();
let kernel = ser::deserialize(&mut &kern_bin[..]).unwrap();
let mut b = core::core::Block::new( let mut b = core::core::Block::new(
&prev, &prev,
txs.into_iter().cloned().collect(), txs.into_iter().cloned().collect(),
next_header_info.clone().difficulty, next_header_info.clone().difficulty,
(output, kernel), (reward.output, reward.kernel),
) )
.unwrap(); .unwrap();
b.header.timestamp = prev.timestamp + Duration::seconds(60); b.header.timestamp = prev.timestamp + Duration::seconds(60);
@ -128,7 +124,7 @@ where
let coinbase_tx = { let coinbase_tx = {
let mut w = wallet.lock(); let mut w = wallet.lock();
w.open_with_credentials()?; w.open_with_credentials()?;
let res = foreign::build_coinbase(&mut *w, &block_fees)?; let res = foreign::build_coinbase(&mut *w, &block_fees, false)?;
w.close()?; w.close()?;
res res
}; };

View file

@ -16,27 +16,24 @@
//! so that wallet API can be fully exercised //! so that wallet API can be fully exercised
//! Operates directly on a chain instance //! Operates directly on a chain instance
use self::chain::types::NoopAdapter; use crate::api;
use self::chain::Chain; use crate::chain::types::NoopAdapter;
use self::core::core::verifier_cache::LruVerifierCache; use crate::chain::Chain;
use self::core::core::Transaction;
use self::core::global::{set_mining_mode, ChainTypes};
use self::core::{pow, ser};
use self::keychain::Keychain;
use self::util::secp::pedersen;
use self::util::secp::pedersen::Commitment;
use self::util::{Mutex, RwLock, StopState};
use crate::config::WalletConfig; use crate::config::WalletConfig;
use crate::core::core::verifier_cache::LruVerifierCache;
use crate::core::core::Transaction;
use crate::core::global::{set_mining_mode, ChainTypes};
use crate::core::{pow, ser};
use crate::keychain::Keychain;
use crate::libwallet::api_impl::foreign; use crate::libwallet::api_impl::foreign;
use crate::libwallet::slate::Slate; use crate::libwallet::slate::Slate;
use crate::libwallet::types::*; use crate::libwallet::types::*;
use crate::util;
use crate::util::secp::pedersen;
use crate::util::secp::pedersen::Commitment;
use crate::util::{Mutex, RwLock, StopState};
use crate::{libwallet, WalletCommAdapter}; use crate::{libwallet, WalletCommAdapter};
use failure::ResultExt; use failure::ResultExt;
use grin_api as api;
use grin_chain as chain;
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use serde_json; use serde_json;
use std::collections::HashMap; use std::collections::HashMap;
use std::marker::PhantomData; use std::marker::PhantomData;

View file

@ -24,10 +24,7 @@ uuid = { version = "0.7", features = ["serde", "v4"] }
chrono = { version = "0.4.4", features = ["serde"] } chrono = { version = "0.4.4", features = ["serde"] }
lazy_static = "1" lazy_static = "1"
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" } grin_wallet_util = { path = "../util", version = "1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
[dev-dependencies] [dev-dependencies]
grin_wallet_config = { path = "../config", version = "1.1.0" } grin_wallet_config = { path = "../config", version = "1.1.0" }

View file

@ -14,8 +14,8 @@
//! Generic implementation of owner API functions //! Generic implementation of owner API functions
use crate::grin_keychain::Keychain;
use crate::internal::{tx, updater}; use crate::internal::{tx, updater};
use crate::keychain::Keychain;
use crate::slate::Slate; use crate::slate::Slate;
use crate::types::{BlockFees, CbData, NodeClient, TxLogEntryType, WalletBackend}; use crate::types::{BlockFees, CbData, NodeClient, TxLogEntryType, WalletBackend};
use crate::{Error, ErrorKind}; use crate::{Error, ErrorKind};
@ -23,13 +23,17 @@ use crate::{Error, ErrorKind};
const USER_MESSAGE_MAX_LEN: usize = 256; const USER_MESSAGE_MAX_LEN: usize = 256;
/// Build a coinbase transaction /// Build a coinbase transaction
pub fn build_coinbase<T: ?Sized, C, K>(w: &mut T, block_fees: &BlockFees) -> Result<CbData, Error> pub fn build_coinbase<T: ?Sized, C, K>(
w: &mut T,
block_fees: &BlockFees,
test_mode: bool,
) -> Result<CbData, Error>
where where
T: WalletBackend<C, K>, T: WalletBackend<C, K>,
C: NodeClient, C: NodeClient,
K: Keychain, K: Keychain,
{ {
updater::build_coinbase(&mut *w, block_fees) updater::build_coinbase(&mut *w, block_fees, test_mode)
} }
/// verify slate messages /// verify slate messages
@ -61,7 +65,13 @@ where
None => w.parent_key_id(), None => w.parent_key_id(),
}; };
// Don't do this multiple times // Don't do this multiple times
let tx = updater::retrieve_txs(&mut *w, None, Some(slate.id), Some(&parent_key_id), false)?; let tx = updater::retrieve_txs(
&mut *w,
None,
Some(slate.id),
Some(&parent_key_id),
use_test_rng,
)?;
for t in &tx { for t in &tx {
if t.tx_type == TxLogEntryType::TxReceived { if t.tx_type == TxLogEntryType::TxReceived {
return Err(ErrorKind::TransactionAlreadyReceived(slate.id.to_string()).into()); return Err(ErrorKind::TransactionAlreadyReceived(slate.id.to_string()).into());

View file

@ -16,12 +16,13 @@
use uuid::Uuid; use uuid::Uuid;
use crate::core::core::hash::Hashed; use crate::grin_core::core::hash::Hashed;
use crate::core::core::Transaction; use crate::grin_core::core::Transaction;
use crate::core::ser; use crate::grin_core::ser;
use crate::grin_util;
use crate::grin_keychain::{Identifier, Keychain};
use crate::internal::{keys, selection, tx, updater}; use crate::internal::{keys, selection, tx, updater};
use crate::keychain::{Identifier, Keychain};
use crate::slate::Slate; use crate::slate::Slate;
use crate::types::{ use crate::types::{
AcctPathMapping, NodeClient, OutputCommitMapping, TxEstimation, TxLogEntry, TxWrapper, AcctPathMapping, NodeClient, OutputCommitMapping, TxEstimation, TxLogEntry, TxWrapper,
@ -305,7 +306,7 @@ pub fn post_tx<C>(client: &C, tx: &Transaction, fluff: bool) -> Result<(), Error
where where
C: NodeClient, C: NodeClient,
{ {
let tx_hex = util::to_hex(ser::ser_vec(tx).unwrap()); let tx_hex = grin_util::to_hex(ser::ser_vec(tx).unwrap());
let res = client.post_tx(&TxWrapper { tx_hex: tx_hex }, fluff); let res = client.post_tx(&TxWrapper { tx_hex: tx_hex }, fluff);
if let Err(e) = res { if let Err(e) = res {
error!("api: post_tx: failed with error: {}", e); error!("api: post_tx: failed with error: {}", e);

View file

@ -14,10 +14,11 @@
//! Error types for libwallet //! Error types for libwallet
use crate::core::core::{committed, transaction}; use crate::grin_core::core::{committed, transaction};
use crate::core::libtx; use crate::grin_core::libtx;
use crate::keychain; use crate::grin_keychain;
use crate::util::secp; use crate::grin_store;
use crate::grin_util::secp;
use failure::{Backtrace, Context, Fail}; use failure::{Backtrace, Context, Fail};
use std::env; use std::env;
use std::fmt::{self, Display}; use std::fmt::{self, Display};
@ -58,7 +59,7 @@ pub enum ErrorKind {
/// Keychain error /// Keychain error
#[fail(display = "Keychain error")] #[fail(display = "Keychain error")]
Keychain(keychain::Error), Keychain(grin_keychain::Error),
/// Transaction Error /// Transaction Error
#[fail(display = "Transaction error")] #[fail(display = "Transaction error")]
@ -90,7 +91,7 @@ pub enum ErrorKind {
/// Other serialization errors /// Other serialization errors
#[fail(display = "Ser/Deserialization error")] #[fail(display = "Ser/Deserialization error")]
Deser(crate::core::ser::Error), Deser(crate::grin_core::ser::Error),
/// IO Error /// IO Error
#[fail(display = "I/O error")] #[fail(display = "I/O error")]
@ -263,8 +264,8 @@ impl From<io::Error> for Error {
} }
} }
impl From<keychain::Error> for Error { impl From<grin_keychain::Error> for Error {
fn from(error: keychain::Error) -> Error { fn from(error: grin_keychain::Error) -> Error {
Error { Error {
inner: Context::new(ErrorKind::Keychain(error)), inner: Context::new(ErrorKind::Keychain(error)),
} }
@ -272,7 +273,7 @@ impl From<keychain::Error> for Error {
} }
impl From<libtx::Error> for Error { impl From<libtx::Error> for Error {
fn from(error: crate::core::libtx::Error) -> Error { fn from(error: crate::grin_core::libtx::Error) -> Error {
Error { Error {
inner: Context::new(ErrorKind::LibTX(error.kind())), inner: Context::new(ErrorKind::LibTX(error.kind())),
} }
@ -287,8 +288,8 @@ impl From<transaction::Error> for Error {
} }
} }
impl From<crate::core::ser::Error> for Error { impl From<crate::grin_core::ser::Error> for Error {
fn from(error: crate::core::ser::Error) -> Error { fn from(error: crate::grin_core::ser::Error) -> Error {
Error { Error {
inner: Context::new(ErrorKind::Deser(error)), inner: Context::new(ErrorKind::Deser(error)),
} }
@ -311,8 +312,8 @@ impl From<committed::Error> for Error {
} }
} }
impl From<store::Error> for Error { impl From<grin_store::Error> for Error {
fn from(error: store::Error) -> Error { fn from(error: grin_store::Error) -> Error {
Error::from(ErrorKind::Backend(format!("{}", error))) Error::from(ErrorKind::Backend(format!("{}", error)))
} }
} }

View file

@ -14,7 +14,7 @@
//! Wallet key management functions //! Wallet key management functions
use crate::error::{Error, ErrorKind}; use crate::error::{Error, ErrorKind};
use crate::keychain::{ChildNumber, ExtKeychain, Identifier, Keychain}; use crate::grin_keychain::{ChildNumber, ExtKeychain, Identifier, Keychain};
use crate::types::{AcctPathMapping, NodeClient, WalletBackend}; use crate::types::{AcctPathMapping, NodeClient, WalletBackend};
/// Get next available key in the wallet for a given parent /// Get next available key in the wallet for a given parent

View file

@ -13,12 +13,12 @@
// limitations under the License. // limitations under the License.
//! Functions to restore a wallet's outputs from just the master seed //! Functions to restore a wallet's outputs from just the master seed
use crate::core::global; use crate::grin_core::global;
use crate::core::libtx::proof; use crate::grin_core::libtx::proof;
use crate::grin_keychain::{ExtKeychain, Identifier, Keychain};
use crate::grin_util::secp::{key::SecretKey, pedersen};
use crate::internal::{keys, updater}; use crate::internal::{keys, updater};
use crate::keychain::{ExtKeychain, Identifier, Keychain};
use crate::types::*; use crate::types::*;
use crate::util::secp::{key::SecretKey, pedersen};
use crate::Error; use crate::Error;
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -14,11 +14,11 @@
//! Selection of inputs for building transactions //! Selection of inputs for building transactions
use crate::core::core::amount_to_hr_string;
use crate::core::libtx::{build, tx_fee};
use crate::error::{Error, ErrorKind}; use crate::error::{Error, ErrorKind};
use crate::grin_core::core::amount_to_hr_string;
use crate::grin_core::libtx::{build, tx_fee};
use crate::grin_keychain::{Identifier, Keychain};
use crate::internal::keys; use crate::internal::keys;
use crate::keychain::{Identifier, Keychain};
use crate::slate::Slate; use crate::slate::Slate;
use crate::types::*; use crate::types::*;
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -16,12 +16,12 @@
use uuid::Uuid; use uuid::Uuid;
use crate::grin_keychain::{Identifier, Keychain};
use crate::grin_util::Mutex;
use crate::internal::{selection, updater}; use crate::internal::{selection, updater};
use crate::keychain::{Identifier, Keychain};
use crate::slate::Slate; use crate::slate::Slate;
use crate::types::{Context, NodeClient, TxLogEntryType, WalletBackend}; use crate::types::{Context, NodeClient, TxLogEntryType, WalletBackend};
use crate::{Error, ErrorKind}; use crate::{Error, ErrorKind};
use util::Mutex;
/// static for incrementing test UUIDs /// static for incrementing test UUIDs
lazy_static! { lazy_static! {
@ -186,7 +186,7 @@ where
&context.sec_nonce, &context.sec_nonce,
1, 1,
message, message,
false, use_test_rng,
)?; )?;
// perform partial sig // perform partial sig
@ -307,8 +307,8 @@ where
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::core::libtx::build; use crate::grin_core::libtx::build;
use crate::keychain::{ExtKeychain, ExtKeychainPath, Keychain}; use crate::grin_keychain::{ExtKeychain, ExtKeychainPath, Keychain};
#[test] #[test]
// demonstrate that input.commitment == referenced output.commitment // demonstrate that input.commitment == referenced output.commitment

View file

@ -15,23 +15,22 @@
//! Utilities to check the status of all the outputs we have stored in //! Utilities to check the status of all the outputs we have stored in
//! the wallet storage and update them. //! the wallet storage and update them.
use failure::ResultExt;
use std::collections::HashMap; use std::collections::HashMap;
use uuid::Uuid; use uuid::Uuid;
use crate::core::consensus::reward; use crate::error::Error;
use crate::core::core::{Output, TxKernel}; use crate::grin_core::consensus::reward;
use crate::core::libtx::reward; use crate::grin_core::core::{Output, TxKernel};
use crate::core::{global, ser}; use crate::grin_core::global;
use crate::error::{Error, ErrorKind}; use crate::grin_core::libtx::reward;
use crate::grin_keychain::{Identifier, Keychain};
use crate::grin_util as util;
use crate::grin_util::secp::pedersen;
use crate::internal::keys; use crate::internal::keys;
use crate::keychain::{Identifier, Keychain};
use crate::types::{ use crate::types::{
BlockFees, CbData, NodeClient, OutputCommitMapping, OutputData, OutputStatus, TxLogEntry, BlockFees, CbData, NodeClient, OutputCommitMapping, OutputData, OutputStatus, TxLogEntry,
TxLogEntryType, WalletBackend, WalletInfo, TxLogEntryType, WalletBackend, WalletInfo,
}; };
use crate::util;
use crate::util::secp::pedersen;
/// Retrieve all of the outputs (doesn't attempt to update from node) /// Retrieve all of the outputs (doesn't attempt to update from node)
pub fn retrieve_outputs<T: ?Sized, C, K>( pub fn retrieve_outputs<T: ?Sized, C, K>(
@ -433,27 +432,19 @@ where
pub fn build_coinbase<T: ?Sized, C, K>( pub fn build_coinbase<T: ?Sized, C, K>(
wallet: &mut T, wallet: &mut T,
block_fees: &BlockFees, block_fees: &BlockFees,
test_mode: bool,
) -> Result<CbData, Error> ) -> Result<CbData, Error>
where where
T: WalletBackend<C, K>, T: WalletBackend<C, K>,
C: NodeClient, C: NodeClient,
K: Keychain, K: Keychain,
{ {
let (out, kern, block_fees) = receive_coinbase(wallet, block_fees).context(ErrorKind::Node)?; let (out, kern, block_fees) = receive_coinbase(wallet, block_fees, test_mode)?;
let out_bin = ser::ser_vec(&out).context(ErrorKind::Node)?;
let kern_bin = ser::ser_vec(&kern).context(ErrorKind::Node)?;
let key_id_bin = match block_fees.key_id {
Some(key_id) => ser::ser_vec(&key_id).context(ErrorKind::Node)?,
None => vec![],
};
Ok(CbData { Ok(CbData {
output: util::to_hex(out_bin), output: out,
kernel: util::to_hex(kern_bin), kernel: kern,
key_id: util::to_hex(key_id_bin), key_id: block_fees.key_id,
}) })
} }
@ -462,6 +453,7 @@ where
pub fn receive_coinbase<T: ?Sized, C, K>( pub fn receive_coinbase<T: ?Sized, C, K>(
wallet: &mut T, wallet: &mut T,
block_fees: &BlockFees, block_fees: &BlockFees,
test_mode: bool,
) -> Result<(Output, TxKernel, BlockFees), Error> ) -> Result<(Output, TxKernel, BlockFees), Error>
where where
T: WalletBackend<C, K>, T: WalletBackend<C, K>,
@ -513,7 +505,6 @@ where
debug!("receive_coinbase: {:?}", block_fees); debug!("receive_coinbase: {:?}", block_fees);
let (out, kern) = reward::output(wallet.keychain(), &key_id, block_fees.fees).unwrap(); let (out, kern) = reward::output(wallet.keychain(), &key_id, block_fees.fees, test_mode)?;
/* .context(ErrorKind::Keychain)?; */
Ok((out, kern, block_fees)) Ok((out, kern, block_fees))
} }

View file

@ -22,11 +22,10 @@
#![deny(unused_mut)] #![deny(unused_mut)]
#![warn(missing_docs)] #![warn(missing_docs)]
#[macro_use] use grin_wallet_util::grin_core;
extern crate grin_core as core; use grin_wallet_util::grin_keychain;
extern crate grin_keychain as keychain; use grin_wallet_util::grin_store;
extern crate grin_store as store; use grin_wallet_util::grin_util;
extern crate grin_util as util;
use blake2_rfc as blake2; use blake2_rfc as blake2;

View file

@ -17,17 +17,19 @@
use crate::blake2::blake2b::blake2b; use crate::blake2::blake2b::blake2b;
use crate::error::{Error, ErrorKind}; use crate::error::{Error, ErrorKind};
use crate::keychain::{BlindSum, BlindingFactor, Keychain}; use crate::grin_core::core::amount_to_hr_string;
use crate::util::secp; use crate::grin_core::core::committed::Committed;
use crate::util::secp::key::{PublicKey, SecretKey}; use crate::grin_core::core::transaction::{
use crate::util::secp::Signature; kernel_features, kernel_sig_msg, Transaction, Weighting,
use crate::util::RwLock; };
use crate::grin_core::core::verifier_cache::LruVerifierCache;
use crate::grin_core::libtx::{aggsig, build, secp_ser, tx_fee};
use crate::grin_keychain::{BlindSum, BlindingFactor, Keychain};
use crate::grin_util::secp;
use crate::grin_util::secp::key::{PublicKey, SecretKey};
use crate::grin_util::secp::Signature;
use crate::grin_util::RwLock;
use failure::ResultExt; use failure::ResultExt;
use grin_core::core::amount_to_hr_string;
use grin_core::core::committed::Committed;
use grin_core::core::transaction::{kernel_features, kernel_sig_msg, Transaction, Weighting};
use grin_core::core::verifier_cache::LruVerifierCache;
use grin_core::libtx::{aggsig, build, secp_ser, tx_fee};
use rand::rngs::mock::StepRng; use rand::rngs::mock::StepRng;
use rand::thread_rng; use rand::thread_rng;
use serde_json; use serde_json;

View file

@ -14,12 +14,12 @@
//! Contains V0 of the slate (grin 1.0.0) //! Contains V0 of the slate (grin 1.0.0)
//! And methods to downgrade v1 to v0 //! And methods to downgrade v1 to v0
use crate::core::core::transaction::{KernelFeatures, OutputFeatures}; use crate::grin_core::core::transaction::{KernelFeatures, OutputFeatures};
use crate::keychain::BlindingFactor; use crate::grin_keychain::BlindingFactor;
use crate::util::secp; use crate::grin_util::secp;
use crate::util::secp::key::PublicKey; use crate::grin_util::secp::key::PublicKey;
use crate::util::secp::pedersen::{Commitment, RangeProof}; use crate::grin_util::secp::pedersen::{Commitment, RangeProof};
use crate::util::secp::Signature; use crate::grin_util::secp::Signature;
use uuid::Uuid; use uuid::Uuid;
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]

View file

@ -16,12 +16,13 @@
//! Changes from V0: //! Changes from V0:
//! * Addition of a version field to Slate struct //! * Addition of a version field to Slate struct
use crate::core::core::transaction::{KernelFeatures, OutputFeatures}; use crate::grin_core::core::transaction::{KernelFeatures, OutputFeatures};
use crate::keychain::BlindingFactor; use crate::grin_core::map_vec;
use crate::util::secp; use crate::grin_keychain::BlindingFactor;
use crate::util::secp::key::PublicKey; use crate::grin_util::secp;
use crate::util::secp::pedersen::{Commitment, RangeProof}; use crate::grin_util::secp::key::PublicKey;
use crate::util::secp::Signature; use crate::grin_util::secp::pedersen::{Commitment, RangeProof};
use crate::grin_util::secp::Signature;
use uuid::Uuid; use uuid::Uuid;
use crate::slate_versions::v0::{ use crate::slate_versions::v0::{

View file

@ -35,14 +35,14 @@
//! orig_verion: u16, //! orig_verion: u16,
//! min_compat_version: u16 //! min_compat_version: u16
use crate::core::core::transaction::{KernelFeatures, OutputFeatures}; use crate::grin_core::core::transaction::{KernelFeatures, OutputFeatures};
use crate::grin_core::libtx::secp_ser;
use crate::core::libtx::secp_ser; use crate::grin_core::map_vec;
use crate::keychain::BlindingFactor; use crate::grin_keychain::BlindingFactor;
use crate::util::secp; use crate::grin_util::secp;
use crate::util::secp::key::PublicKey; use crate::grin_util::secp::key::PublicKey;
use crate::util::secp::pedersen::{Commitment, RangeProof}; use crate::grin_util::secp::pedersen::{Commitment, RangeProof};
use crate::util::secp::Signature; use crate::grin_util::secp::Signature;
use uuid::Uuid; use uuid::Uuid;
use crate::slate_versions::v1::{ use crate::slate_versions::v1::{

View file

@ -15,15 +15,15 @@
//! Types and traits that should be provided by a wallet //! Types and traits that should be provided by a wallet
//! implementation //! implementation
use crate::core::core::hash::Hash;
use crate::core::core::Transaction;
use crate::core::libtx::{aggsig, secp_ser};
use crate::core::ser;
use crate::error::{Error, ErrorKind}; use crate::error::{Error, ErrorKind};
use crate::keychain::{Identifier, Keychain}; use crate::grin_core::core::hash::Hash;
use crate::grin_core::core::{Output, Transaction, TxKernel};
use crate::grin_core::libtx::{aggsig, secp_ser};
use crate::grin_core::ser;
use crate::grin_keychain::{Identifier, Keychain};
use crate::grin_util::secp::key::{PublicKey, SecretKey};
use crate::grin_util::secp::{self, pedersen, Secp256k1};
use crate::slate::ParticipantMessages; use crate::slate::ParticipantMessages;
use crate::util::secp::key::{PublicKey, SecretKey};
use crate::util::secp::{self, pedersen, Secp256k1};
use chrono::prelude::*; use chrono::prelude::*;
use failure::ResultExt; use failure::ResultExt;
use serde; use serde;
@ -567,11 +567,11 @@ impl BlockFees {
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct CbData { pub struct CbData {
/// Output /// Output
pub output: String, pub output: Output,
/// Kernel /// Kernel
pub kernel: String, pub kernel: TxKernel,
/// Key Id /// Key Id
pub key_id: String, pub key_id: Option<Identifier>,
} }
/// a contained wallet info struct, so automated tests can parse wallet info /// a contained wallet info struct, so automated tests can parse wallet info

View file

@ -12,15 +12,14 @@
// limitations under the License. // limitations under the License.
//! core::libtx specific tests //! core::libtx specific tests
use self::core::core::transaction;
use self::core::libtx::{aggsig, proof};
use self::keychain::{BlindSum, BlindingFactor, ExtKeychain, ExtKeychainPath, Keychain};
use self::util::secp;
use self::util::secp::key::{PublicKey, SecretKey};
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use grin_wallet_libwallet::types::Context; use grin_wallet_libwallet::types::Context;
use grin_wallet_util::grin_core::core::transaction;
use grin_wallet_util::grin_core::libtx::{aggsig, proof};
use grin_wallet_util::grin_keychain::{
BlindSum, BlindingFactor, ExtKeychain, ExtKeychainPath, Keychain,
};
use grin_wallet_util::grin_util::secp;
use grin_wallet_util::grin_util::secp::key::{PublicKey, SecretKey};
use rand::thread_rng; use rand::thread_rng;
fn kernel_sig_msg() -> secp::Message { fn kernel_sig_msg() -> secp::Message {

View file

@ -18,13 +18,13 @@ use crate::util::{Mutex, ZeroingString};
/// Argument parsing and error handling for wallet commands /// Argument parsing and error handling for wallet commands
use clap::ArgMatches; use clap::ArgMatches;
use failure::Fail; use failure::Fail;
use grin_core as core;
use grin_keychain as keychain;
use grin_wallet_config::WalletConfig; use grin_wallet_config::WalletConfig;
use grin_wallet_controller::command; use grin_wallet_controller::command;
use grin_wallet_controller::{Error, ErrorKind}; use grin_wallet_controller::{Error, ErrorKind};
use grin_wallet_impls::{instantiate_wallet, WalletSeed}; use grin_wallet_impls::{instantiate_wallet, WalletSeed};
use grin_wallet_libwallet::types::{NodeClient, WalletInst}; use grin_wallet_libwallet::types::{NodeClient, WalletInst};
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_keychain as keychain;
use linefeed::terminal::Signal; use linefeed::terminal::Signal;
use linefeed::{Interface, ReadResult}; use linefeed::{Interface, ReadResult};
use rpassword; use rpassword;

View file

@ -15,23 +15,22 @@
#[cfg(test)] #[cfg(test)]
mod wallet_tests { mod wallet_tests {
use clap; use clap;
use grin_util as util; use grin_wallet_util::grin_util as util;
use grin_wallet_impls::test_framework::{self, LocalWalletClient, WalletProxy}; use grin_wallet_impls::test_framework::{self, LocalWalletClient, WalletProxy};
use clap::{App, ArgMatches}; use clap::{App, ArgMatches};
use grin_util::Mutex;
use std::sync::Arc; use std::sync::Arc;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
use std::{env, fs}; use std::{env, fs};
use util::Mutex;
use grin_core::global;
use grin_core::global::ChainTypes;
use grin_keychain::ExtKeychain;
use grin_wallet_config::{GlobalWalletConfig, WalletConfig}; use grin_wallet_config::{GlobalWalletConfig, WalletConfig};
use grin_wallet_impls::{LMDBBackend, WalletSeed}; use grin_wallet_impls::{LMDBBackend, WalletSeed};
use grin_wallet_libwallet::types::{WalletBackend, WalletInst}; use grin_wallet_libwallet::types::{WalletBackend, WalletInst};
use grin_wallet_util::grin_core::global::{self, ChainTypes};
use grin_wallet_util::grin_keychain::ExtKeychain;
use super::super::wallet_args; use super::super::wallet_args;

View file

@ -22,10 +22,10 @@ extern crate log;
use crate::core::global; use crate::core::global;
use crate::util::init_logger; use crate::util::init_logger;
use clap::App; use clap::App;
use grin_api as api;
use grin_core as core;
use grin_util as util;
use grin_wallet_config as config; use grin_wallet_config as config;
use grin_wallet_util::grin_api as api;
use grin_wallet_util::grin_core as core;
use grin_wallet_util::grin_util as util;
use std::process::exit; use std::process::exit;
mod cmd; mod cmd;

35
util/Cargo.toml Normal file
View file

@ -0,0 +1,35 @@
[package]
name = "grin_wallet_util"
version = "1.1.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Util, for generic utilities and to re-export grin crates"
license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
edition = "2018"
[dependencies]
rand = "0.5"
serde = "1"
serde_derive = "1"
toml = "0.4"
dirs = "1.0.3"
grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
# For local testing
#grin_core = { path = "../../grin/core", version= "1.1.0"}
#grin_keychain = { path = "../../grin/keychain", version= "1.1.0"}
#grin_chain = { path = "../../grin/chain", version= "1.1.0"}
#grin_util = { path = "../../grin/util", version= "1.1.0"}
#grin_api = { path = "../../grin/api", version= "1.1.0"}
#grin_store = { path = "../../grin/store", version= "1.1.0"}
[dev-dependencies]
pretty_assertions = "0.5.1"

28
util/src/lib.rs Normal file
View file

@ -0,0 +1,28 @@
// Copyright 2018 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.
//! Utilities and re-exports
#![deny(non_upper_case_globals)]
#![deny(non_camel_case_types)]
#![deny(non_snake_case)]
#![deny(unused_mut)]
#![warn(missing_docs)]
pub use grin_api;
pub use grin_chain;
pub use grin_core;
pub use grin_keychain;
pub use grin_store;
pub use grin_util;