-
Notifications
You must be signed in to change notification settings - Fork 648
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
API get_required_signatures shouldn't return already signed key(s) #200
Comments
please check: "The result is not always a minimal set of signatures, but any non-minimal result will still pass validation." |
True. But it's not hard to remove the keys which are already in the signatures. |
on it. |
More info at bitshares#200
please check: As we don't have the private key it is not possible to check if the signature of the transaction, following your sample signature:
was actually created with the available key:
But there is a loop in get_required signatures that actually was supposed to delete the key if it is repeated in both arrays. The loop was not working propertly and the key was still showing. The pull request fix that, so following the sample. Preliminar:
Requesting signals with the correct key:
Requesting with some other key:
This is i think the expected output. |
IMHO it should also return an empty set (as a supplement to OP). |
changed pull request code, as you stated the logic was wrong. new output:
is this the correct behavior or it should return empty ? can you explain a bit further on why it should return empty ? |
Let's discuss the purpose of this API first: a client wants to know what keys are required to sign a transaction, or say, what signatures are missing to authorize a transaction. Apparently:
So the logic should be Here are some test cases:
|
PR merged. |
From @abitmore on March 24, 2016 22:33
The in-code document of
get_required_signatures
API says:If I understood correctly, when an unsigned transaction requires a signature of key
A
only, sign it withA
, then call this API with the signed transaction astrx
andA
asavailable_keys
, it should return an empty set. However, with latest version (2.0.160316b
), the API returns a set containsA
. Same behavior is found with earlier versions.Log of a test on live BTS chain:
Copied from original issue: cryptonomex/graphene#636
The text was updated successfully, but these errors were encountered: