Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC: fix several wallet RPC calls and add RPC tests #550

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

pinheadmz
Copy link
Member

This PR merges: #526, #530, #531, #544, and #545.

Also added new test rpc-test.js that tests all of the above affected RPC calls, and a few others mainly to support those. Further RPC tests will be added in a different PR.

lib/node/rpc.js Outdated Show resolved Hide resolved
@codecov-io

This comment has been minimized.

test/rpc-test.js Outdated Show resolved Hide resolved
@pinheadmz
Copy link
Member Author

Just rebased on master to make sure the new bufferMap stuff didn't break any of the tests I already wrote. @nodar-chkuaselidze @tuxcanfly @chjj If this PR is approved and merged, I'll finish writing tests for both http and rpc, hopefully pump our coverage a bunch more and catch more possible regressions like #575

braydonf added a commit to braydonf/bcoin that referenced this pull request Dec 22, 2018
braydonf added a commit to braydonf/bcoin that referenced this pull request Dec 22, 2018
nodech pushed a commit to bpanel-org/bcoin that referenced this pull request Jan 17, 2019
test: add utility to sleep for desired ms

wallet: add test cases for wallet tx count and time indexing

wallet: add db layout for tx count and monotonic time

wallet: implement monotonic time

wallet: add tx count index for confirmed txs

wallet: add rpc methods for tx count and monotonic time

test: restore count to generateBlocks regtest util

docs: after is exclusive

wallet: monotonic time indexing

test: add reorg to wallet time test

test: monotonic time reorg, incomplete

pkg: update bdb package to support reverse

wallet: rollback monotonic time

wallet: add spv monotonic time reorg

wallet: reorg tx monotonic time and count indexes

wallet: refactor monotonic index method

wallet: options for list history methods

wallet: add indexing for unconfirmed count and time

wallet: add methods to query for unconfirmed txs

test: confirm and unconfirm txs

wallet: combine `getPending` and `listUnconfirmed`

wallet: http endpoints for history and unconfirmed txs

wallet: test spv node http endpoints and w/ fixes

test: remove `.skip` function call, it's not implemented in bmocha

test: wallet rescan test

pkg: update bdb

wallet: use height + index for count index

test: remove spv from wallet rescan test

test: assertions for wallet rescan test

wallet: use median time past for time indexing

wallet: linting

wallet: use brhash for http after param

test: fix spv test when cpu is loaded

wallet: minor cleanup

wallet: cleanup indexes

wallet: make configurable max transactions limits

wallet: minor cleanup

wallet: fix configurable txs limits

test: bump wallet http before hook time

wallet: fix http time tx queries

wallet: minor linting

wallet: check rpc min args length

test: minor linting

wallet: fix sorting of time indexing

wallet: use brhash instead of manually reversing

docs: minor linting

wallet: fix sorting of confirmed time index

wallet: refactor date handling for api

test: refactor utils

wallet: minor cleanup and adjustments

wallet: minor cleanup and update

wallet: update rpc methods with new history functions

includes necessary fixes from bcoin-org#550

wallet: use unix epoch time in seconds for rpc history cmds

test: increase lookahead for test wallet
bucko13 pushed a commit to bpanel-org/bcoin that referenced this pull request Jan 17, 2019
test: add utility for test fs cleanup

test: add utility to sleep for desired ms

wallet: add test cases for wallet tx count and time indexing

wallet: add db layout for tx count and monotonic time

wallet: implement monotonic time

wallet: add tx count index for confirmed txs

wallet: add rpc methods for tx count and monotonic time

test: restore count to generateBlocks regtest util

docs: after is exclusive

wallet: monotonic time indexing

test: add reorg to wallet time test

test: monotonic time reorg, incomplete

pkg: update bdb package to support reverse

wallet: rollback monotonic time

wallet: add spv monotonic time reorg

wallet: reorg tx monotonic time and count indexes

wallet: refactor monotonic index method

wallet: options for list history methods

wallet: add indexing for unconfirmed count and time

wallet: add methods to query for unconfirmed txs

test: confirm and unconfirm txs

wallet: combine `getPending` and `listUnconfirmed`

wallet: http endpoints for history and unconfirmed txs

wallet: test spv node http endpoints and w/ fixes

test: remove `.skip` function call, it's not implemented in bmocha

test: wallet rescan test

pkg: update bdb

wallet: use height + index for count index

test: remove spv from wallet rescan test

test: assertions for wallet rescan test

wallet: use median time past for time indexing

wallet: linting

wallet: use brhash for http after param

test: fix spv test when cpu is loaded

wallet: minor cleanup

wallet: cleanup indexes

wallet: make configurable max transactions limits

wallet: minor cleanup

wallet: fix configurable txs limits

test: bump wallet http before hook time

wallet: fix http time tx queries

wallet: minor linting

wallet: check rpc min args length

test: minor linting

wallet: fix sorting of time indexing

wallet: use brhash instead of manually reversing

docs: minor linting

