Jump to content

Issue in crowdfunding contract tutorial


Recommended Posts

Posted (edited)

Hi,

I would usually post this on github but I couldn't find the repo for the docs/tutorials.

It looks like there is a minor issue with the tutorial which results in the tests not passing.

 

The init function should be annotated with the `#[init]` attribute macro

e.g.

```

#[elrond_wasm_derive::contract(CrowdfundingImpl)]
pub trait Crowdfunding {
    fn init(&self) {
    }
}

```

should be

 

```

#[elrond_wasm_derive::contract(CrowdfundingImpl)]
pub trait Crowdfunding {
    #[init]
    fn init(&self) {
    }
}

```

 

This is repeated throughout the tutorial. It was a tricky one to find as the scenario tests fail with very little feedback. Once this is fixed though it all works. Great tutorial!

Edited by Willem Olding
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...