Exemplo n.º 1
0
 public GetEcosystemContractAddressesValidator()
 {
     RuleFor(x => x.ContractAdr).Must((x, adr) => AppModelConfig.validateAddress(adr, true))
     .WithErrorCode(AppModelConfig.AddressError)
     .WithMessage(AppModelConfig.AddressErrorMessage);
 }
Exemplo n.º 2
0
 public DeployContractsValidator()
 {
     RuleFor(x => x.SigningPrivateKey).Must((x, privateKey) => AppModelConfig.validatePrivateKey(privateKey, true))
     .WithErrorCode(AppModelConfig.PrivateKeyError)
     .WithMessage(AppModelConfig.PrivateKeyErrorMessage);
 }
Exemplo n.º 3
0
 public GetTimerNotificationsValidator()
 {
     RuleFor(x => x.ContractAdr).Must((x, adr) => AppModelConfig.validateAddress(adr, true))
     .WithErrorCode(AppModelConfig.AddressError)
     .WithMessage(AppModelConfig.AddressErrorMessage);
 }
Exemplo n.º 4
0
 public GetReceiptValidator()
 {
     RuleFor(x => x.TransactionHash).Must((x, hash) => AppModelConfig.validateHash(hash, true))
     .WithErrorCode(AppModelConfig.HashError)
     .WithMessage(AppModelConfig.HashErrorMessage);
 }
Exemplo n.º 5
0
 public void parseLog(FilterLog fl)
 {
     BlockNumber           = Convert.ToUInt64(fl.BlockNumber.HexValue, 16);
     InternalReferenceHash = fl.Topics[1].ToString();
     AccountType           = (AccountType)Convert.ToUInt64(fl.Topics[2].ToString(), 16);
     Success            = fl.Topics[3].ToString().EndsWith("1");
     PaymentAccountHash = fl.Data.Substring(2 + 0 * 64, 64).EnsureHexPrefix();
     PaymentSubject     = fl.Data.Substring(2 + 1 * 64, 64).EnsureHexPrefix().StartsWith("0x000000") ?
                          Convert.ToUInt64(fl.Data.Substring(2 + 1 * 64, 64), 16).ToString() :
                          fl.Data.Substring(2 + 1 * 64, 64).EnsureHexPrefix();
     Info            = AppModelConfig.isEmptyHash(fl.Data.Substring(2 + 2 * 64, 64).EnsureHexPrefix()) ? "0x0" : AppModelConfig.FromHexString(fl.Data.Substring(2 + 2 * 64, 64));
     Timestamp       = Convert.ToUInt64(fl.Data.Substring(2 + 3 * 64, 64), 16);
     TransactionType = (TransactionType)Convert.ToUInt64(fl.Data.Substring(2 + 4 * 64, 64), 16);
     Amount          = Convert.ToUInt64(fl.Data.Substring(2 + 5 * 64, 64), 16);
 }