Skip to content

Instantly share code, notes, and snippets.

@reime005
Created December 27, 2020 21:13
Show Gist options
  • Save reime005/37eafb234e1477c94f7672b80fd56c75 to your computer and use it in GitHub Desktop.
Save reime005/37eafb234e1477c94f7672b80fd56c75 to your computer and use it in GitHub Desktop.
it('should allow changing the accounts personal names', async function() {
const instance = await NameStorageExample.deployed();
// change the name related to the sender's address
const tx1 = await instance.changeAddressName("rick", {from: accounts[0]});
const tx2 = await instance.changeAddressName("morty", {from: accounts[1]});
// check if the name related to the address has been changed
const personalNameAccount0 = await instance.addressNames(accounts[0])
const personalNameAccount1 = await instance.addressNames(accounts[1])
assert.strictEqual("rick", personalNameAccount0,
"personal name did not change");
assert.strictEqual("morty", personalNameAccount1,
"personal name did not change");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment