public Session Decode(Nethermind.Core.Encoding.Rlp.DecoderContext context, RlpBehaviors rlpBehaviors = RlpBehaviors.None) { var sequenceLength = context.ReadSequenceLength(); if (sequenceLength == 0) { return(null); } var id = context.DecodeKeccak(); var depositId = context.DecodeKeccak(); var dataHeaderId = context.DecodeKeccak(); var consumerAddress = context.DecodeAddress(); var consumerNodeId = new PublicKey(context.DecodeByteArray()); var providerAddress = context.DecodeAddress(); var providerNodeId = new PublicKey(context.DecodeByteArray()); var state = (SessionState)context.DecodeInt(); var startUnitsFromProvider = context.DecodeUInt(); var startUnitsFromConsumer = context.DecodeUInt(); var startTimestamp = context.DecodeUlong(); var finishTimestamp = context.DecodeUlong(); var consumedUnits = context.DecodeUInt(); var unpaidUnits = context.DecodeUInt(); var paidUnits = context.DecodeUInt(); var settledUnits = context.DecodeUInt(); return(new Session(id, depositId, dataHeaderId, consumerAddress, consumerNodeId, providerAddress, providerNodeId, state, startUnitsFromProvider, startUnitsFromConsumer, startTimestamp, finishTimestamp, consumedUnits, unpaidUnits, paidUnits, settledUnits)); }
public NdmConfig Decode(Nethermind.Core.Encoding.Rlp.DecoderContext context, RlpBehaviors rlpBehaviors = RlpBehaviors.None) { var sequenceLength = context.ReadSequenceLength(); if (sequenceLength == 0) { return(null); } var enabled = context.DecodeBool(); var storeConfigInDatabase = context.DecodeBool(); var id = context.DecodeString(); var filesPath = context.DecodeString(); var fileMaxSize = context.DecodeUlong(); var providerName = context.DecodeString(); var persistence = context.DecodeString(); var verifyP2PSignature = context.DecodeBool(); var providerAddress = context.DecodeString(); var providerColdWalletAddress = context.DecodeString(); var consumerAddress = context.DecodeString(); var contractAddress = context.DecodeString(); var receiptRequestThreshold = context.DecodeUInt256(); var receiptsMergeThreshold = context.DecodeUInt256(); var paymentClaimThreshold = context.DecodeUInt256(); var blockConfirmations = context.DecodeUInt(); return(new NdmConfig { Enabled = enabled, StoreConfigInDatabase = storeConfigInDatabase, Id = id, FilesPath = filesPath, FileMaxSize = fileMaxSize, ProviderName = providerName, Persistence = persistence, VerifyP2PSignature = verifyP2PSignature, ProviderAddress = providerAddress, ProviderColdWalletAddress = providerColdWalletAddress, ConsumerAddress = consumerAddress, ContractAddress = contractAddress, ReceiptRequestThreshold = receiptRequestThreshold, ReceiptsMergeThreshold = receiptsMergeThreshold, PaymentClaimThreshold = paymentClaimThreshold, BlockConfirmations = blockConfirmations }); }
public DepositApproval Decode(Nethermind.Core.Encoding.Rlp.DecoderContext context, RlpBehaviors rlpBehaviors = RlpBehaviors.None) { var sequenceLength = context.ReadSequenceLength(); if (sequenceLength == 0) { return(null); } var id = context.DecodeKeccak(); var headerId = context.DecodeKeccak(); var headerName = context.DecodeString(); var kyc = context.DecodeString(); var consumer = context.DecodeAddress(); var provider = context.DecodeAddress(); var timestamp = context.DecodeUlong(); var state = (DepositApprovalState)context.DecodeInt(); return(new DepositApproval(id, headerId, headerName, kyc, consumer, provider, timestamp, state)); }
public DataDeliveryReceiptDetails Decode(Nethermind.Core.Encoding.Rlp.DecoderContext context, RlpBehaviors rlpBehaviors = RlpBehaviors.None) { var sequenceLength = context.ReadSequenceLength(); if (sequenceLength == 0) { return(null); } var id = context.DecodeKeccak(); var sessionId = context.DecodeKeccak(); var dataHeaderId = context.DecodeKeccak(); var consumerNodeId = new PublicKey(context.DecodeByteArray()); var request = Nethermind.Core.Encoding.Rlp.Decode <DataDeliveryReceiptRequest>(context); var receipt = Nethermind.Core.Encoding.Rlp.Decode <DataDeliveryReceipt>(context); var timestamp = context.DecodeUlong(); var isClaimed = context.DecodeBool(); return(new DataDeliveryReceiptDetails(id, sessionId, dataHeaderId, consumerNodeId, request, receipt, timestamp, isClaimed)); }