Skip to content
New issue

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

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

Already on GitHub? # to your account

new_max error when building and starting site #23

Open
Shane-Neeley opened this issue May 23, 2022 · 1 comment
Open

new_max error when building and starting site #23

Shane-Neeley opened this issue May 23, 2022 · 1 comment

Comments

@Shane-Neeley
Copy link

Hi, any idea why I'm getting this. I deployed a contract from https://github.com/TENK-DAO/tenk to testnet, and then used it in the config/settings.json of this frontend code and built.

Screen Shot 2022-05-23 at 3 13 34 PM

@adamk72
Copy link

adamk72 commented May 24, 2022

It's happening on remaining_allowance. The front-end code doesn't have a new_max variable on it:

remaining_allowance(args: {
    account_id: AccountId,
  }, options?: ViewFunctionOptions): Promise<number | null> {
    return this.account.viewFunction(this.contractId, "remaining_allowance", args, options);
  }

link

Whereas the latest Tenk contract does:

pub fn remaining_allowance(&self, account_id: &AccountId, new_max: u16) -> Option<u16> {
    self.whitelist
        .get(account_id)
        .map(|a| a.raise_max(new_max).left())
}

link

Not sure what the solution is. but the error goes away if I put a faux value for new_max into the args.

I see in the Tenk GUI that new_max is also required when viewing an account's allowance, which I'm also not sure of; it seems to me that it should be a read-only view since it's under the "View Methods" section.
Screen Shot 2022-05-24 at 17 54 30

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants