Skip to content

Commit

Permalink
update function names
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Zinsmeister committed Nov 5, 2018
1 parent 94fb23c commit dd2f6c0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
24 changes: 13 additions & 11 deletions contracts/IdentityRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ contract IdentityRegistry is SignatureVerifier {
/// @param r The r component of the signatures.
/// @param s The s component of the signatures.
/// @param timestamp The timestamp of the signatures.
function addAddressDelegated(
function addAssociatedAddressDelegated(
address approvingAddress, address addressToAdd, uint8[2] v, bytes32[2] r, bytes32[2] s, uint[2] timestamp
)
public _hasIdentity(addressToAdd, false)
Expand Down Expand Up @@ -299,7 +299,7 @@ contract IdentityRegistry is SignatureVerifier {
identityDirectory[ein].associatedAddresses.insert(addressToAdd);
associatedAddressDirectory[addressToAdd] = ein;

emit AddressAdded(msg.sender, ein, approvingAddress, addressToAdd);
emit AssociatedAddressAdded(msg.sender, ein, approvingAddress, addressToAdd);
}

/// @notice Allows providers to remove an associated address from an Identity.
Expand All @@ -308,7 +308,7 @@ contract IdentityRegistry is SignatureVerifier {
/// @param r The r component of the signature.
/// @param s The s component of the signature.
/// @param timestamp The timestamp of the signature.
function removeAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp)
function removeAssociatedAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp)
public ensureSignatureTimeValid(timestamp)
{
uint ein = getEIN(addressToRemove);
Expand All @@ -333,7 +333,7 @@ contract IdentityRegistry is SignatureVerifier {
identityDirectory[ein].associatedAddresses.remove(addressToRemove);
delete associatedAddressDirectory[addressToRemove];

emit AddressRemoved(msg.sender, ein, addressToRemove);
emit AssociatedAddressRemoved(msg.sender, ein, addressToRemove);
}

/// @notice Allows an associated address to add providers to its Identity.
Expand Down Expand Up @@ -520,17 +520,19 @@ contract IdentityRegistry is SignatureVerifier {
address indexed initiator, uint indexed ein,
address recoveryAddress, address associatedAddress, address provider, address[] resolvers, bool delegated
);
event AddressAdded (address indexed initiator, uint indexed ein, address approvingAddress, address addedAddress);
event AddressRemoved (address indexed initiator, uint indexed ein, address removedAddress);
event ProviderAdded (address indexed initiator, uint indexed ein, address provider, bool delegated);
event ProviderRemoved (address indexed initiator, uint indexed ein, address provider, bool delegated);
event ResolverAdded (address indexed initiator, uint indexed ein, address resolvers);
event ResolverRemoved (address indexed initiator, uint indexed ein, address resolvers);
event AssociatedAddressAdded(
address indexed initiator, uint indexed ein, address approvingAddress, address addedAddress
);
event AssociatedAddressRemoved(address indexed initiator, uint indexed ein, address removedAddress);
event ProviderAdded(address indexed initiator, uint indexed ein, address provider, bool delegated);
event ProviderRemoved(address indexed initiator, uint indexed ein, address provider, bool delegated);
event ResolverAdded(address indexed initiator, uint indexed ein, address resolvers);
event ResolverRemoved(address indexed initiator, uint indexed ein, address resolvers);
event RecoveryAddressChangeTriggered(
address indexed initiator, uint indexed ein, address oldRecoveryAddress, address newRecoveryAddress
);
event RecoveryTriggered(
address indexed initiator, uint indexed ein, address[] oldAssociatedAddresses, address newAssociatedAddress
);
event IdentityPoisoned (address indexed initiator, uint indexed ein, address recoveryAddress, bool resolversReset);
event IdentityPoisoned(address indexed initiator, uint indexed ein, address recoveryAddress, bool resolversReset);
}
12 changes: 6 additions & 6 deletions contracts/samples/Provider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ interface IdentityRegistryInterface {
address recoveryAddress, address associatedAddress, address[] resolvers,
uint8 v, bytes32 r, bytes32 s, uint timestamp
) external returns (uint ein);
function addAddressDelegated(
function addAssociatedAddressDelegated(
address approvingAddress, address addressToAdd, uint8[2] v, bytes32[2] r, bytes32[2] s, uint[2] timestamp
) external;
function removeAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp) external;
function removeAssociatedAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp) external;
function addProvidersFor (uint ein, address[] providers) external;
function removeProvidersFor(uint ein, address[] providers) external;
function addResolversFor (uint ein, address[] resolvers) external;
Expand All @@ -35,16 +35,16 @@ contract Provider {
);
}

