Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/undo-env-or' into really-move-ni…
Browse files Browse the repository at this point in the history
…tro-protocol2
  • Loading branch information
geoknee committed Sep 7, 2023
2 parents 6237751 + 7680948 commit 6d5f4ac
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ const provider = getTestProvider();
const batchOperator = setupContract(
provider,
BatchOperatorArtifact,
process.env.BATCH_OPERATOR_ADDRESS || ''
process.env.BATCH_OPERATOR_ADDRESS
) as unknown as BatchOperator & Contract;

const nitroAdjudicator = setupContract(
provider,
NitroAdjudicatorArtifact,
process.env.NITRO_ADJUDICATOR_ADDRESS || ''
process.env.NITRO_ADJUDICATOR_ADDRESS
) as unknown as NitroAdjudicator & Contract;

const token = setupContract(
provider,
TokenArtifact,
process.env.TEST_TOKEN_ADDRESS || ''
process.env.TEST_TOKEN_ADDRESS
) as unknown as Token & Contract;

const badToken = setupContract(
provider,
BadTokenArtifact,
process.env.BAD_TOKEN_ADDRESS || ''
process.env.BAD_TOKEN_ADDRESS
) as unknown as BadToken & Contract;

const ETH = MAGIC_ADDRESS_INDICATING_ETH;
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('deposit_batch', () => {
getChannelId({
channelNonce: getRandomNonce(description),
participants: [signerAddress, counterparty],
appDefinition: consensusApp || '',
appDefinition: consensusApp,
challengeDuration: 100,
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function createTwoPartySignedCountingAppState(
}

beforeAll(async () => {
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS || '');
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS);
});

// Scenarios are synonymous with channelNonce:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const defaultOutcome: Outcome = [
let appDefinition: string;

beforeAll(async () => {
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS || '');
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS);
appDefinition = getCountingAppContractAddress();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const outcome: Outcome = [{asset, allocations: [], assetMetadata: {assetType: 0,
let appDefinition: string;

beforeAll(async () => {
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS || '');
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS);
appDefinition = getCountingAppContractAddress();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {getTestProvider, randomChannelId, setupContract} from '../../test-helper
const provider = getTestProvider();
let ForceMove: Contract;
beforeAll(async () => {
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS || '');
ForceMove = setupContract(provider, ForceMoveArtifact, process.env.TEST_FORCE_MOVE_ADDRESS);
});

const zeroData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ const provider = getTestProvider();
const testNitroAdjudicator = setupContract(
provider,
TESTNitroAdjudicatorArtifact,
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS || ''
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS
) as unknown as TESTNitroAdjudicator & Contract;

const token = setupContract(
provider,
TokenArtifact,
process.env.TEST_TOKEN_ADDRESS || ''
process.env.TEST_TOKEN_ADDRESS
) as unknown as Token & Contract;

const badToken = setupContract(
provider,
BadTokenArtifact,
process.env.BAD_TOKEN_ADDRESS || ''
process.env.BAD_TOKEN_ADDRESS
) as unknown as BadToken & Contract;

const signer0 = getTestProvider().getSigner(0); // Convention matches setupContract function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const testProvider = getTestProvider();
const testNitroAdjudicator = setupContract(
testProvider,
TESTNitroAdjudicatorArtifact,
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS || ''
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS
) as unknown as TESTNitroAdjudicator & Contract;

const addresses = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ import {
const testNitroAdjudicator = setupContract(
getTestProvider(),
TESTNitroAdjudicatorArtifact,
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS || ''
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS
) as unknown as TESTNitroAdjudicator & Contract;

const token = setupContract(
getTestProvider(),
TokenArtifact,
process.env.TEST_TOKEN_ADDRESS || ''
process.env.TEST_TOKEN_ADDRESS
) as unknown as Token & Contract;

const provider = getTestProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import {replaceAddressesAndBigNumberify} from '../../../src/helpers';
const testNitroAdjudicator = setupContract(
getTestProvider(),
TESTNitroAdjudicatorArtifact,
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS || ''
process.env.TEST_NITRO_ADJUDICATOR_ADDRESS
) as unknown as TESTNitroAdjudicator & Contract;

const token = setupContract(
getTestProvider(),
TokenArtifact,
process.env.TEST_TOKEN_ADDRESS || ''
process.env.TEST_TOKEN_ADDRESS
) as unknown as Token & Contract;

const addresses = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ const challengeDuration = 0x100;
const whoSignedWhat = [1, 0];

beforeAll(async () => {
hashTimeLock = setupContract(
provider,
HashLockedSwapArtifact,
process.env.HASH_LOCK_ADDRESS || ''
);
hashTimeLock = setupContract(provider, HashLockedSwapArtifact, process.env.HASH_LOCK_ADDRESS);
});

const preImage = '0xdeadbeef';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ beforeAll(async () => {
singleAssetPayments = setupContract(
provider,
SingleAssetPaymentsArtifact,
process.env.SINGLE_ASSET_PAYMENTS_ADDRESS || ''
process.env.SINGLE_ASSET_PAYMENTS_ADDRESS
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ beforeAll(async () => {
Consensus = setupContract(
provider,
testConsensusArtifact,
process.env.TEST_CONSENSUS_ADDRESS || ''
process.env.TEST_CONSENSUS_ADDRESS
) as Contract & TESTConsensus;
});

Expand Down Expand Up @@ -65,7 +65,7 @@ describe('requireConsensus', () => {
channelNonce,
challengeDuration,
outcome: defaultOutcome,
appDefinition: appDefinition || '',
appDefinition: appDefinition,
appData: '0x',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ beforeAll(async () => {
StrictTurnTaking = setupContract(
provider,
testStrictTurnTakingArtifact,
process.env.TEST_STRICT_TURN_TAKING_ADDRESS || ''
process.env.TEST_STRICT_TURN_TAKING_ADDRESS
) as Contract & TESTStrictTurnTaking;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/nitro-protocol/test/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function setupContract(
}

export function getCountingAppContractAddress(): string {
return process.env.COUNTING_APP_ADDRESS || '';
return process.env.COUNTING_APP_ADDRESS;
}

export const nonParticipant = ethers.Wallet.createRandom();
Expand Down
2 changes: 1 addition & 1 deletion packages/nitro-protocol/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"declaration": true,
"skipLibCheck": true
},
"include": ["src/index.ts", "addresses.json"]
"include": ["src/index.ts", "addresses.json", "../test/@types/environment.d.ts"]
}

0 comments on commit 6d5f4ac

Please sign in to comment.