Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TokenContract to not use depricated methods #1776

Closed
wants to merge 6 commits into from
6 changes: 3 additions & 3 deletions src/lib/mina/token/token-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@ abstract class TokenContract extends SmartContract {
// coerce the inputs to AccountUpdate and pass to `approveBase()`
let tokenId = this.deriveTokenId();
if (from instanceof PublicKey) {
from = AccountUpdate.defaultAccountUpdate(from, tokenId);
from = AccountUpdate.default(from, tokenId);
from.requireSignature();
from.label = `${this.constructor.name}.transfer() (from)`;
}
if (to instanceof PublicKey) {
to = AccountUpdate.defaultAccountUpdate(to, tokenId);
to = AccountUpdate.default(to, tokenId);
to.label = `${this.constructor.name}.transfer() (to)`;
}

from.balanceChange = Int64.from(amount).neg();
from.balanceChange = Int64.from(amount).negV2();
to.balanceChange = Int64.from(amount);

let forest = toForest([from, to]);
Expand Down
Loading