In this legal malpractice action, which was tried to the court, defendant appeals from a judgment for $213,961.93 plus costs. On cross-appeal, plaintiff1 assigns error to the denial of her motion to amend the amount of damages requested in the complaint to conform to her proof. We affirm on appeal and on cross-appeal.
Plaintiff is the widow of Sam Singer (Singer), founder and president of Portland Electric and Plumbing Company (Pepeo). In 1973, Singer and Pepeo entered into an agreement that required the corporation to purchase his stock after his death. Defendant, who was Pepco’s counsel, prepared the repurchase agreement. In 1976, Singer gave some of his stock to plaintiff, who then also signed the agreement, which provided that a selling stockholder could request that the purchase be secured by real property owned by Pepeo. After Singer died in 1977, defendant was counsel for his estate, and plaintiff was appointed personal representative. Pepeo paid plaintiff approximately $300,000 cash for her and her deceased husband’s stock and executed two notes for the $625,618 balance. Defendant had not advised plaintiff, or her husband before his death, that he had a conflict of interest in representing both them and Pepeo in his legal work on the stock sale agreement or advised them that the repurchase obligation could be secured by Pepco’s real property.
In 1977, Pepeo owned five parcels of real property. When it made the promissory notes that year, and when it filed for bankruptcy in January, 1985, the value of the parcels exceeded the prior mortgages on them. At the time of the bankruptcy, Pepeo still owed plaintiff approximately $187,000; it had paid plaintiff monthly, as the notes required, from 1977 until November, 1984. It was solvent until some time in 1984, and none of its payments to plaintiff rendered it insolvent. The Bankruptcy Court confirmed Pepco’s plan of reorganization in September, 1985. Under it, unsecured creditors (including plaintiff) were not paid in full.
Plaintiff brought this action after the bankruptcy filing. The trial court found that defendant was negligent, *438because he had failed to inform plaintiff of her right under the repurchase agreement to have security for the unpaid portion of the purchase price. At trial, defendant argued that, even if the notes had been secured, any payment on them was barred by the version of former ORS 57.0352 in effect when plaintiff and her husband executed the repurchase agreement and when Pepeo executed the notes. That version prohibited a corporation from purchasing or paying for its own stock when it was insolvent. The court held that the 1983 amended version of ORS 57.0353 would have applied and that, had plaintiff received security for Pepco’s debt, she would have been a secured creditor in the bankruptcy proceeding and would not have suffered damage.
Defendant argues that any payment on the notes would have been illegal after Pepeo became insolvent, whether or not there was any security for the debt, and that his negligence, therefore, did not cause any damage to plaintiff. He argues that the court erred as a matter of statutory construction by giving “retroactive effect” to the 1983 amendment, under which the payments would be legal, and that it also violated the obligation of the repurchase contract by doing so. Those arguments start at the wrong place. Because Pepeo *439filed a bankruptcy petition, the question is what plaintiff would have received in the bankruptcy if she had had mortgages on Pepco’s real property. Defendant’s arguments are relevant only to the extent that the Bankruptcy Court would have considered them in determining the validity and character of plaintiffs claim. We turn to that issue.
The trial court had to measure plaintiffs damages by what the Bankruptcy Court would have done. The controlling federal law in Oregon is that of the Ninth Circuit, and the decisive case is Matter of Poole, McGonigle & Dick, Inc., 796 F2d 318 (9th Cir 1986), which also arose under Oregon corporation law. In that case the debtor corporation had agreed to purchase the shares of Harper and Goldberg at a time when it was solvent and able to pay the full purchase price. It later became insolvent and, in March, 1982, filed a Chapter 11 petition, before it had paid the full amount that it owed Harper and Goldberg. The Bankruptcy Court held that, because further payments on the stock purchase agreements would be illegal under the pre-1983 version of ORS 57.035, Harper’s and Goldberg’s claims should be equitably subordinated to those of other unsecured creditors. On appeal from the Bankruptcy Court, the District Court held that those claims should be treated like other unsecured claims. On further appeal, the Court of Appeals reversed the District Court.
The Ninth Circuit first stated that it had previously held that equitable subordination of a claim for a balance due on a repurchase agreement is required if it was illegal under state law for the debtor to make further payments under the agreement. Matter of Poole, McGonigle & Dick, Inc., supra, 796 F2d at 322. The court then noted that the pre-1983 version of ORS 57.035 prohibited payment under a repurchase agreement at a time when a corporation was insolvent. Harper and Goldberg argued that the court should apply the 1983 amended version because, when payment would actually be made, that version would be in effect. The court rejected that argument, holding that the rights of creditors are fixed as of the filing of the bankruptcy petition, which occurred before the effective date of the 1983 amendment.
“[T]he date upon which to focus is the date on which payment is due. Any payments coming due after the debtor became insolvent should be subordinated * * *. However, if the debtor was in fact solvent when some or all of the payments to *440Harper and Goldberg were due, * * * to the extent of such payments, the debts to Harper and Goldberg should not be subordinated. Insolvency occurring subsequent to the debt’s due date may render the debtor unable to pay but it does not make the debt illegal within the meaning of the statute.” 796 F2d at 324. (Emphasis in original.)
We conclude that, in applying Oregon law in the bankruptcy proceeding, the federal courts would hold that the dates on which to focus in this case are the dates that the payments that Pepeo did not make became due, there being no Oregon appellate precedent to the contrary. On those dates, the amended version of ORS 57.035 was in effect. If that version controls the validity of those payments, had they been made, and if plaintiff had received mortgages to secure the payment of the notes, the Bankruptcy Court would have treated her as a secured creditor. The reorganization plan provided for full payment to other secured creditors, and the trial court could conclude that plaintiff would also have received full payment.
Defendant argues that the 1983 version of ORS 57.035 would not control, because for it to do so would require the court to apply the amendment “retroactively.” Defendant seems to assume that, although the 1977 repurchase agreement did not refer to ORS 57.035 directly or indirectly, it incorporated that statute. That is, defendant asks us to hold that a law that restricts Pepco’s ability to comply with its contract is part of the contract itself, so that the application of a change in the law would change the contract. That is quite wrong. The 1977 notes are unconditional obligations to pay according to their terms. Although, as the law stood in 1977, the notes would have become unenforceable if Pepeo had subsequently become insolvent, that was the result of the law, not of anything in the notes or in the underlying contract. The 1983 amendment made the agreement enforceable in circumstances in which it had previously been unenforceable. It did not change the nature, terms or conditions of Pepco’s obligation and only affected payments that became due after its effective date. It did not operate retroactively and, perforce, it did not impair the obligation of the contract. There was sufficient evidence of damage to support the trial court’s judgment.
On cross-appeal, plaintiff contends that the trial court erred in denying her motion to amend her complaint so *441that her prayer for damages would conform to the proof of her actual loss as a result of the bankruptcy.4 Before the conclusion of the bankruptcy proceeding, the trial court determined that defendant was liable in this case; it determined plaintiffs damages after the bankruptcy proceeding was over. It then entered judgment for plaintiff on her summary judgment motion on damages.
Plaintiff argues that, when she filed her complaint, she had calculated her damages according to the buy-back agreement. In the bankruptcy proceeding, the bankruptcy trustee asserted a claim for repayment of $63,340.90 as preferential transfers made during the corporation’s insolvency. As part of a settlement between the trustee and plaintiff, the trustee waived the demand for repayment but asserted a claim for 15% of plaintiffs recovery in this case. In return, the trustee agreed not to subordinate plaintiff to other unsecured creditors.
Whether a party may amend the pleadings to conform to the proof is within the court’s sound discretion. ORCP 23B; Cutsforth v. Kinzua Corp., 267 Or 423, 431, 517 P2d 640 (1973). The Bankruptcy Court did not decide the merits of the trustee’s demand for repayment; rather, plaintiff chose to compromise it. The trial court did not exceed its discretion in denying plaintiffs motion to amend the pleadings.
Affirmed on appeal and on cross-appeal.
She appears here in her individual capacity and as personal representative of the estate.
In 1977, when Pepeo issued its promissory note to plaintiff, ORS 57.035 provided in part:
“(1) A corporation shall have the right to purchase, take, receive or otherwise acquire, hold, own, pledge, transfer or otherwise dispose of its own shares, but purchase of its own shares, whether direct or indirect, shall be made only to the extent of unreserved and unrestricted earned surplus available therefor, and, if the articles of incorporation so permit, or with the affirmative vote of the holders of at least a majority of all shares entitled to vote thereon, to the extent of unreserved and unrestricted capital surplus available therefore.
"* * * * *
“(5) No purchase of or payment for its own shares shall be made at a time when the corporation is insolvent or when such purchase or payment would make it insolvent.” (Emphasis supplied.)
Oregon Laws 1983, chapter 611, section 2, amended ORS 57.035 to delete the references to “payment” in subsection (5) and to add subsection (6):
“For the purposes of subsections (1) and (5) of this section, the effect of a corporation’s purchase of its own shares shall be measured as of the date money or other property is transferred or debt is incurred by the corporation or as of the date the shareholder ceases to be a shareholder of the corporation with respect to such shares, whichever is earlier.” (Emphasis supplied.)
The 1987 legislature repealed the statute as part of its general revision of the corporation laws. Or Laws 1987, ch 52, § 181.
No separate motion appears in the record. It appears in plaintiffs motion for summary judgment; the court specifically denied it.