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 Deprecated Method Usage #1740

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/mina/token/token-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change, so this PR needs to target the v2 branch!

to.balanceChange = Int64.from(amount);

let forest = toForest([from, to]);
Expand All @@ -180,7 +180,7 @@ abstract class TokenContract extends SmartContract {
}

/** Version of `TokenContract` with the precise number of `MAX_ACCOUNT_UPDATES`
*
*
* The value of 20 in `TokenContract` was a rough upper limit, the precise upper
* bound is 9.
*/
Expand Down
Loading