core: fix error propagation in contract-related interops

Obvious bug that hides failed contract deployments.
This commit is contained in:
Roman Khimov 2020-03-09 14:18:00 +03:00
parent 4b83e9a5cd
commit 4587121c7f

View file

@ -515,7 +515,7 @@ func (ic *interopContext) createContractStateFromVM(v *vm.VM) (*state.Contract,
func (ic *interopContext) contractCreate(v *vm.VM) error { func (ic *interopContext) contractCreate(v *vm.VM) error {
newcontract, err := ic.createContractStateFromVM(v) newcontract, err := ic.createContractStateFromVM(v)
if err != nil { if err != nil {
return nil return err
} }
contract, err := ic.dao.GetContractState(newcontract.ScriptHash()) contract, err := ic.dao.GetContractState(newcontract.ScriptHash())
if err != nil { if err != nil {
@ -555,7 +555,7 @@ func (ic *interopContext) contractIsPayable(v *vm.VM) error {
func (ic *interopContext) contractMigrate(v *vm.VM) error { func (ic *interopContext) contractMigrate(v *vm.VM) error {
newcontract, err := ic.createContractStateFromVM(v) newcontract, err := ic.createContractStateFromVM(v)
if err != nil { if err != nil {
return nil return err
} }
contract, err := ic.dao.GetContractState(newcontract.ScriptHash()) contract, err := ic.dao.GetContractState(newcontract.ScriptHash())
if err != nil { if err != nil {