public static ContractInterface Unserialize(BinaryReader reader) { var len = reader.ReadByte(); var methods = new ContractMethod[len]; for (int i = 0; i < len; i++) { methods[i] = ContractMethod.Unserialize(reader); } return(new ContractInterface(methods)); }
/// <summary> /// Checks if this ABI implements a specific method /// </summary> public bool Implements(ContractMethod method) { if (!_methods.ContainsKey(method.name)) { return(false); } var thisMethod = _methods[method.name]; if (thisMethod.parameters.Length != method.parameters.Length) { return(false); } for (int i = 0; i < method.parameters.Length; i++) { if (thisMethod.parameters[i].type != method.parameters[i].type) { return(false); } } return(true); }