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