Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Bug Fixes & Added Features

Compare
Choose a tag to compare
@tcoulter tcoulter released this 25 Sep 21:24
· 16046 commits to master since this release

This version includes a few bug fixes and added functionality that makes working with contracts easier.

New Feature

Truffle contract classes now have an extend() function so you can use them more like ORM-style objects:

// Assume we have a contract called Persona.
Persona.extend({
  addAvatar: function(image) {
    // This method exists within a Persona contract class, so it already
    // has a reference to its own address at this.address. This method 
    // can then be used to seamlessly add the persona’s avatar to IPFS 
    // without interacting with functions external to the Persona object.

    // ... implementation ...
  }
});

// After calling .extend(), new instances of the Persona class will
// have the .addAvatar() function available.

var persona = Persona.at(“0x12345abcde...);
persona.addAvatar(someImage);  // calls out to ipfs, saves hash on the blockchain

Read more about this feature on the ether-pudding wiki.

Bug Fixes

  1. Via an ether-pudding update: contract event functions are no longer promisified, meaning you can use contract events from Truffle contract classes.
  2. Fixed #37: Contract paths stored in environments' contract.json file are now relative, meaning that you can more easily work others when contracts have already been deployed.