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

Rename appCfAddress to appInstanceId #372

Merged
merged 1 commit into from
Dec 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/contracts/contracts/StateChannelTransaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ contract StateChannelTransaction is LibCondition {

/// @notice Execute a fund transfer for a state channel app in a finalized state
/// @param uninstallKey The key in the nonce registry
/// @param appCfAddress Counterfactual address of the app contract
/// @param appInstanceId AppInstanceId to be resolved
/// @param terms The pre-agreed upon terms of the funds transfer
function executeAppConditionalTransaction(
AppRegistry appRegistry,
NonceRegistry nonceRegistry,
bytes32 uninstallKey,
bytes32 appCfAddress,
bytes32 appInstanceId,
Transfer.Terms terms
)
public
Expand All @@ -36,11 +36,11 @@ contract StateChannelTransaction is LibCondition {
);

require(
appRegistry.isStateFinalized(appCfAddress),
appRegistry.isStateFinalized(appInstanceId),
"App is not finalized yet"
);

Transfer.Transaction memory txn = appRegistry.getResolution(appCfAddress);
Transfer.Transaction memory txn = appRegistry.getResolution(appInstanceId);

require(
Transfer.meetsTerms(txn, terms),
Expand Down
4 changes: 2 additions & 2 deletions packages/machine/test/unit/ethereum/install.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ describe("InstallCommitment", () => {
appRegistryAddress,
nonceRegistryAddress,
uninstallKey,
appCfAddress,
appInstanceId,
terms
] = calldata.args;
expect(appRegistryAddress).toBe(networkContext.AppRegistry);
expect(nonceRegistryAddress).toBe(networkContext.NonceRegistry);
expect(uninstallKey).toBe(app.uninstallKey);
expect(appCfAddress).toBe(appIdentityToHash(app.identity));
expect(appInstanceId).toBe(appIdentityToHash(app.identity));
expect(terms[0]).toBe(app.terms.assetType);
expect(terms[1]).toEqual(app.terms.limit);
expect(terms[2]).toBe(app.terms.token);
Expand Down
4 changes: 2 additions & 2 deletions packages/machine/test/unit/ethereum/setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ describe("SetupCommitment", () => {
appRegistry,
nonceRegistry,
uninstallKey,
appCfAddress, // FIXME: Rename this field on the contract
appInstanceId,
[assetType, limit, token]
] = desc.args;
expect(appRegistry).toBe(networkContext.AppRegistry);
expect(nonceRegistry).toEqual(networkContext.NonceRegistry);
expect(uninstallKey).toBe(freeBalanceETH.uninstallKey);
expect(appCfAddress).toBe(appIdentityToHash(freeBalanceETH.identity));
expect(appInstanceId).toBe(appIdentityToHash(freeBalanceETH.identity));
expect(assetType).toBe(freeBalanceETH.terms.assetType);
expect(limit).toEqual(freeBalanceETH.terms.limit);
expect(token).toBe(freeBalanceETH.terms.token);
Expand Down