Пример #1
0
 public IValidationResult Validate(RpcCommand command)
 {
     return(new ValidationResult
     {
         Valid = ValidateParameters(command.Params),
         RequiresUnlock = _unlockRequired.ContainsKey(command.Method),
         ErrorText = GetErrorText()
     });
 }
Пример #2
0
        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));
        }
Пример #3
0
 public Payload(RpcCommand command)
 {
     Id     = GenerateId();
     Method = command.Method.ToString().ToLower();
     Params = command.Params;
 }