Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #282 from Loopring/bugfix-180409
Browse files Browse the repository at this point in the history
Bugfix 180409
  • Loading branch information
kongliangzhong committed Apr 9, 2018
2 parents 22cfc24 + 32c854f commit b713fd8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/NameRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ contract NameRegistry {
bytes12 nameBytes = stringToBytes12(name);
require(nameInfo.name == nameBytes);

for (uint i = participantIds.length - 1; i >= 0; i--) {
for (uint i = 0; i < participantIds.length; i++) {
delete participantMap[participantIds[i]];
}

Expand Down
10 changes: 10 additions & 0 deletions doc/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,14 @@
0x763186eB8d4856D536eD4478302971214FEbc6A9 18 BETR Better Betting
0x35a69642857083BA2F30bfaB735dacC7F0bac969 18 BBN BBNToken
0x45245bc59219eeaAF6cD3f382e078A461FF9De7B 18 BKX BANKEX
// add at 2018-04-08
0x4CEdA7906a5Ed2179785Cd3A40A69ee8bc99C466 8 AION AION
0xFA1a856Cfa3409CFa145Fa4e20Eb270dF3EB21ab 18 IOST IOSToken
0x01fF50f8b7f74E4f00580d9596cd3D0d6d6E326f 18 BFT BF Token
0x39Bb259F66E1C59d5ABEF88375979b4D20D98022 8 WAX Wax Token
0x8eB24319393716668D768dCEC29356ae9CfFe285 8 AGI SingularityNET Token
0x41dBECc1cdC5517C6f76f6a6E836aDbEe2754DE3 18 MTN MedToken
0xbf52F2ab39e26E0951d2a02b49B7702aBe30406a 18 ODEM ODEM Token
0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359 18 DAI Dai Stablecoin v1.0
```
9 changes: 9 additions & 0 deletions test/testNameRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contract("NameRegistry", (accounts: string[]) => {

const nameRegistried = await nameRegistry.nameMap(user);
assert.equal(name, nameRegistried);

});

it("is able to register a different name", async () => {
Expand Down Expand Up @@ -51,6 +52,14 @@ contract("NameRegistry", (accounts: string[]) => {
assert.equal(pid1 + 1, pid2, "pid not increased correctly.");
});

it("is able to add a participant pair after name had been registeried", async () => {
const name = "test002";
const tx = await nameRegistry.unregisterName(name, {from: user});
const ownerName = await nameRegistry.getOwner(name);
// console.log("ownerName:", ownerName);
assert.equal("0x0000000000000000000000000000000000000000", ownerName);
});

});

});

0 comments on commit b713fd8

Please sign in to comment.