Commit graph

353 commits

Author SHA1 Message Date
Yeastplume
3eb599a45c
Grin wallet check/repair (#2256)
* first pass at basic check_fix process

* rustfmt

* unlocks and tx log entry reversals in place

* log restore output at warn

* rename check_repair

* rename check_repair

* add command line functionality and sanity test

* rustfmt

* update wallet usage doc with check_repair

* doc update

* consistency in NotEnoughFunds output

* consistency in NotEnoughFunds output
2018-12-30 16:32:00 +00:00
Ignotus Peverell
9234e3c251
Re-launch floonet (#2249)
*  Fix secondary scaling bugs;  rename is_testnet -> is_floonet (#2215)
* add global::is_mainnet()
* use it to change pre-genesis pow type
* rename is_testnet -> is_floonet
* Support multiple chain configurations (#2217)
* Support multiple chain configurations
Supports generating the proper configuration for each chain type
(mainnet, floonet, usernet). Will run them by default under
their respective root directory (~/.grin/main, ~/.grin/floo, etc).
Assigned default ports for mainnet, overriding them to keep Floonet
ports unchanged.
For now, starting on mainnet will abort.
* Fixed usernet command line help message. Fixes #2217
* Differing magic numbers for each chain type (#2208)
* stick to e=H(R|P|m) when use schnorr signature (#2200)
* stick to e=H(R|P|m) when use schnorr signature
* (1)add verify_slate_messages for wallet receive (2)log the message content
* remove debug log on verify_slate_messages
* verify the sender's message signature when receive_tx in wallet listen
* Revert "remove debug log on verify_slate_messages"

This reverts commit 65ea32a407.

* Revert "rustfmt"

This reverts commit c380ab9185.

* Revert "(1)add verify_slate_messages for wallet receive (2)log the message content"

This reverts commit 9584ca7a89.

* [re-floonet] Keychain Floonet BIP32 version/network option (#2235)

* add 'is_floonet' property to keychain
* fix hex encoding and tests

* Fix couple floonet loose ends (#2230)

* Fix couple floonet loose ends. Fixes #2216
* Doc fix for sig message

* Refuse unkown kernel features (#2244)

* Minor: magic number change for re-floonet

* Set pre genesis is_secondary to true (#2247)

* Minor: tx validation error display underlying

* New floonet genesis

* genesis rustfmt

* Use chain-specific config for wallet toml gen

* Fix default wallet_listener_url

* New more reasonable genesis block, bumped version

* genesis rustfmt

* Couple minor fixes to genesis generation script
2018-12-28 14:46:21 -08:00
hashmap
80f7ae678a Implement zeroing memory for wallet password (#2229)
Testing ergonomics, if this approach is acceptable I'll implement it for other sensitive parts.
2018-12-28 14:12:59 -08:00
Gary Yu
602bb25ec9
fix: a silly mistake on the keybase recipients count (#2226) 2018-12-25 12:09:43 +08:00
Gary Yu
12811a2445
Keybase notice on receiving grin transaction (#2211)
* keybase notification on transaction received

* fix: use 'keybase status' to get own username

* refactor the code

* security enhancement for multiple recipients

* change the poll interval from 5s to 1s

* log the error message of keybase api
2018-12-25 08:05:24 +08:00
Gary Yu
45ca7cff79
verify message signature on wallet (#2203)
* add verify_slate_messages for wallet receive

* log the message content

* rustfmt

* verify the sender's message signature when receive_tx in wallet listen

* verify the sender's message signature when send by keybase
2018-12-23 07:25:02 +08:00
Yeastplume
7812a9e892
[Floonet] Encrypt private slate data upon storage in DB (#2189)
* xor encrypt stored nonce and blind sum in transaction data

* rustfmt

* stop doc tests splatting wallet files throughout
2018-12-20 13:10:36 +00:00
Ignotus Peverell
a42250445d
Floonet chain type and genesis, testnets cleanup (#2182) 2018-12-18 14:03:55 -08:00
John Tromp
f43df5f601 [Floonet] add feature for height locked kernels (#2168)
* add feature for height locked kernels

* add function to compute kernel features appropriate for lock height, and use it

* only sign kernel-features relevant fields; refactor Features

* simplify invalid kernel logic

* remove unused height arg to reward::output and run some rustfmt

* replace nested if/else by match
2018-12-18 18:26:34 +00:00
Yeastplume
aa9da6838b
rename tx log entry field tx_hex -> stored_tx (#2181) 2018-12-18 16:44:03 +00:00
Yeastplume
230fe191e0
[Floonet] Use switch commits for all blinding factors (#2178)
* move wallet mods back into dirs

* move wallet mod files

* use switched keys for blinding factor in all cases

* rustfmt

* test fix

* test fix

* test fix

* rustfmt

* re-implement flag to turn off switch commit derivation

* rustfmt
2018-12-18 15:44:55 +00:00
jaspervdm
75d2c1cc56 Switch commitments (#2157) 2018-12-18 11:51:44 +00:00
Yeastplume
fcec70d1e3
Fix for #2169 (#2170)
* return all matching tx entries from retrieve_txs

* rustfmt
2018-12-17 10:40:48 +00:00
Yeastplume
8e678058f1
[WIP] Store completed transactions in files instead of DB (#2148)
Store completed transactions in files instead of DB
2018-12-14 16:24:53 +00:00
Yeastplume
df62fd6d95
Coin selection with small amounts fix (#2144)
* coin selection fix for sending with an amount <= smallest output

* rustfmt
2018-12-13 11:19:46 +00:00
Yeastplume
901c665ba7
Wallet tests, bug fixes (#2138)
* More tests for smallest selection, resulting bug fixes, remove unneeded TXLogEntryTypes

* rustfmt
2018-12-12 13:38:29 +00:00
Antioch Peverell
a0b9aa5967
Sign kernel features (#2104)
* include kernel features in msg being signed
hash the msg before signing it (for consistent 32 bytes)

* rustfmt

* fix various tests

* no HF for this (mainnet only)
2018-12-12 09:19:36 +00:00
Quentin Le Sceller
3bb615a753
Merge pull request #2128 from quentinlesceller/tokio
Temporarily lock tokio on 0.1.11
2018-12-11 12:42:36 -05:00
Yeastplume
fb11dd3f4e
Don't allow same transaction to be received multiple times (#2124)
* don't allow same transaction to be received multiple times

* issues in other tests uncovered and fixed

* allow tx_hex update function to operate without an account being specified, to allow finalize_tx function to work without an account being specified

* rustfmt

* fix to retrieve_txs

* rustfmt
2018-12-11 17:18:31 +00:00
Quentin Le Sceller
a9a3264a51
Temporarily lock tokio on 0.1.11 2018-12-11 09:51:40 -05:00
Antioch Peverell
2d4538c428
Clean shutdown via stop_state (#2117)
* clean shutdown wip

* rustfmt

* introduce StopState that we can lock on

* rustfmt

* take lock on stop_state during critical processing (process_block_single etc.)

* rustfmt

* take lock on stop_state during chain::init()

* cleanup

* cleanup

* rustfmt

* docs/comments

* fixup servers tests

* cleanup p2p tests
2018-12-11 11:07:41 +00:00
Yeastplume
b7fe4d6621
Wallet command line tests (#2114)
* tests in place for wallet command line

* tests in place for wallet command line
2018-12-10 14:54:56 +00:00
hashmap
aedac483f5
Convert to Rust 2018 edition (#2084)
* Convert to Rust 2018 edition

* Update gitignore
2018-12-08 00:59:40 +01:00
Yeastplume
68896b2a76
Wallet test framework (#2098)
* remove circular dependency

* rustfmt

* move wallet test framework
2018-12-07 17:18:33 +00:00
Yeastplume
d1b484259b
Wallet command line automated testing (#2097)
* wallet test infrastructure

* rustfmt

* successful wallet create

* rustfmt

* start of command line tests

* rustfmt
2018-12-07 15:06:28 +00:00
Ignotus Peverell
87bfd9aaa4
Mark all crates as publishable 2018-12-07 00:08:15 +00:00
Yeastplume
7ff323c882
Fix keybase wallet listener call (#2091)
* fix keybase adapter call

* rustfmt
2018-12-06 17:51:53 +00:00
Yeastplume
995c5a38e5
fix for password in listen command (#2090) 2018-12-06 16:26:20 +00:00
Yeastplume
40ccb32be2
Externalise Grin command line definition to .yaml file (#2089)
* move command line definition to .yaml file

* rustfmt
2018-12-06 15:25:05 +00:00
Yeastplume
b8c8840cec
Refactor wallet commands (#2067)
* start wallet command refactoring

* another re-structuring attempt

* rustfmt

* begin splitting up wallet commands

* rustfmt

* clean up wallet arg checking

* rustfmt

* macro for arg parsing

* rustfmt

* factor out init commands

* rustfmt

* move recover to new format

* rustfmt

* add listen command to new format

* rustfmt

* Finish moving commands to new format

* rustfmt

* rustfmt

* propogate errors more cleanly

* rustfmt

* error handling cleanup
2018-12-06 12:04:02 +00:00
Yeastplume
e8a481e3d4
Keybase adapter merge issue fix (#2086)
* fix keybase adapter

* rustfmt
2018-12-05 19:05:13 +00:00
Mike Dallas
f9261310ab Keybase wallet plugin (#2052)
* add keybase wallet plugin

* rustfmt

* cleanup

* rustfmt

* handle null case

* Use two seperate topics for the two parts of the round trip

* rustfmt

* send slate to wallet directly (no need to run http listener anymore)

* rustfmt

* skip some unnecessary api calls

* update docs
2018-12-05 18:37:11 +00:00
Quentin Le Sceller
ed2e1f87aa Fix verify_messages function (#2074)
* Fix verify_messages function
* Do not use wallet secp to verify messages
2018-12-05 10:10:37 -08:00
Quentin Le Sceller
a717dbad96 Fix "post_tx" endpoint (#2077)
* Fix #2073
* Remove logging
2018-12-05 10:08:42 -08:00
Dobby the House Elf
b8124676c7 Move libtx to core 2018-12-05 09:41:26 -08:00
Yeastplume
93a4653e36
Docs, Docs, Docs (#2058)
* docs

* rustfmt

* doc tweaks
2018-11-30 13:17:42 +00:00
Antioch Peverell
7b07fe99a7
bump 0.4.1 -> 0.4.2 so we can watch the HF (#2057) 2018-11-30 11:20:12 +00:00
Yeastplume
16aa64bfab
Optional Slate Message (#2047)
* add optional signed message to slate

* rustfmt
2018-11-29 12:49:00 +00:00
Yeastplume
fdb0197ef9
Cleanup of wallet owner API, rustdoc documentation (#2036)
* doc start

* rustfmt

* tightening up wallet owner API

* rustfmt

* remove burn tx functions

* more tx api documentation

* rustfmt
2018-11-28 15:31:23 +00:00
Yeastplume
2a77207713
http api output lock/finalize order (#2034) 2018-11-28 11:02:29 +00:00
Yeastplume
b95caecc27
Fixes to grin wallet repost, cancel tx (#2029)
* fixes to wallet cancel, repost, ensure stored transaction is updated with final signatures

* rustfmt

* add tests for reposting

* fixes to tests

* repost
2018-11-27 13:36:49 +00:00
Yeastplume
1465599df1
more wallet api docs (#2023)
* more aggsig doce

* rustfmt
2018-11-26 14:41:23 +00:00
Yeastplume
34520a46d9
fix self send command (#2022) 2018-11-26 12:35:14 +00:00
Yeastplume
b2c177d16a
Saner error output on multiple attempts to init wallet (#2021)
* less scary error message on duplicate wallet commit

* rustfmt
2018-11-26 12:02:18 +00:00
Yeastplume
5992542152
Wallet Seed Encryption + BIP39 (#2004)
* add encryption/decryption of wallet seed

* rustfmt

* update passphrase to encrypt/decrypt wallet

* rustfmt

* add conversion for old wallet seeds

* add ability to restore old seed

* rustfmt

* add bip39 recovery phrase support, conversion from existing seed formats

* rustfmt

* error recovery

* rustfmt

* add password prompts where required

* rustfmt

* add note specifying wallet conversion

* update documentation

* doc update
2018-11-24 10:03:09 +00:00
Yeastplume
0eec80789a
start libtx docs (#1998) 2018-11-20 13:02:51 +00:00
Antioch Peverell
458a980470
[WIP] minimum_confirmations = 10 (#1996)
* default to minimum_confirmation = 10
pass in minimum_confirmations to grin wallet info

* rustfmt

* rebase against master

* fixup wallet tests

* fixup server tests
2018-11-20 11:17:03 +00:00
Yeastplume
5ba163fa66
Provide wallet 'plugin' architecture (#1983)
* remove receive_coinbase fn from wallet to wallet client

* start moving clients into separate mod

* rustfmt

* move wallet client + start listener into wallet 'clients'

* rustfmt

* refactor API to make it more modular and completely decouple sending

* rustfmt

* further decouple API from sending methods

* rustfmt

* remove wallet to wallet client trait

* rustfmt

* rename / refactor client + adapters

* rustfmt

* add adapter concept

* add midding node_clients dir

* add file and null adapters

* rustfmt

* remove receive from owner api

* factor out receiving slates into trait

* rustfmt

* adding listen trait

* rustfmt

* change listener to use trait

* rustfmt

* add test for file-based exchange

* replace http api send command

* rustfmt

* move controller out of libwallet and into top-level wallet dir

* rustfmt

* add moved controller
2018-11-19 19:47:40 +00:00
Ignotus Peverell
137c70f6b9
Add cancel_tx and retrieve by tx_slate_id in owner_api (#1963)
* Add retrieve by tx_id in owner_api
* Add cancel tx by tx_slate_id
* Add doc
2018-11-13 09:34:33 -08:00
Yeastplume
5a06f5dac7
Split wallet client trait (#1970)
* complete trait split

* rustfmt
2018-11-13 13:18:33 +01:00
Quentin Le Sceller
e923b90ad2
Fix tests 2018-11-13 11:57:43 +01:00
Quentin Le Sceller
59b0f1b1d7
Add cancel tx by tx_slate_id 2018-11-13 11:53:23 +01:00
Antioch Peverell
c631b45ab6
cleanup how we deal with flexible rproof size in ser/deser (#1965) 2018-11-13 09:30:40 +00:00
Yeastplume
4e6d7e374b
wallet seed trim on read (#1964) 2018-11-12 20:09:33 +00:00
Quentin Le Sceller
1b264595e3
Add retrieve by tx_id in owner_api 2018-11-12 19:18:54 +01:00
hashmap
f5b71b4190
Instantiate wallet once in wallet cli (#1927)
Also remove extra Box to simplify type
2018-11-11 12:56:42 +01:00
Antioch Peverell
183d9c9f3e
Refactor kernel sig msg creation (#1954)
* refactor kernel msg creation

* rustfmt

* Error not secp::Error

* fix tests for refactored errors
2018-11-10 16:24:11 +01:00
Antioch Peverell
39ebb33ba1
bump 0.4.0 -> 0.4.1 (tx kernel broadcast support) (#1950) 2018-11-09 14:57:25 +00:00
Yeastplume
ee19cfcf86
Wallet self-send (#1939)
* add self send function to wallet

* rustfmt

* add destination to self send method

* update usage doc

* doc clarification

* remove localhost send restriction
2018-11-08 09:46:09 +00:00
Gary Yu
f645937a2b replace cyan and yellow which not easy to read on white background (#1903)
* replace cyan and yellow which not easy to read on white background

* wallet output color scheme configuration for terminal dark/white background

* use true for dark_background_color_scheme to make the default behavior same as before
2018-11-03 09:42:41 +01:00
Yeastplume
9d0641c2b8
Wallet restore fix (#1904)
* wallet restore txlog + status fixes

* rustfmt
2018-11-01 11:36:29 +00:00
Antioch Peverell
12be191ecd
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
2018-11-01 09:51:32 +00:00
Gary Yu
a8bf2eb126 avoid long display of TxLogEntryType (#1894) 2018-10-31 10:31:24 +00:00
Gary Yu
641e7f51f0 Adjust the title format of wallet txs output (#1882) 2018-10-30 14:40:53 -07:00
Ignotus Peverell
46051ee174
improve minimum difficulty handling (#1791)
* rename MIN_DIFFICULTY to UNIT_DIFFICULTY; define Difficulty::unit, fix INITIAL_DIFFICULTY
* improve minimum difficulty handling
* replace all Difficulty::one by ::min
* revert secondary scaling default in HeaderInfo; rename scaling_difficulty; refactor difficulty_data_to_vector
2018-10-27 10:37:44 -07:00
Ignotus Peverell
c083312ad4
Improve crate descriptors to be more cargo-friendly (#1844)
* Update secp dependency to use crates.io version
* Add more details to various Cargo.toml
* Remove use of env variables that aren't reliably provided by cargo
2018-10-25 17:44:50 -07:00
Ignotus Peverell
a42d66efff
Merge branch 'master' into unitdiff 2018-10-25 14:20:41 -07:00
Quentin Le Sceller
c343c65051
Remove fluff in SendTXArgs (#1825) 2018-10-24 12:10:40 +02:00
Yeastplume
029450a5ce
remove file wallet (#1824) 2018-10-24 11:03:50 +01:00
Quentin Le Sceller
d11088c987
Fix build error (#1803)
* Fix build error

* Cargo Lock
2018-10-21 23:56:42 +02:00
eupn
1195071f5b Replace logging backend to log4rs and add log rotation (#1789)
* Replace logging backend to flexi-logger and add log rotation
* Changed flexi_logger to log4rs
* Disable logging level filtering in Root logger
* Support different logging levels for file and stdout
* Don't log messages from modules other than Grin-related
* Fix formatting
* Place backed up compressed log copies into log file directory
* Increase default log file size to 16 MiB
* Add comment to config file on log_max_size option
2018-10-21 13:30:56 -07:00
Quentin Le Sceller
0852b0c4cf Expose post_tx in OwnerAPI Post (#1795)
* Add POST post_tx in wallet_owner_api
* Add docs for post_tx
2018-10-21 13:26:35 -07:00
Gary Yu
0d06561a91
replace stdlib RwLock and Mutex with parking_lot (#1793)
* replace all stdlib RwLock with parking_lot RwLock

* replace stdlib Mutex with parking_lot Mutex

* rustfmt
2018-10-20 08:13:07 +08:00
John Tromp
e1b5d7f3c2 revert secondary scaling default in HeaderInfo; rename scaling_difficulty; refactor difficulty_data_to_vector 2018-10-19 21:39:54 +02:00
eupn
a11778bf68 fix: mark potential coinbase outputs as mining instead of unconfirmed in wallet (#1787)
* Mark unconfirmed coinbase outputs as "Mining" instead of "Unconfirmed"

* Fix formatting
2018-10-18 15:42:31 +02:00
yeastplume
6980278b95 merge T4 into master - rustfmt 2018-10-18 11:23:22 +01:00
John Tromp
8540e4f723 [T4] tweaks and fixes (#1766)
* refactor consensus.rs, tweaking some values
* move scale() there
* fix set_header_nonce bug
* remove maturity soft-fork code
* increase diff target precision
* fix weight comments and try resolve PR conflict
2018-10-16 16:14:22 -07:00
John Tromp
34646ddf51 [T4] Rename all shiftsize / cuckoo_size to edge_bits and change value for T4 (#1752)
* replace all size_shift / cuckoo_size by edge_bits and change some constants for T4
* replace remaining occurrences of sizeshift
2018-10-15 16:14:23 -07:00
Ignotus Peverell
a41022f1e3
Fix last tests broken by secondary PoW factor adjustment 2018-10-15 22:53:28 +00:00
yeastplume
9423865f92 update cargo versioning 2018-10-15 10:34:33 +00:00
Yeastplume
13facfac4b
pre-testnet4 genesis values (#1744) 2018-10-15 11:14:49 +01:00
Ignotus Peverell
43f4f92730
[T4] Secondary proof of work difficulty adjustments (#1709)
* First pass at secondary proof of work difficulty adjustments
* Core and chain test fixes
* Next difficulty calc now needs a height. Scaling calculation fixes. Setting scaling on mined block.
* Change factor to u32 instead of u64.
* Cleanup structs used by next_difficulty
* Fix header size calc with u32 scaling
2018-10-13 13:57:01 -07:00
Yeastplume
d756da062a [T4] warning cleanup (#1713)
* clean up warnings
* rustfmt
2018-10-10 08:56:15 -07:00
Yeastplume
6c8c483172
[T4 ONLY] BIP32 Wallet Compliance - Aggsig Updates - Bulletproof Updates (#1501)
* change keychain to use bip32 paths

* convert keychain to use bip32

* change identifier to be serialisation of 4-level bip32 path

* wallet changes compiling, pass parent key into all wallet functions

* rustfmt

* fix tests in chain

* rustfmt

* core tests passing

* rustfmt

* pool tests

* rustfmt

* fixing wallet tests

* rustfmt

* remove file wallet

* wallet tests compiling

* rustfmt

* remove db_migrate

* successful tx exchange test using BIP32 paths

* rustfmt

* fix wallet derivation paths to m/0/0/0

* wallet test fixed again, working with default path

* rustfmt

* fix server tests

* rustfmt

* make parent_id a trait on walletbackend

* rustfmt

* add ability for wallet to switch between multiple named accounts, and tests (not complete)

* rustfmt

* account switching tests in place and passing

* rustfmt

* compile and test with latest libsecp changes

* added public key sum to calculated e for aggsig

* rustfmt

* Update secp to 26

* bulletproof bip32 path integration

* rustfmt

* wallet restore updated with bip32 paths, also restores accounts

* rustfmt

* rustfmt

* remove old extkey

* remove old extkey

* rustfmt

* add wallet account commands

* rustfmt

* update wallet documentation

* rustfmt

* merge from master

* update libsecp tag

* merge from upstream and fix server test

* rustfmt

* rustfmt

* merge from master

* update latest libsecp merge

* fix commitment to zero value generation
2018-10-10 10:11:01 +01:00
hashmap
28b0acc0e6
Support pem TLS certificates
Mostly to support let's encrypt. It requires to switch from native-tls and friends to rustls and friends, which perhap is a good thing per se, rustls looks more modern and for sure more Rusty.
Alternative would be manually convert pkcs12 certificates to pem, which requires openssl tools to be installed and make transparent integration whith let's encrypt much harder (this is out of the scope for now, perhaps in near future)
2018-10-05 17:09:19 +02:00
hashmap
4a6cae0fe6
Allow TLS for Wallet APIs (#1626)
* Allow TLS for Wallet APIs

This PR adds an optional support of TLS for wallet APIs. Only PKCS12 format is supported, will address .pem support in next PR and provide some documentation.
Address #1425
2018-10-02 09:49:36 +02:00
Quentin Le Sceller
a13c20ceb2 Fix API wallets calls (#1597)
* Add API Secret in wallet calls

* File node api secret default to same api secret and directly in http parameter
2018-09-27 21:45:48 +02:00
Quentin Le Sceller
62fd8f2124 Implement Basic Auth for API and Owner API (#1566)
* Add api_secret

* Add to base64 method

* Add basic auth in API

* Add Basic Auth to owner API

* Add flag to enable disable basic auth

* Add .api_secret file
2018-09-26 22:38:44 +02:00
hashmap
274df3b8bb
Fix wallet APIs launch command (#1574)
We used to launch a thread for API server inside the wallet crate, now we do it inside api crate, so the cmd tool launches API and exit. This fix makes sure that command will wait for API thread.
2018-09-22 09:34:28 +02:00
hashmap
3a3ba4d636
Improve middleware support in web layer (#1572)
* Middleware and handler (mw implements the same trait) could be attached to multiple nodes inside the router
* Middleware could be attached to the router (syntactic sugar, it is attached to the root node) as well as to any node
* Handler's call method receives an iterator of handlers and responsible for calling the next handler if needed
2018-09-21 19:57:59 +02:00
hashmap
972c2e5aa9
Support TLS in ApiServer (#1565)
* Support TLS in ApiServer

This is ground work to support TLS in Grin APIs (like wallet ot node). Particular API implemention needs to decide if TLS is used or not and pass certificate data etc.

* P12 format support
* New method to start TLS server
* Transparent TLS support in API client (depends on URL scheme http/https)
* Refactoring
* Initial support for graceful shutdown (commentred out int this PR, unstable for now)
* API server tests (TLS server test is disabled by default, hyper client rejects self-signed certificates, so extra step is needed to install local CA (I used mkcert)
* Add a cert file to make test complile
2018-09-21 13:33:23 +02:00
hashmap
521ce901e4
Merge pull request #1557 from yourowncrypto/api-refactor
Refactor hyper router
2018-09-19 19:33:48 +02:00
Roy Blankman
febe9076f0 fixes #1507 - proper tx confirmation calculation (#1552)
when self.height == current_height, # of confirmations should be 1 not 0
2018-09-19 16:55:03 +01:00
hashmap
d5ef3d9d12
Refactor hyper router
* Make it simpler to implement middleware
* Switch from the current thread runtime to the default one. It enables us to inject TLS support later one and potentially more scalable, unfortunately it involves some additonal cloning of the router, because we can't rely on thread local vars anymore
* Introduce `call` entrypoint for Handler, so it's possible to handle any HTTP method in one place, handy for middleware
* Implement example of middleware
2018-09-19 17:10:52 +02:00
hashmap
7db8e5e2dd Improve API errors (#1543)
Address ##1525 in particular and improve error messages in general.
Instead of `Request Error: Error { inner:` a client would get:
`Generic error: Invalid request body: missing field `method` at line 1 column 162`
2018-09-18 15:11:58 -07:00
Quentin Le Sceller
345a6cb53e Update rand crate to 0.5 (#1542)
* Update rand crate to 0.5

* Rustfmt

* Misplaced import
2018-09-18 09:39:45 +01:00
Gary Yu
a0deb18e77
Update version of some crates (#1536)
Update version of some crates
2018-09-17 10:47:48 +08:00
Antioch Peverell
dca0d52dcd
Cleanup transaction with offset (#1514)
* cleanup build::transaction_with_offset

* rustfmt
2018-09-12 12:17:36 +01:00
Quentin Le Sceller
dd1cef2148 Add file based transaction in owner API (#1484)
* Add file based transaction in owner API
* Add finalize tx in owner API
* Code cleanup and placed file_receive in correct API
* Output an explicit error when http dest seems incorrect
* Add doc on send method
* Add cancel tx endpoint in owner API
* Add dump stored tx endpoint in owner API
*  Add missing parameters
2018-09-10 19:18:10 -07:00
Antioch Peverell
dbe53f63c8
disable chain compaction on archive nodes (#1498)
* disable chain compaction when in archive mode

* rustfmt
2018-09-10 15:59:42 +01:00