Skip to content

Improve input None as contract argument #579

@AlexD10S

Description

@AlexD10S

Currently for a smart contract that has an Option parameter, is not intuitive how to add None.
Example:

 #[ink(storage)]
    pub struct TestContract {
        name: String,
        otherContract: Option<H160>,
    }

    impl TestContract {
        #[ink(constructor)]
        pub fn new(name: String,  otherContract: Option<H160>) -> Self {
            Self { name, otherContract }
        }

The None value has to be indicated with "" e.g: pop up --args \"name\" "" . This is because cargo-contract library is implemented that way, to improve the DevEx why not let the user use None and convert it under the hood to "".

Also the experience to input a String has to be improved too, to don't use \"name\": #408

Metadata

Metadata

Assignees

Labels

DevExChange to improve the Developer Experiencegood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions