function generateTxReceipt(tx, txResult, cumulativeGasUsed) {
    var _a;
    return __awaiter(this, void 0, void 0, function () {
        var baseReceipt, receipt, stateRoot;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    baseReceipt = {
                        gasUsed: cumulativeGasUsed.toArrayLike(Buffer),
                        bitvector: txResult.bloom.bitvector,
                        logs: (_a = txResult.execResult.logs) !== null && _a !== void 0 ? _a : [],
                    };
                    if (!(!('transactionType' in tx) || tx.transactionType === 0)) return [3 /*break*/, 4];
                    if (!this._common.gteHardfork('byzantium')) return [3 /*break*/, 1];
                    // Post-Byzantium
                    receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    return [3 /*break*/, 3];
                case 1: return [4 /*yield*/, this.stateManager.getStateRoot(true)];
                case 2:
                    stateRoot = _b.sent();
                    receipt = __assign({ stateRoot: stateRoot }, baseReceipt);
                    _b.label = 3;
                case 3: return [3 /*break*/, 5];
                case 4:
                    if ('transactionType' in tx && tx.transactionType === 1) {
                        // EIP2930 Transaction
                        receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    }
                    else if ('transactionType' in tx && tx.transactionType === 2) {
                        // EIP1559 Transaction
                        receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    }
                    else {
                        throw new Error("Unsupported transaction type " + ('transactionType' in tx ? tx.transactionType : 'NaN'));
                    }
                    _b.label = 5;
                case 5: return [2 /*return*/, receipt];
            }
        });
    });
}
/**
 * Returns the tx receipt.
 * @param this The vm instance
 * @param tx The transaction
 * @param txResult The tx result
 * @param cumulativeGasUsed The gas used in the block including this tx
 */
Returns the tx receipt.
@param this The vm instance
@param tx The transaction
@param txResult The tx result
@param cumulativeGasUsed The gas used in the block including this tx
Returns the tx receipt . @param this The vm instance @param tx The transaction @param txResult The tx result @param cumulativeGasUsed The gas used in the block including this tx
function generateTxReceipt(tx, txResult, cumulativeGasUsed) {
    var _a;
    return __awaiter(this, void 0, void 0, function () {
        var baseReceipt, receipt, stateRoot;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    baseReceipt = {
                        gasUsed: cumulativeGasUsed.toArrayLike(Buffer),
                        bitvector: txResult.bloom.bitvector,
                        logs: (_a = txResult.execResult.logs) !== null && _a !== void 0 ? _a : [],
                    };
                    if (!(!('transactionType' in tx) || tx.transactionType === 0)) return [3 , 4];
                    if (!this._common.gteHardfork('byzantium')) return [3 , 1];
                    receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    return [3 , 3];
                case 1: return [4 , this.stateManager.getStateRoot(true)];
                case 2:
                    stateRoot = _b.sent();
                    receipt = __assign({ stateRoot: stateRoot }, baseReceipt);
                    _b.label = 3;
                case 3: return [3 , 5];
                case 4:
                    if ('transactionType' in tx && tx.transactionType === 1) {
                        receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    }
                    else if ('transactionType' in tx && tx.transactionType === 2) {
                        receipt = __assign({ status: txResult.execResult.exceptionError ? 0 : 1 }, baseReceipt);
                    }
                    else {
                        throw new Error("Unsupported transaction type " + ('transactionType' in tx ? tx.transactionType : 'NaN'));
                    }
                    _b.label = 5;
                case 5: return [2 , receipt];
            }
        });
    });
}
function generateTxReceipt ( tx , txResult , cumulativeGasUsed ) { var _a ; return __awaiter ( this , void 0 , void 0 , function ( ) { var baseReceipt , receipt , stateRoot ; return __generator ( this , function ( _b ) { switch ( _b . label ) { case 0 : baseReceipt = { gasUsed : cumulativeGasUsed . toArrayLike ( Buffer ) , bitvector : txResult . bloom . bitvector , logs : ( _a = txResult . execResult . logs ) !== null && _a !== void 0 ? _a : [ ] , } ; if ( ! ( ! ( 'transactionType' in tx ) || tx . transactionType === 0 ) ) return [ 3 , 4 ] ; if ( ! this . _common . gteHardfork ( 'byzantium' ) ) return [ 3 , 1 ] ; receipt = __assign ( { status : txResult . execResult . exceptionError ? 0 : 1 } , baseReceipt ) ; return [ 3 , 3 ] ; case 1 : return [ 4 , this . stateManager . getStateRoot ( true ) ] ; case 2 : stateRoot = _b . sent ( ) ; receipt = __assign ( { stateRoot : stateRoot } , baseReceipt ) ; _b . label = 3 ; case 3 : return [ 3 , 5 ] ; case 4 : if ( 'transactionType' in tx && tx . transactionType === 1 ) { receipt = __assign ( { status : txResult . execResult . exceptionError ? 0 : 1 } , baseReceipt ) ; } else if ( 'transactionType' in tx && tx . transactionType === 2 ) { receipt = __assign ( { status : txResult . execResult . exceptionError ? 0 : 1 } , baseReceipt ) ; } else { throw new Error ( "Unsupported transaction type " + ( 'transactionType' in tx ? tx . transactionType : 'NaN' ) ) ; } _b . label = 5 ; case 5 : return [ 2 , receipt ] ; } } ) ; } ) ; }
Returns the tx receipt.
Returns the tx receipt .
/*break*/ /*break*/ // Post-Byzantium /*break*/ /*yield*/ /*break*/ // EIP2930 Transaction // EIP1559 Transaction /*return*/