Costa Rica accuses Nicaragua of violating international law by putting troops on Costa Rican territory for a dredging project to build a canal .