From e74b3a2693170eb149be8abf15863fd4450ca578 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 7 Feb 2018 19:39:11 -0500 Subject: [PATCH] update test_app --- test_app/app/contracts/simple_storage.sol | 9 +++++++++ test_app/app/js/index.js | 2 ++ test_app/config/contracts.json | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test_app/app/contracts/simple_storage.sol b/test_app/app/contracts/simple_storage.sol index dbec6e45..c72e8e98 100644 --- a/test_app/app/contracts/simple_storage.sol +++ b/test_app/app/contracts/simple_storage.sol @@ -2,6 +2,14 @@ pragma solidity ^0.4.17; import "ownable.sol"; +library Assert { + event TestEvent(bool passed, string message); + + function triggerEvent(bool passed, string message) internal { + TestEvent(passed, message); + } +} + contract SimpleStorage is Ownable { uint public storedData; @@ -16,6 +24,7 @@ contract SimpleStorage is Ownable { for(uint i = 0; i < 1000; i++) { storedData += i; } + Assert.triggerEvent(true, "hi"); } function set2(uint x, uint unusedGiveWarning) public onlyOwner { diff --git a/test_app/app/js/index.js b/test_app/app/js/index.js index 5633d7d1..8f6332c5 100644 --- a/test_app/app/js/index.js +++ b/test_app/app/js/index.js @@ -4,6 +4,7 @@ import React, { Component } from 'react'; import EmbarkJS from 'Embark/EmbarkJS'; import SimpleStorage from 'Embark/contracts/SimpleStorage'; import Test from 'Embark/contracts/Test'; +import Assert from 'Embark/contracts/Assert'; import ReactDOM from 'react-dom'; @@ -22,6 +23,7 @@ import { Navbar, Jumbotron, Button } from 'react-bootstrap'; window.EmbarkJS = EmbarkJS; window.SimpleStorage = SimpleStorage; window.Test = Test; +window.Assert = Assert; window.React = React; diff --git a/test_app/config/contracts.json b/test_app/config/contracts.json index f1e342e1..5dca2a91 100644 --- a/test_app/config/contracts.json +++ b/test_app/config/contracts.json @@ -11,6 +11,7 @@ }, "dappConnection": [ "$WEB3", + "ws://localhost:8546", "http://localhost:8550", "http://localhost:8545", "http://localhost:8550" @@ -21,7 +22,7 @@ "deploy": false }, "SimpleStorage": { - "fromIndex": 1, + "fromIndex": 0, "args": [ 100 ]