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

Using either @allow.bareCreate() or @allow.bareCall() creates both create_ and call_ routes #206

Open
nullun opened this issue Oct 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@nullun
Copy link
Contributor

nullun commented Oct 31, 2023

There may be a valid reason for this, but I can't think of it. I would have expected the same behaviour as @allow.create() and @allow.call(), where it only creates the route for whichever one you use.

For example when I specify @allow.bareCall("OptIn") it will add both create_OptIn and call_OptIn. Even though the create_OptIn immediately leads to an err, shouldn't it use NOT_IMPLEMENTED instead?

import { Contract } from '@algorandfoundation/tealscript';

class Demo extends Contract {
    createApplication(): void {
    }

    @allow.bareCall"OptIn")
    my_method(): void {}
}
switch create_NoOp create_OptIn NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_OptIn

...

create_OptIn:
	err

call_OptIn:
	txn NumAppArgs
	bz abi_route_my_method
	err
@joe-p joe-p added this to the Stable Release milestone Oct 31, 2023
@joe-p joe-p added the bug Something isn't working label Oct 31, 2023
@joe-p joe-p removed this from the Stable Release milestone Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: TODO
Development

No branches or pull requests

2 participants