예제 #1
0
        public void Roundtrip(DepositDetails item)
        {
            DepositDecoder.Init();
            TransactionInfoDecoder.Init();
            DataAssetDecoder.Init();
            DataAssetRuleDecoder.Init();
            DataAssetRulesDecoder.Init();
            DataAssetProviderDecoder.Init();
            EarlyRefundTicketDecoder.Init();

            DepositDetailsDecoder decoder = new DepositDetailsDecoder();

            decoder.Decode(decoder.Encode(item).Bytes.AsRlpStream()).Should().BeEquivalentTo(item);
        }
예제 #2
0
 private static void AddDecoders()
 {
     DataDeliveryReceiptDecoder.Init();
     DataDeliveryReceiptRequestDecoder.Init();
     DataDeliveryReceiptToMergeDecoder.Init();
     DataDeliveryReceiptDetailsDecoder.Init();
     DataHeaderDecoder.Init();
     DataHeaderRuleDecoder.Init();
     DataHeaderRulesDecoder.Init();
     DataHeaderProviderDecoder.Init();
     DataRequestDecoder.Init();
     DepositDecoder.Init();
     DepositApprovalDecoder.Init();
     EarlyRefundTicketDecoder.Init();
     EthRequestDecoder.Init();
     SessionDecoder.Init();
     UnitsRangeDecoder.Init();
 }
예제 #3
0
 private static void InitDecoders()
 {
     DataAssetDecoder.Init();
     DataAssetRulesDecoder.Init();
     DataAssetRuleDecoder.Init();
     DataAssetProviderDecoder.Init();
     DataDeliveryReceiptDecoder.Init();
     DataRequestDecoder.Init();
     EarlyRefundTicketDecoder.Init();
     FaucetResponseDecoder.Init();
     FaucetRequestDetailsDecoder.Init();
     DataDeliveryReceiptDecoder.Init();
     DataDeliveryReceiptRequestDecoder.Init();
     UnitsRangeDecoder.Init();
     SessionDecoder.Init();
     DepositApprovalDecoder.Init();
     DataDeliveryReceiptToMergeDecoder.Init();
 }
예제 #4
0
        public MessageTests()
        {
            _service.Register(typeof(HiMessage).Assembly);

            DataAssetDecoder.Init();
            DataAssetRulesDecoder.Init();
            DataAssetRuleDecoder.Init();
            DataAssetProviderDecoder.Init();
            DataDeliveryReceiptDecoder.Init();
            DataRequestDecoder.Init();
            EarlyRefundTicketDecoder.Init();
            FaucetResponseDecoder.Init();
            FaucetRequestDetailsDecoder.Init();
            DataDeliveryReceiptDecoder.Init();
            DataDeliveryReceiptRequestDecoder.Init();
            UnitsRangeDecoder.Init();
            SessionDecoder.Init();
            DepositApprovalDecoder.Init();
            DataDeliveryReceiptToMergeDecoder.Init();
        }
예제 #5
0
        static DepositDetailsRocksRepositoryTests()
        {
            if (_cases == null)
            {
                DepositDecoder.Init();
                TransactionInfoDecoder.Init();
                DataAssetDecoder.Init();
                DataAssetRuleDecoder.Init();
                DataAssetRulesDecoder.Init();
                DataAssetProviderDecoder.Init();
                EarlyRefundTicketDecoder.Init();

                Deposit           deposit   = new Deposit(TestItem.KeccakA, 100, 100, 100);
                DataAssetProvider provider  = new DataAssetProvider(TestItem.AddressA, "provider");
                DataAsset         dataAsset = new DataAsset(TestItem.KeccakA, "data_asset", "desc", 1, DataAssetUnitType.Time, 1000, 10000, new DataAssetRules(new DataAssetRule(1), null), provider, null, QueryType.Stream, DataAssetState.Published, null, false, null);
                DepositDetails    details   = new DepositDetails(
                    deposit,
                    dataAsset,
                    TestItem.AddressA,
                    Array.Empty <byte>(),
                    10,
                    Array.Empty <TransactionInfo>(),
                    9,
                    false,
                    false,
                    null,
                    Array.Empty <TransactionInfo>(),
                    false,
                    false,
                    null,
                    0,
                    6);
                _cases = new List <DepositDetails>();
                _cases.Add(details);

                _cases.Add(new DepositDetails(
                               deposit,
                               dataAsset,
                               TestItem.AddressA,
                               Array.Empty <byte>(),
                               10,
                               Array.Empty <TransactionInfo>(),
                               9,
                               false,
                               false,
                               null,
                               Array.Empty <TransactionInfo>(),
                               false,
                               false,
                               null,
                               0,
                               6));

                _cases.Add(new DepositDetails(
                               deposit,
                               dataAsset,
                               TestItem.AddressA,
                               Array.Empty <byte>(),
                               10,
                               Array.Empty <TransactionInfo>(),
                               9,
                               false,
                               false,
                               null,
                               Array.Empty <TransactionInfo>(),
                               false,
                               false,
                               null,
                               0,
                               6));
            }
        }