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

Features/proxy generatoaddress #267

Merged
merged 9 commits into from
Jun 14, 2022

Conversation

phillamy
Copy link
Contributor

Added a generatetoaddress in proxy. This lets the proxy/tests/tests.sh run without user having to mine 1 block

@Kexkey
Copy link
Collaborator

Kexkey commented May 25, 2022

I'd like the arguments to all be optional: if no nbblocks provided, use 1 and if no address supplied, get a new one from the spending wallet.

Thanks!!

schema:
type: "object"
properties:
nbBlocks:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make the arguments optional and the request HTTP-GET compatible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!


local nbblocks=$(echo ${1} | jq '.nbblocks // 1') # Optional - Default 1
local address=$(echo ${1} | jq '.address' // empty) # Optional - getnewadress from spender wallet
local maxtries=$(echo ${1} | jq '.maxtries // 1000000') # Optional - use Core default
Copy link
Contributor Author

@phillamy phillamy May 25, 2022

Choose a reason for hiding this comment

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

I hard coded core default value - not using core's actual or futur default value. Would it be better to leave it empty if not specified ?

@@ -72,6 +72,7 @@ action_removefrombatch=spender
action_listbatchers=spender
action_getbatcher=spender
action_getbatchdetails=spender
action_generatetoaddress=spender
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's actually bitcoin_generatetoaddress
This doesn't work when request goes through the gatekeeper.
Maybe we should add going through the gatekeeper in all the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, fixed it

@@ -72,6 +72,7 @@ action_removefrombatch=spender
action_listbatchers=spender
action_getbatcher=spender
action_getbatchdetails=spender
action_generatetoaddress=spender
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I know, we should add the new endpoint to api_auth_docker/tests/test-gatekeeper.sh

@phillamy
Copy link
Contributor Author

All changes made

@phillamy phillamy requested a review from Kexkey June 13, 2022 20:40
@Kexkey Kexkey merged commit 22ccc1b into SatoshiPortal:dev Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants