Add methods Get/SetAdmin for policy contract interface wrapper #37

Merged
acid-ant merged 1 commit from acid-ant/policy-engine:feature/storage-admin-api into master 2023-12-21 04:51:22 +00:00

View file

@ -104,6 +104,15 @@ func (s *ContractStorage) ListMorphRuleChains(name chain.Name, target engine.Tar
return chains, nil return chains, nil
} }
func (s *ContractStorage) GetAdmin() (util.Uint160, error) {
return s.contractInterface.GetAdmin()
}
func (s *ContractStorage) SetAdmin(addr util.Uint160) error {
_, _, err := s.contractInterface.SetAdmin(addr)
return err
}
func bytesFromStackItem(param stackitem.Item) ([]byte, error) { func bytesFromStackItem(param stackitem.Item) ([]byte, error) {
switch param.Type() { switch param.Type() {
case stackitem.BufferT, stackitem.ByteArrayT, stackitem.IntegerT: case stackitem.BufferT, stackitem.ByteArrayT, stackitem.IntegerT: