You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to explore modular contract, we require states to be accessed in other classes which can be used to compose the final contracts.
But we have rule to require state to be only accessible from the contract class. We may need to disable it temporarily so that we can test out our modular contract ideas.
privateList<ValidationResult>ValidateMethod(ModuleDefinitionmoduleDefinition,MethodDefinitionmethodDefinition){if(!methodDefinition.HasBody)returnnewList<ValidationResult>();varisNotContractImplementation=!methodDefinition.DeclaringType.IsContractImplementation();varresult=newList<ValidationResult>();foreach(varinstructioninmethodDefinition.Body.Instructions.Where(instruction =>_instructionInjector.IdentifyInstruction(instruction)).ToList()){// TODO: https://github.com/AElfProject/AElf/issues/3387if(isNotContractImplementation){result.Add(newMethodCallInjectionValidationResult($"{_instructionInjector.GetType()} validation failed. Updating state in non-contract class is not allowed.").WithInfo(methodDefinition.Name,methodDefinition.DeclaringType.Namespace,methodDefinition.DeclaringType.FullName,null));}elseif(!_instructionInjector.ValidateInstruction(moduleDefinition,instruction)){result.Add(newMethodCallInjectionValidationResult($"{_instructionInjector.GetType()} validation failed.").WithInfo(methodDefinition.Name,methodDefinition.DeclaringType.Namespace,methodDefinition.DeclaringType.FullName,null));}}returnresult;}
The text was updated successfully, but these errors were encountered:
If we want to explore modular contract, we require states to be accessed in other classes which can be used to compose the final contracts.
But we have rule to require state to be only accessible from the contract class. We may need to disable it temporarily so that we can test out our modular contract ideas.
The text was updated successfully, but these errors were encountered: