-
Notifications
You must be signed in to change notification settings - Fork 297
* Fix operator== for signatures type in old-fashion model and sh_m #1302
Conversation
/** | ||
* @given Transaction with marked signature | ||
* @when Invoke ::addSignature with same public key but different signed | ||
* @then Expect that second signature doesn't added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't -> wasn't
/** | ||
* @given Block with marked signature | ||
* @when Invoke ::addSignature with same public key but different signed | ||
* @then Expect that second signature doesn't added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (doesn't -> wasn't)
shared_model::crypto::PublicKey("key_one"))); | ||
ASSERT_FALSE(block.addSignature(shared_model::crypto::Signed("sign_two"), | ||
shared_model::crypto::PublicKey("key_one"))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline plz.
} | ||
|
||
/** | ||
* @given Transaction with marked signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better to use "given" instead of "marked".
Or may be even move everything about transaction to "when" part (e. g. given transaction, when addSignature() invoked twice with ...)
} | ||
|
||
/** | ||
* @given Block with marked signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See note about "marked" from previous test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo the test should be in test/module/shared_model/backend_proto
#include "module/shared_model/builders/protobuf/test_transaction_builder.hpp" | ||
|
||
/** | ||
* @given Two signatures with same pub key but different signed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signed -> signature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of sm_m objects Signature is a pair: PubKey × Signed. Here I want to reflect different signed explicitly.
* Fix ::addSignature for tx and block Signed-off-by: Fedor Muratov <muratovfyodor@yandex.ru>
Signed-off-by: Fedor Muratov <muratovfyodor@yandex.ru>
Signed-off-by: Fedor Muratov <muratovfyodor@yandex.ru>
13787a4
to
c20deb0
Compare
…ransaction Signed-off-by: Fedor Muratov <muratovfyodor@yandex.ru>
* Fix rebase issues: add const ref for tx and block, also, fix clang-format Signed-off-by: Fedor Muratov <muratovfyodor@yandex.ru>
Description of the Change
Benefits
Close potential security issues for Iroha's stateless validation.
Usage Examples or Tests [optional]
Tests are provided.