func (e *TradingEngine) ExecuteOrder(t *Trade) error {
	fmt.Printf("Now in the trading engine trying to trade: %v", t)

	tokenPair, ok := e.pairs[t.PairID]
	if !ok {
		return errors.New("Token Pair does not exist")
	}

	ob, ok := e.orderbooks[tokenPair]
	if !ok {
		return errors.New("Orderbook does not exist")
	}

	o, ok := ob.orderIndex[t.OrderHash]
	if !ok {
		return errors.New("Order does not exist")
	}

	_, err := e.operator.ExecuteTrade(o, t)
	if err != nil {
		return err
	}

	return nil
}
// Execute Order adds the order to the blockchain transaction execution queue
Execute Order adds the order to the blockchain transaction execution queue
// Execute Order adds the order to the blockchain transaction execution queue
func (e *TradingEngine) ExecuteOrder(t *Trade) error {
	fmt.Printf("Now in the trading engine trying to trade: %v", t)
	tokenPair, ok := e.pairs[t.PairID]
	if !ok {
		return errors.New("Token Pair does not exist")
	}
	ob, ok := e.orderbooks[tokenPair]
	if !ok {
		return errors.New("Orderbook does not exist")
	}
	o, ok := ob.orderIndex[t.OrderHash]
	if !ok {
		return errors.New("Order does not exist")
	}
	_, err := e.operator.ExecuteTrade(o, t)
	if err != nil {
		return err
	}
	return nil
}
func ( e * TradingEngine ) ExecuteOrder ( t * Trade ) error { fmt . Printf ( " " , t ) tokenPair , ok := e . pairs [ t . PairID ] if ! ok { return errors . New ( " " ) } ob , ok := e . orderbooks [ tokenPair ] if ! ok { return errors . New ( " " ) } o , ok := ob . orderIndex [ t . OrderHash ] if ! ok { return errors . New ( " " ) } _ , err := e . operator . ExecuteTrade ( o , t ) if err != nil { return err } return nil }
Execute Order adds the order to the blockchain transaction execution queue
Execute Order adds the order to the blockchain transaction execution queue