function addAddressDelegated(
function addAssociatedAddressDelegated(
address approvingAddress, address addressToAdd, uint8[2] v, bytes32[2] r, bytes32[2] s, uint[2] timestamp
)
public
{
identityRegistry.addAddressDelegated(approvingAddress, addressToAdd, v, r, s, timestamp);
identityRegistry.addAssociatedAddressDelegated(approvingAddress, addressToAdd, v, r, s, timestamp);
}

function removeAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp) public {
identityRegistry.removeAddressDelegated(addressToRemove, v, r, s, timestamp);
function removeAssociatedAddressDelegated(address addressToRemove, uint8 v, bytes32 r, bytes32 s, uint timestamp) public {
identityRegistry.removeAssociatedAddressDelegated(addressToRemove, v, r, s, timestamp);
}

function addProvidersFor(address[] providers) public {
Expand Down
20 changes: 10 additions & 10 deletions test/IdentityRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ contract('Testing Identity', function (accounts) {
)
const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, address.address,
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -266,7 +266,7 @@ contract('Testing Identity', function (accounts) {
)
const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, address.address,
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -305,7 +305,7 @@ contract('Testing Identity', function (accounts) {
)
const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, address.address,
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -343,7 +343,7 @@ contract('Testing Identity', function (accounts) {
const permission = await getSignature(permissionString, i)

if (i !== maxAddresses - 1) {
await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, getAddress(i),
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand All @@ -352,7 +352,7 @@ contract('Testing Identity', function (accounts) {
{ from: identity.providers[0].address }
)
} else {
await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, getAddress(i),
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -402,7 +402,7 @@ contract('Testing Identity', function (accounts) {

const permission = await getSignature(permissionString, i)

await instances.IdentityRegistry.removeAddressDelegated(
await instances.IdentityRegistry.removeAssociatedAddressDelegated(
getAddress(i), permission.v, permission.r, permission.s, timestamp,
{ from: identity.providers[0].address }
)
Expand All @@ -429,7 +429,7 @@ contract('Testing Identity', function (accounts) {
)
const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.addAddressDelegated(
await instances.IdentityRegistry.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, address.address,
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -470,7 +470,7 @@ contract('Testing Identity', function (accounts) {

const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.removeAddressDelegated(
await instances.IdentityRegistry.removeAssociatedAddressDelegated(
address.address, permission.v, permission.r, permission.s, timestamp,
{ from: accountsPrivate[8].address }
)
Expand All @@ -493,7 +493,7 @@ contract('Testing Identity', function (accounts) {

const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.removeAddressDelegated(
await instances.IdentityRegistry.removeAssociatedAddressDelegated(
address.address, permission.v, permission.r, permission.s, timestamp,
{ from: identity.providers[0].address }
)
Expand All @@ -516,7 +516,7 @@ contract('Testing Identity', function (accounts) {

const permission = await sign(permissionString, address.address, address.private)

await instances.IdentityRegistry.removeAddressDelegated(
await instances.IdentityRegistry.removeAssociatedAddressDelegated(
address.address, permission.v, permission.r, permission.s, timestamp,
{ from: identity.providers[0].address }
)
Expand Down
4 changes: 2 additions & 2 deletions test/samples/ProviderResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ contract('Testing Sample Provider and Resolver', function (accounts) {
)
const permission = await sign(permissionString, address.address, address.private)

await instances.Provider.addAddressDelegated(
await instances.Provider.addAssociatedAddressDelegated(
identity.associatedAddresses[0].address, address.address,
[permissionApproving.v, permission.v],
[permissionApproving.r, permission.r],
Expand Down Expand Up @@ -123,7 +123,7 @@ contract('Testing Sample Provider and Resolver', function (accounts) {

const permission = await sign(permissionString, address.address, address.private)

await instances.Provider.removeAddressDelegated(
await instances.Provider.removeAssociatedAddressDelegated(
address.address, permission.v, permission.r, permission.s, timestamp
)

Expand Down

0 comments on commit dd2f6c0

Please sign in to comment.