Commit graph

15 commits

Author SHA1 Message Date
Roman Khimov
1b83dc2476 *: improve for loop syntax
Mostly it's about Go 1.22+ syntax with ranging over integers, but it also
prefers ranging over slices where possible (it makes code a little better to
read).

Notice that we have a number of dangerous loops where slices are mutated
during loop execution, many of these can't be converted since we need proper
length evalutation at every iteration.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-08-30 21:45:18 +03:00
Roman Khimov
a1a7e3d708 *: use slices package for sorting and searching
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-08-27 12:29:44 +03:00
Evgenii Stratonikov
c8ff44560e neotest: reuse wallet.Account for contract signers
Refs #3245
Refs #3233

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
2023-12-21 11:27:41 +03:00
Dmitrii Stepanov
7b53a0c239 neotest: Add contract signer support
Signed-off-by: Dmitrii Stepanov <dima-stepan@yandex.ru>
2023-12-01 10:50:08 +03:00
Anna Shaleva
daa2b3b920 neotest: adjust Signer documentation
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-01 09:25:41 +03:00
Roman Khimov
7cedcb9197 neotest: fix NewSingleSigner description, fix #3118
Signed-off-by: Roman Khimov <roman@nspcc.ru>
2023-09-05 12:36:49 +03:00
Roman Khimov
317dd42513 *: use uint*Size and SignatureLen constants where appropriate 2022-10-05 10:45:52 +03:00
Roman Khimov
e164625a7f wallet: provide (*Account).SignHashable API
Make PrivateKey() less used and less useful.
2022-09-02 14:44:01 +03:00
Roman Khimov
8d33206bb8 *: don't get private key from account if just public one is needed
Add PublicKey() API to the Account and use it as appropriate, avoid creating
additional references to the private key.
2022-09-02 14:43:28 +03:00
Elizaveta Chichindaeva
28908aa3cf [#2442] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-04 19:48:27 +03:00
Anna Shaleva
59f3fa1ef1 neotest: adapt framework to work with *testing.B 2022-03-30 12:17:55 +03:00
Evgeniy Stratonikov
37ecf51d13 neotest: allow to extract simple signers from multi-signer
There is a quirk related to ordering: we store accounts in such an order that
is expected by multi-signature verification script. This was done to
speed up transaction/block signing which is done quite frequently in
tests. This commit allows to provide accounts in any order and to
extract a single signer from multi-signer based on this order.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-12-09 21:59:02 +03:00
Evgeniy Stratonikov
d4689db47e neotest: allow to extract account from single signer
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-12-09 21:59:02 +03:00
Evgeniy Stratonikov
79a48a7800 neotest: allow to use 6-node committee
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-11-11 11:15:15 +03:00
Evgeniy Stratonikov
950adb7b89 neotest: support painless multi-signing
Implementing a separate `Signer` interface is beneficial in multiple
ways:
1. Support both single and multiple transaction witnesses.
2. It should be easy to add contract signer this way.

Tests should use accounts created with `NewAccount` so hiding all
details doesn't seem to be an issue.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-11-11 11:15:15 +03:00