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: Added totalSigs to JSON response for scriptToJSON #824

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

Nathanwoodburn
Copy link
Contributor

  • Added totalSigs property to the JSON response object
  • Use getMultisig() function to return n value if available

- Added totalSigs property to the JSON response object
- Use getMultisig() function to return n value if available
Copy link
Member

@rithvikvibhu rithvikvibhu left a comment

Choose a reason for hiding this comment

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

I'm still not sure about the name totalSigs because the script itself doesn't have any sigs, maybe maxSigs or something else?

Anyway, this works fine:

❯ hsd-cli rpc decodescript 52210264a3da1824775466f384369f90afb2f1d808336460595949c0d29c9148faf4dd2103101876dd6cfbf0500d2ac50e0462733180a5ec379dec6adea0e12c14cc053a28210369c50833277fb85ffc63e975a876a2ed6f5bd902749b4ba234b527f9e12c3e5253ae
{
  "asm": "OP_2 0264a3da1824775466f384369f90afb2f1d808336460595949c0d29c9148faf4dd 03101876dd6cfbf0500d2ac50e0462733180a5ec379dec6adea0e12c14cc053a28 0369c50833277fb85ffc63e975a876a2ed6f5bd902749b4ba234b527f9e12c3e52 OP_3 OP_CHECKMULTISIG",
  "type": "MULTISIG",
  "reqSigs": 2,
  "totalSigs": 3,
  "p2sh": "hs1q0kx4hladgefst0vk005e8ez7xejvw2jw7gaftny3a5savp5k3jwswsgrc6"
}

@Nathanwoodburn
Copy link
Contributor Author

We could change it to m and n except that would break existing applications using the RPC

@nodech nodech added patch Release version node-rpc part of the codebase breaking-minor Backwards compatible - Release version and removed patch Release version labels Jul 14, 2023
@nodech nodech merged commit 15f74cc into handshake-org:master Jul 14, 2023
nodech added a commit that referenced this pull request Jul 17, 2023
@nodech nodech mentioned this pull request Jul 17, 2023
nodech added a commit that referenced this pull request Jul 17, 2023
This was referenced Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-minor Backwards compatible - Release version node-rpc part of the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants