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
|
|
|
});
|
|
|
|
|
2018-04-17 18:48:31 +00:00
|
|
|
it("should set constructor value", async function() {
|
|
|
|
let result = await SimpleStorage.methods.storedData().call();
|
|
|
|
assert.equal(result, 100);
|
2017-02-10 00:38:02 +00:00
|
|
|
});
|
|
|
|
|
2018-04-17 18:48:31 +00:00
|
|
|
it("set storage value", async function() {
|
|
|
|
await SimpleStorage.methods.set(150).send();
|
|
|
|
let result = await SimpleStorage.methods.get().call();
|
|
|
|
assert.equal(result, 499650);
|
2017-02-10 00:38:02 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|