Neo node can return integers values where []byte is expected.
To cover such cases, try to parse integers in `BytesFromStackItem`.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Add handler closure over worker pool
in the event package.
Add `addNewEpochAsyncNotificationHandler`
function that uses that closure. Pass
the reputation report handler to worker
pool via using that function.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Add checking if returned error contains
"already on chain" substring. Do not
consider that behavior to be erroneous.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
If non-"HALT" `State` occurs after
calling `InvokeFunction` NeoGo client
method, add `FaultException` information
to returning error. Add returning state
check to `NotaryInvoke` method of the
morph/client.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
New neo-go version provides:
- new type for roles in `RoleManagement` contract,
- methods to get keys from `RoleManagement` contract,
- new way to sign notary transaction.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
RoleManagement native contract (ex designate contract) stores list
of keys per role. Main net uses NeoFSAlphabet role to store keys of
alphabet nodes of inner ring. Side chain uses the same role to store
keys of all inner ring nodes, including alphabet.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Committee invocations use other M/N parameters of multi signature
signer address. For committee M = N/2 + 1
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Implement `Client.MagicNumber` method that returns magic number of the
network to which the underlying RPC node client is connected.
Network magic value is received via `GetNetwork` method.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement API methods of the Container contracts client corresponding
to the calls of the contract for storing the used space of the container
("putContainerSize", "getContainerSize", "listContainerSizes"). Extend
the wrapper over the client with methods abstracted from sidechen calls.
In particular, the method of storing the value will be used to record
the estimates of the used space of containers calculated by the network
participants.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace WSClient.Init call from the body of BlockNotifications method to
constructor New since Init should be called before working with client
according to neo-go docs.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Write error returned by BlockNotifications() call ins listenLoop method body
to error channel only if it is procided. Otherwise, write debug log message.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace block channel's initialization from BlockNotifications method body
to Subscriber's constructor in order to prevent potential writing to nil
channel.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Extend Listener with RegisterBlockHandler method. All block handlers are
called on each block read from Subscriber.BlockNotifications channel.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Call SubscribeForNewBlocks in Subscriber's constructor. Provide
BlockNotifications interface method that returns block channel. Write new
blocks to the channel on notification events with BlockEventID type.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>