예제 #1
0
        public TransactionTrace(TransactionCapsule tx, DatabaseManager db_manager)
        {
            this.transaction      = tx;
            this.db_manager       = db_manager;
            this.receipt          = new ReceiptCapsule(SHA256Hash.ZERO_HASH);
            this.energy_processor = new EnergyProcessor(this.db_manager);

            ContractType contract_type = this.transaction.Instance.RawData.Contract[0].Type;

            switch (contract_type)
            {
            case ContractType.TriggerSmartContract:
                this.transaction_type = InternalTransaction.TransactionType.TX_CONTRACT_CALL_TYPE;
                break;

            case ContractType.CreateSmartContract:
                this.transaction_type = InternalTransaction.TransactionType.TX_CONTRACT_CREATION_TYPE;
                break;

            default:
                this.transaction_type = InternalTransaction.TransactionType.TX_PRECOMPILED_TYPE;
                break;
            }
        }