[#398] morph/client: Add method to read magic number

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>
This commit is contained in:
Leonard Lyubich 2021-02-19 10:54:26 +03:00 committed by Alex Vanin
parent 146abe8520
commit 4c8d29ce46

View file

@ -166,3 +166,9 @@ func toStackParameter(value interface{}) (sc.Parameter, error) {
return result, nil
}
// MagicNumber returns the magic number of the network
// to which the underlying RPC node client is connected.
func (c *Client) MagicNumber() uint64 {
return uint64(c.client.GetNetwork())
}