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

Add getIDL method to Service class #1208

Closed
dansteren opened this issue Sep 7, 2023 · 1 comment · Fixed by #1247
Closed

Add getIDL method to Service class #1208

dansteren opened this issue Sep 7, 2023 · 1 comment · Fixed by #1247
Assignees

Comments

@dansteren
Copy link
Contributor

dansteren commented Sep 7, 2023

In order to use Services in params and return types we need to implement this function.

Once this is completed, update the service example and get it passing in CI/CD.

@dansteren dansteren self-assigned this Sep 11, 2023
@dansteren
Copy link
Contributor Author

dansteren commented Sep 12, 2023

Helpful notes:

All services will have an _azleCanisterMethods on them, that is what we look for from the Rust side in order to create their rust wrapper functions. We shouldn't use that. BUT, we should likely make a separate _azleCandidMap property that stores the IDLs. So, we could have the @query and @update methods add to that map and then pull from there in the getIDL implementation on Service.

class SomeService extends Service {
    @query([text], Opt(bool))
    query1: () => boolean;

    @update([], text)
    update1: () => string;

    _azleCanisterMethods: {
        queries: []
        updates: []
    }

    _azleCandidMap: {
        query1: {
            paramTypes: [text],
            returnType: Opt(bool)

        }
    }
}

@dansteren dansteren linked a pull request Sep 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant