2018-01-15 09:51:45 -05:00
|
|
|
|
2018-01-05 15:10:47 -05:00
|
|
|
contract("SimpleStorage", function() {
|
2018-01-15 09:51:45 -05:00
|
|
|
|
2018-01-05 15:10:47 -05:00
|
|
|
this.timeout(0);
|
2017-02-09 19:38:02 -05:00
|
|
|
before(function(done) {
|
2017-03-11 21:49:12 -05:00
|
|
|
this.timeout(0);
|
2018-01-15 09:51:45 -05:00
|
|
|
|
2018-01-17 11:39:48 -05:00
|
|
|
//config({
|
|
|
|
// node: "http://localhost:8545"
|
|
|
|
//});
|
2018-01-15 09:51:45 -05:00
|
|
|
|
2017-02-09 19:38:02 -05:00
|
|
|
var contractsConfig = {
|
|
|
|
"SimpleStorage": {
|
|
|
|
args: [100]
|
|
|
|
}
|
|
|
|
};
|
2017-12-22 13:07:43 -05:00
|
|
|
EmbarkSpec.deployAll(contractsConfig, () => { done() });
|
2017-02-09 19:38:02 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should set constructor value", function(done) {
|
2018-01-05 15:10:47 -05:00
|
|
|
SimpleStorage.methods.storedData().call().then(function(result) {
|
|
|
|
assert.equal(result, 100);
|
2017-02-09 19:38:02 -05:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it("set storage value", function(done) {
|
2018-01-12 18:08:44 -05:00
|
|
|
SimpleStorage.methods.set(150).send().then(function() {
|
2018-01-05 15:10:47 -05:00
|
|
|
SimpleStorage.methods.get().call().then(function(result) {
|
2018-01-13 11:38:10 -05:00
|
|
|
assert.equal(result, 499650);
|
2017-02-09 19:38:02 -05:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|