From aa7bfd8228123863a5d45ecc5aa9c72a9f92b08e Mon Sep 17 00:00:00 2001 From: coin-monster Date: Thu, 3 Aug 2017 13:23:14 -0700 Subject: [PATCH] rename and reorganize ERC223 examples move token/examples/* into mocks/* --- .../Token223.sol} | 6 +++--- .../Token223Receiver.sol} | 4 ++-- ...okenReceiverMock.sol => Token223ReceiverMock.sol} | 2 +- test/Standard223TokenReceiverTest.sol | 12 ++++++------ test/Standard223Token_spec.js | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) rename contracts/{token/examples/Standard223TokenExample.sol => mocks/Token223.sol} (67%) rename contracts/{token/examples/Standard223TokenReceiverExample.sol => mocks/Token223Receiver.sol} (71%) rename contracts/mocks/{Standard223TokenReceiverMock.sol => Token223ReceiverMock.sol} (87%) diff --git a/contracts/token/examples/Standard223TokenExample.sol b/contracts/mocks/Token223.sol similarity index 67% rename from contracts/token/examples/Standard223TokenExample.sol rename to contracts/mocks/Token223.sol index 0e0b309..26204b1 100644 --- a/contracts/token/examples/Standard223TokenExample.sol +++ b/contracts/mocks/Token223.sol @@ -1,16 +1,16 @@ pragma solidity ^0.4.11; -import "../Standard223Token.sol"; +import "../token/Standard223Token.sol"; -contract Standard223TokenExample is Standard223Token { +contract Token223 is Standard223Token { string public constant name = "Example ERC223 Token"; string public constant symbol = "ERC223"; uint8 public constant decimals = 18; uint256 public totalSupply; - function Standard223TokenExample(uint _initialBalance) + function Token223(uint _initialBalance) { balances[msg.sender] = _initialBalance; totalSupply = _initialBalance; diff --git a/contracts/token/examples/Standard223TokenReceiverExample.sol b/contracts/mocks/Token223Receiver.sol similarity index 71% rename from contracts/token/examples/Standard223TokenReceiverExample.sol rename to contracts/mocks/Token223Receiver.sol index 43ff7c2..b042887 100644 --- a/contracts/token/examples/Standard223TokenReceiverExample.sol +++ b/contracts/mocks/Token223Receiver.sol @@ -1,10 +1,10 @@ pragma solidity ^0.4.11; -import "../Standard223Receiver.sol"; +import "../token/Standard223Receiver.sol"; -contract Standard223TokenReceiverExample is Standard223Receiver { +contract Token223Receiver is Standard223Receiver { event LogFallbackParameters(address from, uint value, bytes data); function tokenFallback(address from, uint value, bytes data) diff --git a/contracts/mocks/Standard223TokenReceiverMock.sol b/contracts/mocks/Token223ReceiverMock.sol similarity index 87% rename from contracts/mocks/Standard223TokenReceiverMock.sol rename to contracts/mocks/Token223ReceiverMock.sol index a8d14c8..cff4054 100644 --- a/contracts/mocks/Standard223TokenReceiverMock.sol +++ b/contracts/mocks/Token223ReceiverMock.sol @@ -4,7 +4,7 @@ pragma solidity ^0.4.8; import "../token/Standard223Receiver.sol"; -contract Standard223TokenReceiverMock is Standard223Receiver { +contract Token223ReceiverMock is Standard223Receiver { address public tokenSender; uint public sentValue; bytes public tokenData; diff --git a/test/Standard223TokenReceiverTest.sol b/test/Standard223TokenReceiverTest.sol index 3a268bc..de7da58 100644 --- a/test/Standard223TokenReceiverTest.sol +++ b/test/Standard223TokenReceiverTest.sol @@ -1,16 +1,16 @@ pragma solidity ^0.4.8; import "truffle/Assert.sol"; -import "../contracts/token/examples/Standard223TokenExample.sol"; -import "../contracts/mocks/Standard223TokenReceiverMock.sol"; +import "../contracts/mocks/Token223.sol"; +import "../contracts/mocks/Token223ReceiverMock.sol"; contract Standard223TokenReceiverTest { - Standard223TokenExample token; - Standard223TokenReceiverMock receiver; + Token223 token; + Token223ReceiverMock receiver; function beforeEach() { - token = new Standard223TokenExample(100); - receiver = new Standard223TokenReceiverMock(); + token = new Token223(100); + receiver = new Token223ReceiverMock(); } function testFallbackIsCalledOnTransfer() { diff --git a/test/Standard223Token_spec.js b/test/Standard223Token_spec.js index 96d7a53..0a99fb8 100644 --- a/test/Standard223Token_spec.js +++ b/test/Standard223Token_spec.js @@ -1,14 +1,14 @@ require('./support/helpers.js') contract('Standard223Token', (accounts) => { - let Standard223TokenExample = artifacts.require("../contracts/token/examples/Standard223TokenExample.sol"); - let Standard223TokenReceiver = artifacts.require("../contracts/mocks/Standard223TokenReceiverMock.sol"); + let Token223 = artifacts.require("../contracts/mocks/Token223.sol"); + let Token223ReceiverMock = artifacts.require("../contracts/mocks/Token223ReceiverMock.sol"); let receiver, token; beforeEach(async function() { - receiver = await Standard223TokenReceiver.new(); - token = await Standard223TokenExample.new(1000); + receiver = await Token223ReceiverMock.new(); + token = await Token223.new(1000); assert.equal(await receiver.sentValue(), 0); });