Skip to content

Commit

Permalink
chore(tests): move public address to file
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Sep 11, 2023
1 parent 1fda1f9 commit efc9d48
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/commands/deposit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe("deposit", () => {
const chain = "era-testnet";
const amount = "0.1";
const privateKey = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110";
const publicAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049";
const recipient = "0xa1cf087DB965Ab02Fb3CFaCe1f5c63935815f044";
const senderFinalBalance = "0.5";
const transactionHash = "0x5313817e1e3ba46e12aad81d481293069096ade97b577d175c34a18466f97e5a";
Expand Down Expand Up @@ -69,9 +70,9 @@ describe("deposit", () => {
expect(stdOutMock).not.hasConsoleErrors();

expect(stdOutMock).toBeInConsole("Deposit:");
expect(stdOutMock).toBeInConsole("From: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (Ethereum Goerli)");
expect(stdOutMock).toBeInConsole(`From: ${publicAddress} (Ethereum Goerli)`);
expect(stdOutMock).toBeInConsole(`To: ${recipient} (zkSync Era Testnet)`);
expect(stdOutMock).toBeInConsole("Amount: 0.1 ETH");
expect(stdOutMock).toBeInConsole(`Amount: ${amount} ETH`);

expect(stdOutMock).toBeInConsole("Sending deposit transaction...");

Expand Down Expand Up @@ -109,7 +110,7 @@ describe("deposit", () => {
l2RpcUrl,
});

expect(stdOutMock).toBeInConsole(`From: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (${l1RpcUrl})`);
expect(stdOutMock).toBeInConsole(`From: ${publicAddress} (${l1RpcUrl})`);
expect(stdOutMock).toBeInConsole(`To: ${recipient} (${l2RpcUrl})`);

expect(l2ProviderMock).toHaveBeenCalledTimes(1);
Expand Down
3 changes: 2 additions & 1 deletion src/commands/withdraw-finalize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("withdraw-finalize", () => {

const chain = "era-testnet";
const privateKey = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110";
const publicAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049";
const senderFinalBalance = "0.5";
const transactionHash = "0x5313817e1e3ba46e12aad81d481293069096ade97b577d175c34a18466f97e5a";
const ethExecuteTxHash = "0xc219cb70d5458bb405a2e71d2b810148a302cb93b7b81b4d434d7d55eb82d120";
Expand Down Expand Up @@ -67,7 +68,7 @@ describe("withdraw-finalize", () => {
expect(stdOutMock).toBeInConsole("From chain: zkSync Era Testnet");
expect(stdOutMock).toBeInConsole("To chain: Ethereum Goerli");
expect(stdOutMock).toBeInConsole(`Withdrawal transaction (L2): ${transactionHash}`);
expect(stdOutMock).toBeInConsole("Finalizer address (L1): 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049");
expect(stdOutMock).toBeInConsole(`Finalizer address (L1): ${publicAddress}`);

expect(stdOutMock).toBeInConsole("Checking status of the transaction...");
expect(stdOutMock).toBeInConsole("Transaction is ready to be finalized");
Expand Down
7 changes: 4 additions & 3 deletions src/commands/withdraw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe("withdraw", () => {
const chain = "era-testnet";
const amount = "0.1";
const privateKey = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110";
const publicAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049";
const recipient = "0xa1cf087DB965Ab02Fb3CFaCe1f5c63935815f044";
const senderFinalBalance = "0.5";
const transactionHash = "0x5313817e1e3ba46e12aad81d481293069096ade97b577d175c34a18466f97e5a";
Expand Down Expand Up @@ -69,9 +70,9 @@ describe("withdraw", () => {
expect(stdOutMock).not.hasConsoleErrors();

expect(stdOutMock).toBeInConsole("Withdraw:");
expect(stdOutMock).toBeInConsole("From: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (zkSync Era Testnet)");
expect(stdOutMock).toBeInConsole(`From: ${publicAddress} (zkSync Era Testnet)`);
expect(stdOutMock).toBeInConsole(`To: ${recipient} (Ethereum Goerli)`);
expect(stdOutMock).toBeInConsole("Amount: 0.1 ETH");
expect(stdOutMock).toBeInConsole(`Amount: ${amount} ETH`);

expect(stdOutMock).toBeInConsole("Sending withdraw transaction...");

Expand Down Expand Up @@ -109,7 +110,7 @@ describe("withdraw", () => {
l2RpcUrl,
});

expect(stdOutMock).toBeInConsole(`From: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (${l2RpcUrl})`);
expect(stdOutMock).toBeInConsole(`From: ${publicAddress} (${l2RpcUrl})`);
expect(stdOutMock).toBeInConsole(`To: ${recipient} (${l1RpcUrl})`);

expect(l2ProviderMock).toHaveBeenCalledTimes(1);
Expand Down
File renamed without changes.

0 comments on commit efc9d48

Please sign in to comment.