It was reverted because `Verify` with arguments was not well supported
by the client software. Thanks to recent `System.Runtime.CurrentSigners`
call from neo-go v0.104.0 we can take the best of both worlds.
Verify with argument still looks better (less overhead), but this
implementation should work too. Sadly, `overloads` are not of much use
here because verification routines take the _first_ method from the
manifest, albeit with arbitrary number of arguments.
This reverts commit a0b73150c6 with some
changes on-top.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Require ns to create subject.
Since we don't allow move subject from one ns to another -
drop add/remove subject to/from namespace
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
Autorization can be dedicated to a separate contract, iterating over
multiple keys can be costly. Also add committee as "default" admin:
everything is allowed for it.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
We don't want to return Null from contract when list is empty
because generated policy client cannot parse this.
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
Persisting a transaction is done in 2 stages:
1. TestInvoke
2. Sign and send to the network.
3. At some point the tx is persisted.
Some time passes between 1 and 3, this could lead to different GAS
costs. It is a known issue for container delete: different epoch can
have different size in bytes and thus different cost to store.
Here we introduce fixed-length encoding for integers, so that the
problem can be avoided.
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Add method that allows to iterate over estimation records.
Update tests to assert that list of estimations built with existing methods
is identical to estimations from iterator.
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
There is a need to return similar structure of information about the
storage nodes from the contract storage readers. In previous
implementation some methods didn't return node state which can differ
with the one encoded in the node's BLOB.
Define `Node` structure of the information about the storage nodes
recorded in the contract storage. Return `[]Node` from all related
methods.
Also improve docs of touched contract methods.
Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
There are 2 approaches:
1. Use `storage.Find` to enumerate all containers.
2. Store a counter by a separate key.
Here we implemented 1, because this method is readonly (thus GAS cost it
not a problem) and simpler to implement.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>