public IValidationResult Validate(RpcCommand command) { return(new ValidationResult { Valid = ValidateParameters(command.Params), RequiresUnlock = _unlockRequired.ContainsKey(command.Method), ErrorText = GetErrorText() }); }
public IValidationResult Validate(RpcCommand command) { if (command == null) { return(new ValidationResult { ErrorText = "Command expected" }); } if (!_validators.ContainsKey(command.Method)) { return(new ValidationResult { ErrorText = "Command not implemented" }); } return(_validators[command.Method].Validate(command)); }
public Payload(RpcCommand command) { Id = GenerateId(); Method = command.Method.ToString().ToLower(); Params = command.Params; }