A controversial tax hike on discretionary trusts is poised to become law after Labor struck a deal with the Greens to push it through the Senate.