public bool InvokeTriggerOnAccount(Address address, AccountTrigger trigger, params object[] args) { if (address.IsNull) { return(false); } if (address.IsUser) { //var accountScript = Nexus.LookUpAddressScript(RootStorage, address); var accountScript = OptimizedAddressScriptLookup(address); //Expect(accountScript.SequenceEqual(accountScript2), "different account scripts"); return(InvokeTrigger(accountScript, trigger.ToString(), args)); } if (address.IsSystem) { var contract = Nexus.GetContractByAddress(RootStorage, address); if (contract != null) { var triggerName = trigger.ToString(); if (contract.HasInternalMethod(triggerName)) { CallContext(contract.Name, triggerName, args); } } return(true); } return(true); }
public bool InvokeTriggerOnAccount(Address address, AccountTrigger trigger, params object[] args) { if (address.IsNull) { return(false); } if (address.IsUser) { var accountScript = Nexus.LookUpAddressScript(this.changeSet, address); return(InvokeTrigger(accountScript, trigger.ToString(), args)); } if (address.IsSystem) { var contract = Nexus.GetContractByAddress(address); if (contract != null) { var triggerName = trigger.ToString(); BigInteger gasCost; if (contract.HasInternalMethod(triggerName, out gasCost)) { CallContext(contract.Name, triggerName, args); } } return(true); } return(true); }
public static bool InvokeTriggerOnAccount(this IRuntime runtime, Address address, AccountTrigger trigger, params object[] args) { if (address.IsNull) { return(false); } if (address.IsUser) { var accountScript = runtime.GetAddressScript(address); return(runtime.InvokeTrigger(accountScript, trigger.ToString(), args)); } return(true); }
public static bool InvokeTriggerOnAccount(RuntimeVM runtimeVM, Address address, AccountTrigger trigger, params object[] args) { if (address.IsNull) { return(false); } if (address.IsUser) { var accountScript = runtimeVM.Nexus.LookUpAddressScript(address); return(InvokeTrigger(runtimeVM, accountScript, trigger.ToString(), args)); } return(true); }