rpc/client: get policy contract hash in Init()
Drop hardcoded value.
This commit is contained in:
parent
ab12eee346
commit
9a78f1da19
3 changed files with 46 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue