Skip to content

Commit

Permalink
Rename stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Mar 8, 2024
1 parent 95d3618 commit 3504f6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.beforeEach(t => {
});
t.context.deployContractStub = deployContractStub;

t.context.fakeDefenderClient = {
t.context.fakeDeployClient = {
deployContract: deployContractStub,
getDeployedContract: getDeployedContractStub,
};
Expand All @@ -60,7 +60,7 @@ test.afterEach.always(t => {
test('deploy required args', async t => {
const args = ['--contractName', 'MyContract', '--contractPath', 'contracts/MyContract.sol', '--chainId', FAKE_CHAIN_ID, '--buildInfoFile', 'test/input/build-info.json'];

await deploy(args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await deploy(args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.deployContractStub.callCount, 1);

Expand All @@ -81,7 +81,7 @@ test('deploy required args', async t => {
test('deploy all args', async t => {
const args = ['--contractName', 'MyContract', '--contractPath', 'contracts/MyContract.sol', '--chainId', FAKE_CHAIN_ID, '--buildInfoFile', 'test/input/build-info.json', '--constructorBytecode', '0x1234', '--licenseType', 'MIT', '--verifySourceCode', 'false', '--relayerId', 'my-relayer-id', '--salt', '0x4567', '--createFactoryAddress', '0x0000000000000000000000000000000000098765'];

await deploy(args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await deploy(args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.deployContractStub.callCount, 1);

Expand Down
6 changes: 3 additions & 3 deletions test/get-approval-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.beforeEach(t => {
viaType: 'Multisig',
});

t.context.fakeDefenderClient = {
t.context.fakeDeployClient = {
getDeployApprovalProcess: t.context.getDeployApprovalProcessStub,
getUpgradeApprovalProcess: t.context.getUpgradeApprovalProcessStub,
};
Expand All @@ -65,7 +65,7 @@ test.afterEach.always(t => {
test('getDeployApprovalProcess args', async t => {
const args = ['--chainId', FAKE_CHAIN_ID];

await getApprovalProcess('getDeployApprovalProcess', args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await getApprovalProcess('getDeployApprovalProcess', args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.getDeployApprovalProcessStub.callCount, 1);
t.is(t.context.getUpgradeApprovalProcessStub.callCount, 0);
Expand All @@ -76,7 +76,7 @@ test('getDeployApprovalProcess args', async t => {
test('getUpgradeApprovalProcess args', async t => {
const args = ['--chainId', FAKE_CHAIN_ID];

await getApprovalProcess('getUpgradeApprovalProcess', args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await getApprovalProcess('getUpgradeApprovalProcess', args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.getDeployApprovalProcessStub.callCount, 0);
t.is(t.context.getUpgradeApprovalProcessStub.callCount, 1);
Expand Down
6 changes: 3 additions & 3 deletions test/propose-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(t => {
});
t.context.upgradeContractStub = upgradeContractStub;

t.context.fakeDefenderClient = {
t.context.fakeDeployClient = {
upgradeContract: upgradeContractStub,
};

Expand All @@ -54,7 +54,7 @@ test.afterEach.always(t => {
test('proposeUpgrade required args', async t => {
const args = ['--proxyAddress', PROXY_ADDRESS, '--newImplementationAddress', NEW_IMPLEMENTATION_ADDRESS, '--chainId', FAKE_CHAIN_ID];

await proposeUpgrade(args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await proposeUpgrade(args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.upgradeContractStub.callCount, 1);

Expand All @@ -71,7 +71,7 @@ test('proposeUpgrade required args', async t => {
test('proposeUpgrade all args', async t => {
const args = ['--proxyAddress', PROXY_ADDRESS, '--newImplementationAddress', NEW_IMPLEMENTATION_ADDRESS, '--chainId', FAKE_CHAIN_ID, '--proxyAdminAddress', PROXY_ADMIN_ADDRESS, '--contractArtifactFile', ABI_FILE, '--approvalProcessId', APPROVAL_PROCESS_ID];

await proposeUpgrade(args, t.context.fakeDefenderClient, t.context.fakeNetworkClient);
await proposeUpgrade(args, t.context.fakeDeployClient, t.context.fakeNetworkClient);

t.is(t.context.upgradeContractStub.callCount, 1);

Expand Down

0 comments on commit 3504f6b

Please sign in to comment.