[#846] morph/notary: Add nonce parameter to notary invocation method

This prevents notary requests collisions
for TXs that contains equals hashable fields.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-09-23 19:56:13 +03:00 committed by Alex Vanin
parent 3a8f0edac1
commit e3c0288e50
3 changed files with 18 additions and 10 deletions

View file

@ -78,7 +78,8 @@ func (s StaticClient) Morph() *Client {
func (s StaticClient) Invoke(method string, args ...interface{}) error {
if s.tryNotary {
if s.alpha {
return s.client.NotaryInvoke(s.scScriptHash, s.fee, method, args...)
// FIXME: do not use constant nonce for alphabet NR: #844
return s.client.NotaryInvoke(s.scScriptHash, s.fee, 1, method, args...)
}
return s.client.NotaryInvokeNotAlpha(s.scScriptHash, s.fee, method, args...)