Exemplo n.º 1
0
        /**
         * Return a specific envelope in the block by it's index.
         *
         * @param envelopeIndex
         * @return EnvelopeInfo that contains information on the envelope.
         * @throws InvalidProtocolBufferException
         */

        public EnvelopeInfo GetEnvelopeInfo(int envelopeIndex)
        {
            EnvelopeInfo ret;

            if (IsFiltered)
            {
                switch (filteredBlock.FilteredTransactions[envelopeIndex].Type)
                {
                case HeaderType.EndorserTransaction:
                    ret = new TransactionEnvelopeInfo(this, filteredBlock.FilteredTransactions[envelopeIndex]);
                    break;

                default:     //just assume base properties.
                    ret = new EnvelopeInfo(this, filteredBlock.FilteredTransactions[envelopeIndex]);
                    break;
                }
            }
            else
            {
                EnvelopeDeserializer ed = EnvelopeDeserializer.Create(block.Block.Data.Data[envelopeIndex], block.TransActionsMetaData[envelopeIndex]);

                switch (ed.Type)
                {
                case (int)HeaderType.EndorserTransaction:
                    ret = new TransactionEnvelopeInfo(this, (EndorserTransactionEnvDeserializer)ed);
                    break;

                default:     //just assume base properties.
                    ret = new EnvelopeInfo(this, ed);
                    break;
                }
            }

            return(ret);
        }
Exemplo n.º 2
0
 public TransactionEvent(BlockEvent evnt, TransactionEnvelopeInfo transactionEnvelopeInfo) : base(evnt, transactionEnvelopeInfo.TransactionDeserializer)
 {
 }