private void InitDecoders() { //initialize static constructors of needed decoders DataAssetDecoder.Init(); UnitsRangeDecoder.Init(); TransactionInfoDecoder.Init(); DataAssetRulesDecoder.Init(); DataAssetRuleDecoder.Init(); DataRequestDecoder.Init(); DataAssetProviderDecoder.Init(); }
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); }
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(); }
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(); }
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)); } }