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

Added ListSinceBlockMinConfWatchOnly method. #1451

Merged
merged 1 commit into from
Sep 14, 2020
Merged

Added ListSinceBlockMinConfWatchOnly method. #1451

merged 1 commit into from
Sep 14, 2020

Conversation

nalcheg
Copy link
Contributor

@nalcheg nalcheg commented Jul 16, 2019

Added method for request ListSinceBlock with include_watchonly=true

@jakesylvestre
Copy link
Collaborator

@jcvernaleo (as per #1530)

  • Low priority
  • Enhancement

var hash *string
if blockHash != nil {
hash = btcjson.String(blockHash.String())
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably won't work if you want to do something like list all watch-only transactions with the following call:

ListSinceBlockMinConfWatchOnlyAsync(nil, 1, true)

Here's a workaround, although I'm not sure if it's the best solution.

Suggested change
}
} else {
hash = btcjson.String("")
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks to #1594, we may not need to do this. Could you please verify this on your side?

@nalcheg
Copy link
Contributor Author

nalcheg commented Sep 8, 2020

did in #1163

@nalcheg nalcheg closed this Sep 8, 2020
@onyb
Copy link
Collaborator

onyb commented Sep 8, 2020

@nalcheg #1163 is not doing the same thing. You added ListSinceBlockMinConfWatchOnlyAsync. That one was about ListTransactionsCountFromWatchOnlyAsync.

@nalcheg nalcheg reopened this Sep 8, 2020
@nalcheg
Copy link
Contributor Author

nalcheg commented Sep 8, 2020

sorry, I was wrong

Copy link
Collaborator

@onyb onyb left a comment

Choose a reason for hiding this comment

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

Needs a rebase + the small test I suggested.

@coveralls
Copy link

coveralls commented Sep 8, 2020

Pull Request Test Coverage Report for Build 245646585

  • 0 of 10 (0.0%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 53.684%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/wallet.go 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
database/ffldb/blockio.go 4 92.62%
Totals Coverage Status
Change from base Build 245421206: -0.02%
Covered Lines: 20634
Relevant Lines: 38436

💛 - Coveralls

Copy link
Collaborator

@onyb onyb left a comment

Choose a reason for hiding this comment

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

Could you please add the following unit-test to walletsvrcmds_test.go? (line 710)

		{
			name: "listsinceblock pad null",
			newCmd: func() (interface{}, error) {
				return btcjson.NewCmd("listsinceblock", "null", 1, false)
			},
			staticCmd: func() interface{} {
				return btcjson.NewListSinceBlockCmd(nil, btcjson.Int(1), btcjson.Bool(false))
			},
			marshalled: `{"jsonrpc":"1.0","method":"listsinceblock","params":[null,1,false],"id":1}`,
			unmarshalled: &btcjson.ListSinceBlockCmd{
				BlockHash:           nil,
				TargetConfirmations: btcjson.Int(1),
				IncludeWatchOnly:    btcjson.Bool(false),
			},
		},

Copy link
Collaborator

@onyb onyb left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for your contribution.

@onyb onyb added rpc and removed low priority labels Sep 9, 2020
@onyb onyb added this to the 0.22.0 milestone Sep 9, 2020
Copy link
Member

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

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

OK

@jcvernaleo jcvernaleo merged commit 5ae1f21 into btcsuite:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants