rpc/client: get policy contract hash in Init()

Drop hardcoded value.
This commit is contained in:
Roman Khimov 2020-12-13 19:08:47 +03:00
parent ab12eee346
commit 9a78f1da19
3 changed files with 46 additions and 5 deletions

View file

@ -127,6 +127,11 @@ func (c *Client) Init() error {
return fmt.Errorf("failed to get GAS contract scripthash: %w", err)
}
c.cache.nativeHashes["gas"] = gasContractHash.Hash
policyContractHash, err := c.GetContractStateByAddressOrName("policy")
if err != nil {
return fmt.Errorf("failed to get Policy contract scripthash: %w", err)
}
c.cache.nativeHashes["policy"] = policyContractHash.Hash
c.initDone = true
return nil
}