Alberta has passed legislation giving the province's energy minister the power to choke off gasoline shipments to British Columbia if that province continues to throw up barriers to the Trans Mountain pipeline expansion.

Bill 12 passed late Wednesday afternoon in the Alberta Legislature. David Swann, the Liberal for Calgary-Mountain View, was the only member of the legislature to vote against it.

Earlier Wednesday, Alberta Premier Rachel Notley used her strongest language yet about her intentions for the law, stating she was prepared to use it on short notice, if required.

"Albertans, British Columbians and all Canadians should understand that if the path forward for the pipeline through B.C. is not settled soon, I am ready and prepared to turn off the taps," she said.

Vancouver drivers are currently paying about $1.57 per litre for gasoline, and blocking shipments could push prices even higher, putting political pressure on B.C. Premier John Horgan.

Asked when she planned to take action, Notley declined to reveal details.

"With the greatest of respect, I'm not going to spell out the exact schedule and the exact steps," she said.

B.C. to mount legal challenge

In response, B.C. Attorney General David Eby sent a letter to Alberta Justice Minister Kathleen Ganley Wednesday urging the government to hold off proclaiming Bill 12 until a judge can determine its constitutionality.

"In the absence of such a commitment, I intend to instruct counsel to bring an action challenging its constitutional validity in the courts of Alberta," Eby wrote.

Notley also responded to an announcement Wednesday morning by federal Finance Minister Bill Morneau that Ottawa is willing to compensate backers of the Trans Mountain pipeline project for any financial losses due to political obstruction.

Morneau said Canada is willing to write Kinder Morgan — or whoever steps up to the plate — a cheque to ensure the Trans Mountain pipeline expansion gets built.

Notley ready to 'do whatever is necessary'

Notley said she remains confident construction will resume this summer. She said she speaks to Morneau every day, and Alberta officials are involved in the talks with Kinder Morgan.

The premier suggested different scenarios are at play.

"If framework one doesn't work, there may well be a framework two," she said.

Asked if her government is still willing to purchase the project, Notley said she will "do whatever is necessary" to get construction underway this summer.

Morneau's comments ​came just hours before Kinder Morgan Canada's stakeholders met in Calgary. The incentive offer comes two weeks before the company's potential drop-dead date.

Kinder Morgan has threatened to abandon the project if a clear path forward isn't reached by May 31.

Morneau consulted with senior officials in the Alberta government and Kinder Morgan CEO Steve Kean Tuesday night.

Last month, Kinder Morgan stopped all non-essential spending on its $7.4-billion project after a months-long standoff between the British Columbia and Alberta governments.

B.C. has been working to block the pipeline for environmental reasons over Alberta's objections.

The expansion would add a second pipeline along Kinder Morgan's existing pipeline route to carry diluted bitumen from Alberta to the B.C. coast for export on tankers.