wallet: fix sorting of confirmed time index

wallet: refactor date handling for api

test: refactor utils

wallet: minor cleanup and adjustments

wallet: minor cleanup and update

wallet: update rpc methods with new history functions

includes necessary fixes from bcoin-org#550

wallet: use unix epoch time in seconds for rpc history cmds

test: increase lookahead for test wallet
@pinheadmz pinheadmz mentioned this pull request Jan 21, 2019
@pinheadmz pinheadmz added bug fix tests Has tests for code change is just an addtional test labels Jan 23, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request Jan 28, 2019
@pinheadmz
Copy link
Member Author

Looks like a very brief version of this PR was merged into hsd: handshake-org/hsd@06d52af

Would be fine just to double-back-port that

@braydonf braydonf added the wallet Wallet related label Feb 6, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request Feb 12, 2019
@braydonf braydonf mentioned this pull request Feb 13, 2019
6 tasks
bucko13 pushed a commit to bpanel-org/bcoin that referenced this pull request Feb 18, 2019
test: add utility for test fs cleanup

test: add utility to sleep for desired ms

wallet: add test cases for wallet tx count and time indexing

wallet: add db layout for tx count and monotonic time

wallet: implement monotonic time

wallet: add tx count index for confirmed txs

wallet: add rpc methods for tx count and monotonic time

test: restore count to generateBlocks regtest util

docs: after is exclusive

wallet: monotonic time indexing

test: add reorg to wallet time test

test: monotonic time reorg, incomplete

pkg: update bdb package to support reverse

wallet: rollback monotonic time

wallet: add spv monotonic time reorg

wallet: reorg tx monotonic time and count indexes

wallet: refactor monotonic index method

wallet: options for list history methods

wallet: add indexing for unconfirmed count and time

wallet: add methods to query for unconfirmed txs

test: confirm and unconfirm txs

wallet: combine `getPending` and `listUnconfirmed`

wallet: http endpoints for history and unconfirmed txs

wallet: test spv node http endpoints and w/ fixes

test: remove `.skip` function call, it's not implemented in bmocha

test: wallet rescan test

pkg: update bdb

wallet: use height + index for count index

test: remove spv from wallet rescan test

test: assertions for wallet rescan test

wallet: use median time past for time indexing

wallet: linting

wallet: use brhash for http after param

test: fix spv test when cpu is loaded

wallet: minor cleanup

wallet: cleanup indexes

wallet: make configurable max transactions limits

wallet: minor cleanup

wallet: fix configurable txs limits

test: bump wallet http before hook time

wallet: fix http time tx queries

wallet: minor linting

wallet: check rpc min args length

test: minor linting

wallet: fix sorting of time indexing

wallet: use brhash instead of manually reversing

docs: minor linting

wallet: fix sorting of confirmed time index

wallet: refactor date handling for api

test: refactor utils

wallet: minor cleanup and adjustments

wallet: minor cleanup and update

wallet: update rpc methods with new history functions

includes necessary fixes from bcoin-org#550

wallet: use unix epoch time in seconds for rpc history cmds

test: increase lookahead for test wallet
@braydonf
Copy link
Contributor

braydonf commented Mar 1, 2019

Considering the discussion on #705 how about we have this PR fix many of the RPC methods, and separate out the updates to the help command for later improvements that are generated.

I have run into a few of these RPC issues myself, and it's been necessary to bring a few of the fixes as in #605 and as you mention also hsd.

braydonf added a commit to braydonf/bcoin that referenced this pull request Mar 2, 2019
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
test/rpc-test.js Outdated Show resolved Hide resolved
lib/wallet/rpc.js Outdated Show resolved Hide resolved
Copy link
Contributor

@braydonf braydonf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, w/ squash.

wallet-rpc: fix listsinceblock height

wdb: fix getWalletPaths() always return nothing

wallet: add unlockCoins() for lockunspent rpc

wallet-rpc: correct num args for some rpc calls

wallet-rpc: fix args for importwallet and importprunedfunds

wallet-rpc: importprunedfunds error misleading

wallet-rpc: importPubkey args

wallet-rpc: listsinceblock arg count error

wallet-rpc: listTransactions ignoring account param

wallet-rpc: better sendMany error msgs

wallet-rpc: sendMany subtractfee is bool not obj

wallet-rpc: dont check if not implemented

test: add rpc-test
@braydonf braydonf merged commit 5751b8c into bcoin-org:master Mar 11, 2019
braydonf added a commit that referenced this pull request Mar 11, 2019
RPC: fix several wallet RPC calls and add RPC tests
braydonf added a commit to braydonf/bcoin that referenced this pull request Mar 21, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request Apr 3, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request May 15, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request May 16, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request May 17, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request Jun 5, 2019
braydonf added a commit to braydonf/bcoin that referenced this pull request Jun 27, 2019
@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
braydonf added a commit that referenced this pull request Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Has tests for code change is just an addtional test wallet Wallet related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants