コード例 #1
0
ファイル: BlockInfo.cs プロジェクト: mvaneijk/fabric-sdk-net
        /**
         * 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);
        }
コード例 #2
0
 public TransactionEvent(BlockEvent evnt, TransactionEnvelopeInfo transactionEnvelopeInfo) : base(evnt, transactionEnvelopeInfo.TransactionDeserializer)
 {
 }