[#749] morph/client: cache NNS contract hash

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-29 14:07:12 +03:00 committed by Alex Vanin
parent 050a4bb2b0
commit 4838d3bb80
2 changed files with 13 additions and 5 deletions

View file

@ -33,13 +33,18 @@ import (
// expression (or just declaring a Client variable) is unsafe
// and can lead to panic.
type Client struct {
// two mutual exclusive modes, exactly one must be non-nil
cache
// two mutual exclusive modes, exactly one must be non-nil
*singleClient // works with single neo-go client
*multiClient // creates and caches single clients
}
type cache struct {
nnsHash util.Uint160
}
type singleClient struct {
logger *logger.Logger // logging component