<commit_before>import React, {Component} from 'react';
import {Table} from 'react-bootstrap';
import OutgoingOrderList from './OutgoingOrderList'

class OutgoingOrderListContainer extends Component {

    constructor(props){
        console.log("OutgoingOrderListContainer props: ")
        console.log(props)
        super(props)
        this.state = {
            outgoingOrders: [],
            account: props.account
        }
    }

    componentDidMount() {
        console.log("OutgoingOrderList DidMount")
        return

        var self = this

        // Get all existing contracts
        var allEvents = this.props.factoryInstance.allEvents({fromBlock: 0, toBlock: 'latest'})
        allEvents.get(function (error, logs) {
            if (error === null) {
                console.log("Got " + logs.length + " Past events")
                var entry
                for (entry of logs) {
                    console.log(entry)
                    self.orderContract.at(entry.args.orderAddress).then(function (order_instance) {
                        console.log("Adding order:")
                        console.log(order_instance)
                        self.setState({
                            // use concat to create a new array extended with the new order
                            outgoingOrders: self.state.outgoingOrders.concat([order_instance])
                        })
                    })
                }
            }
            else {
                console.log("Error while fetching past events:")
                console.log(error)
            }
        })

        // Start watching for new contracts
        this.createdOrders = this.props.factoryInstance.LogOrderCreated({fromBlock: 'pending', toBlock: 'latest'})
        this.createdOrders.watch(function (error, result) {
            // This will catch all createdOrder events, regardless of how they originated.
            if (error === null) {
                console.log('LogOrderCreated event:')
                console.log(result.args)
                self.orderContract.at(result.args.orderAddress).then(function (order_instance) {
                    console.log("Got contract at " + result.args.orderAddress + ":")
                    console.log(order_instance)
                    self.setState({
                        // use concat to create a new array extended with the new order
                        outgoingOrders: self.state.outgoingOrders.concat([order_instance])
                    })
                })
            } else {
                console.log('Error while watching events:')
                console.log(error)
            }
        })
    }

    componentWillUnmount() {
        // Stop watching for new contracts
        this.createdOrders.stopWatching()
    }

    render() {
        console.log("Rendering OutgoingOrderListContainer!")
        return <OutgoingOrderList
            outgoingOrders={this.state.outgoingOrders}
        />
    }
}

export default OutgoingOrderListContainer<commit_msg>Introduce StandingOrderListContainer<commit_after>import React, {Component} from 'react';
import {Table} from 'react-bootstrap';
import OutgoingOrderList from './OutgoingOrderList'

class OutgoingOrderListContainer extends Component {

    constructor(props){
        console.log("OutgoingOrderListContainer props: ")
        console.log(props)
        super(props)
        this.state = {
            outgoingOrders: [],
            account: props.account
        }
    }

    componentDidMount() {
        console.log("OutgoingOrderList DidMount")
        return

        var self = this

        // Get all existing contracts
        var allEvents = this.props.factoryInstance.allEvents({fromBlock: 0, toBlock: 'latest'})
        allEvents.get(function (error, logs) {
            if (error === null) {
                console.log("Got " + logs.length + " Past events")
                var entry
                for (entry of logs) {
                    console.log(entry)
                    self.orderContract.at(entry.args.orderAddress).then(function (order_instance) {
                        console.log("Adding order:")
                        console.log(order_instance)
                        self.setState({
                            // use concat to create a new array extended with the new order
                            outgoingOrders: self.state.outgoingOrders.concat([order_instance])
                        })
                    })
                }
            }
            else {
                console.log("Error while fetching past events:")
                console.log(error)
            }
        })

        // Start watching for new contracts
        this.createdOrders = this.props.factoryInstance.LogOrderCreated({fromBlock: 'pending', toBlock: 'latest'})
        this.createdOrders.watch(function (error, result) {
            // This will catch all createdOrder events, regardless of how they originated.
            if (error === null) {
                console.log('LogOrderCreated event:')
                console.log(result.args)
                self.orderContract.at(result.args.orderAddress).then(function (order_instance) {
                    console.log("Got contract at " + result.args.orderAddress + ":")
                    console.log(order_instance)
                    self.setState({
                        // use concat to create a new array extended with the new order
                        outgoingOrders: self.state.outgoingOrders.concat([order_instance])
                    })
                })
            } else {
                console.log('Error while watching events:')
                console.log(error)
            }
        })
    }

    componentWillUnmount() {
        // Stop watching for new contracts
        this.createdOrders.stopWatching()
    }

    render() {
        console.log("Rendering OutgoingOrderListContainer!")
        console.log("Props: ")
        console.log(this.props)
        return <OutgoingOrderList
            outgoingOrders={this.state.outgoingOrders}
        />
    }
}

export default OutgoingOrderListContainer
{'fraction_non_alphanumeric': 0.09300813008130081, 'fraction_numerical': 0.0003252032520325203, 'mean_word_length': 1.6286324786324786, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '344413', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1447, 'n_words': 324}