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