From 7e4429b342b0c5bae39e3957b841adb60768bea0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 20 Dec 2017 09:41:52 -0500 Subject: [PATCH] add onDeploy to test_app for testing purposes --- test_app/app/contracts/test.sol | 5 +++++ test_app/config/contracts.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/test_app/app/contracts/test.sol b/test_app/app/contracts/test.sol index 3d347f3f..a463f5f1 100644 --- a/test_app/app/contracts/test.sol +++ b/test_app/app/contracts/test.sol @@ -9,9 +9,14 @@ library ZAMyLib { } contract Test { + address public addr; function testAdd() public pure returns (uint _result) { return ZAMyLib.add(1, 2); } + function changeAddress(address _addr) public { + addr = _addr; + } + } diff --git a/test_app/config/contracts.json b/test_app/config/contracts.json index 7eabfe1a..a8a3541d 100644 --- a/test_app/config/contracts.json +++ b/test_app/config/contracts.json @@ -34,6 +34,11 @@ "deploy": false, "args": [1000] }, + "Test": { + "onDeploy": [ + "Test.changeAddress(web3.eth.accounts[0])" + ] + }, "MyToken": { "instanceOf": "Token" },