mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-21 11:38:15 +00:00
use secureSend for SimpleStorage set as it can cause hangs on WS
This commit is contained in:
parent
13e0d453ae
commit
f45c7bc256
@ -1,6 +1,7 @@
|
|||||||
/*global contract, config, it, assert, web3*/
|
/*global contract, config, it, assert, web3*/
|
||||||
const SimpleStorage = require('Embark/contracts/SimpleStorage');
|
const SimpleStorage = require('Embark/contracts/SimpleStorage');
|
||||||
let accounts;
|
let accounts;
|
||||||
|
const Utils = require('embarkjs').Utils;
|
||||||
|
|
||||||
config({
|
config({
|
||||||
contracts: {
|
contracts: {
|
||||||
@ -21,10 +22,16 @@ contract("SimpleStorage", function () {
|
|||||||
assert.strictEqual(parseInt(result, 10), 100);
|
assert.strictEqual(parseInt(result, 10), 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("set storage value", async function () {
|
it("set storage value", function (done) {
|
||||||
await SimpleStorage.methods.set(150).send();
|
// await SimpleStorage.methods.set(150).send();
|
||||||
|
Utils.secureSend(web3, SimpleStorage.methods.set(150), {}, false, async function(err) {
|
||||||
|
if (err) {
|
||||||
|
return done(err);
|
||||||
|
}
|
||||||
let result = await SimpleStorage.methods.get().call();
|
let result = await SimpleStorage.methods.get().call();
|
||||||
assert.strictEqual(parseInt(result, 10), 150);
|
assert.strictEqual(parseInt(result, 10), 150);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set defaultAccount", async function () {
|
it("should set defaultAccount", async function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user