Exemplo n.º 1
0
        public static bool IsExceptionForError(this ErrorABI errorABI, RpcResponseException exception)
        {
            if (exception.RpcError.Data == null)
            {
                return(false);
            }
            var encodedData = exception.RpcError.Data.ToString();

            if (!encodedData.IsHex())
            {
                return(false);
            }
            return(encodedData.IsExceptionEncodedDataForError(errorABI.Sha3Signature));
        }
        public static void HandleContractRevertException(RpcResponseException rpcException)
        {
            if (rpcException.RpcError.Data != null)
            {
                var encodedErrorData = rpcException.RpcError.Data.ToString();
                if (encodedErrorData.IsHex())
                {
                    //check normal revert
                    new FunctionCallDecoder().ThrowIfErrorOnOutput(encodedErrorData);

                    //throw custom error
                    throw new SmartContractCustomErrorRevertException(encodedErrorData);
                }
            }
        }
Exemplo n.º 3
0
 protected abstract void HandleDataResponseError(RpcResponseException exception);
Exemplo n.º 4
0
 protected abstract void HandleUnsubscribeResponseError(RpcResponseException exception);
Exemplo n.º 5
0
 protected override void HandleResponseError(RpcResponseException exception)
 {
     ResponseSubject.OnError(exception);
 }
Exemplo n.º 6
0
 public StreamingEventArgs(RpcResponseException exception)
 {
     Exception = exception;
 }
Exemplo n.º 7
0
 public StreamingEventArgs(TEntity entity, RpcResponseException exception = null)
 {
     Response = entity;
 }
 protected override void HandleUnsubscribeResponseError(RpcResponseException exception)
 {
     UnsubscribeResponse?.Invoke(this, new StreamingEventArgs <bool>(exception));
 }
 protected override void HandleDataResponseError(RpcResponseException exception)
 {
     SubscriptionDataResponse?.Invoke(this, new StreamingEventArgs <TSubscriptionDataResponse>(exception));
 }
 public TooManyRecordsException(RpcResponseException innerException) : base(innerException.Message, innerException)
 {
 }
Exemplo n.º 11
0
 protected override void HandleDataResponseError(RpcResponseException exception)
 {
     SubscriptionDataResponseSubject.OnError(exception);
 }
Exemplo n.º 12
0
 public bool IsExceptionForError(RpcResponseException exception)
 {
     return(ErrorABI.IsExceptionForError(exception));
 }
Exemplo n.º 13
0
 protected override void HandleResponseError(RpcResponseException exception)
 {
     Response?.Invoke(this, new StreamingEventArgs <TResponse>(exception));
 }
 public static TooManyRecordsException TooManyRecordsException(this RpcResponseException rpcResponseEx)
 {
     return(new TooManyRecordsException(rpcResponseEx));
 }
 public static bool TooManyRecords(this RpcResponseException rpcResponseEx)
 {
     return(rpcResponseEx.Message.StartsWith(TooManyRecordsMessagePrefix));
 }