core: implement System.Contract.Call interop
This commit is contained in:
parent
301c1b7601
commit
ec900c7ff7
4 changed files with 51 additions and 14 deletions
|
@ -84,6 +84,16 @@ type ContractMD struct {
|
|||
Methods map[string]MethodAndPrice
|
||||
}
|
||||
|
||||
// GetContract returns script of the contract with the specified hash.
|
||||
func (ic *Context) GetContract(h util.Uint160) ([]byte, bool) {
|
||||
cs, err := ic.DAO.GetContractState(h)
|
||||
if err != nil {
|
||||
return nil, false
|
||||
}
|
||||
hasDynamicInvoke := (cs.Properties & smartcontract.HasDynamicInvoke) != 0
|
||||
return cs.Script, hasDynamicInvoke
|
||||
}
|
||||
|
||||
// NewContractMD returns Contract with the specified list of methods.
|
||||
func NewContractMD(name string) *ContractMD {
|
||||
c := &ContractMD{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue