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

init #1471

Closed
6 tasks done
Tracked by #1391
dansteren opened this issue Dec 5, 2023 · 0 comments · Fixed by #1492
Closed
6 tasks done
Tracked by #1391

init #1471

dansteren opened this issue Dec 5, 2023 · 0 comments · Fixed by #1492
Assignees

Comments

@dansteren
Copy link
Contributor

dansteren commented Dec 5, 2023

The generated canister will look something like this:

// Create variables for each init param 
let initParam0;
let initParam1;

export default Canister {
    init: ([bool, text], (param0) => {
        // check that they are the right order/length
        // store the params in the global variables 
        initParam0 = param0;
        initParam1 = param1;
    }),
    // create a method to retrieve the stored values
    getInitValues: query([], Tuple(bool,text), () => {
        return [initParam0, initParam1]
    })
}

The Tests should also run with 0-20 query and update methods.

You'll also need to figure out how to pass params to the deploy command.

Subtasks

  • Support an init method with 0 parameters
  • Support multiple params passed across the CLI to dfx deploy
    • Update CandidValueAndMeta, combining agentArgumentValue, agentResponseValue into a new values object
    • Add a CandidTypeObject to the new values object in CandidValueAndMeta
    • Collect the params and call valueToString and pass them to dfx deploy
    • Figure out what's wrong with float32s and get seeds -2020534984 and -210693065 to pass.
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