Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: l2 native token tests #2916

Merged
merged 63 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d1144b5
some changes
kelemeno Sep 2, 2024
368d657
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Sep 2, 2024
30508cd
bump contracts
kelemeno Sep 3, 2024
e355e5c
chain.toml
kelemeno Sep 3, 2024
0357fc6
contracts.toml
kelemeno Sep 3, 2024
291972e
bump contracts with fixes
kelemeno Sep 4, 2024
679f8e7
config
kelemeno Sep 4, 2024
01d7391
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Sep 11, 2024
db05aba
fixes
kelemeno Sep 12, 2024
b90e9c8
bump contracts
kelemeno Sep 12, 2024
e8775c7
config
kelemeno Sep 12, 2024
644a076
contracts.ts config
kelemeno Sep 13, 2024
bd5ba3d
make CI slightly smaller
kelemeno Sep 13, 2024
886460f
typo
kelemeno Sep 13, 2024
037e7c6
contract env var error
kelemeno Sep 13, 2024
b6f0dfa
config
kelemeno Sep 13, 2024
1b261d9
contracts config
kelemeno Sep 13, 2024
eceb869
config
kelemeno Sep 13, 2024
16fbac8
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Sep 13, 2024
6b96da9
chain config
kelemeno Sep 13, 2024
8a06017
config
kelemeno Sep 13, 2024
0efee21
contracts fix
kelemeno Sep 13, 2024
d29dbbd
bump contracts
kelemeno Sep 13, 2024
6dc895f
fixes
kelemeno Sep 14, 2024
c4909f7
bump contracts
kelemeno Sep 14, 2024
2bfc739
contracts config
kelemeno Sep 14, 2024
23c7a87
bump contracts
kelemeno Sep 14, 2024
db612f8
fixed unit tests
kelemeno Sep 16, 2024
a94999d
bump contracts
kelemeno Sep 16, 2024
94edd3c
last test fix
kelemeno Sep 16, 2024
d0bd8a9
fmt
kelemeno Sep 16, 2024
170ae00
l2 native token tests
kelemeno Sep 18, 2024
5983a2e
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Sep 18, 2024
3b85806
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Sep 26, 2024
16735cf
bump contracts
kelemeno Sep 29, 2024
1ab4295
main gw->L1 migration changes
kelemeno Oct 1, 2024
3eaa189
GW->L1 migration config changes
kelemeno Oct 2, 2024
0ddb00f
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Oct 2, 2024
0557dde
fixed most tests
kelemeno Oct 2, 2024
b362e69
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Oct 2, 2024
327ee4d
small test fixes
kelemeno Oct 3, 2024
1a0919e
zks fmt
kelemeno Oct 3, 2024
bf85e75
undo test fixes for CI
kelemeno Oct 3, 2024
c4e2e71
comment out l2 tests
kelemeno Oct 3, 2024
12a903e
increase time
kelemeno Oct 3, 2024
affd930
make l2-erc20 test uncommenting work
kelemeno Oct 3, 2024
bfac316
linting
kelemeno Oct 3, 2024
a818916
feat: l2 native contract checks integration tests (#3010)
Raid5594 Oct 3, 2024
c71d11e
bump contracts
kelemeno Oct 3, 2024
fcde977
Merge branch 'sync-layer-stable' of github.com:matter-labs/zksync-era…
kelemeno Oct 3, 2024
0a00512
undo selectors
kelemeno Oct 3, 2024
c2b1a4b
cleanup
kelemeno Oct 4, 2024
0042c3e
genesis.yaml
kelemeno Oct 4, 2024
b164d6d
stas issues
kelemeno Oct 7, 2024
26c3c3b
linting
kelemeno Oct 7, 2024
3be0246
genesis.yaml
kelemeno Oct 7, 2024
4cb7d52
linting + sdk
kelemeno Oct 7, 2024
7fd6b03
rust unit test
kelemeno Oct 7, 2024
2e9cba9
missing enter
kelemeno Oct 7, 2024
5beb49d
bump contracts
kelemeno Oct 7, 2024
7999679
config
kelemeno Oct 7, 2024
0e1cdcb
bump contracts
kelemeno Oct 8, 2024
3d47744
config
kelemeno Oct 8, 2024
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
50 changes: 50 additions & 0 deletions .github/scripts/gateway.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
sudo rm -rf ./volumes && zk_supervisor clean containers && zk_inception up -o false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this script ever used? storing it in .github implies that it is used in CI, but it is not the case

Copy link
Contributor Author

@kelemeno kelemeno Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the contracts commit used here is not the latest one from the branch in contracts

its just system contract hashes, did not bump for that.

is this script ever used? storing it in .github implies that it is used in CI, but it is not the case

I use it for local setup, testing, yes probably this is not the right place, I'll put it in ./bin ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you discuss it with @Deniallugo? I just don't feel this is something we want to leave committed forever, if it is something we will delete before merging to main, then okay let's keep it here, but it maybe it is helpful for the platform team/toolbox in general

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have things like this in sync-layer-stable, but yes will discuss:

https://github.com/matter-labs/zksync-era/blob/sync-layer-stable/bin/start_sync_layer_l3_chain.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He is OOO today, so I messaged him, but I think we can merge before he replies

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need such scripts?
actually zk_supervisor clean containers already removing volumes and adding one another binary for it seems inappropriate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh I think it is very similar to zki e init --dev . The difference is that it includes GW.

We can either have it as a bash script, or include it into zki e init --dev .


zk_inception ecosystem init --deploy-paymaster --deploy-erc20 \
--deploy-ecosystem --l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_era \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_era \
--ignore-prerequisites --observability=false --skip-submodules-checkout \
--chain era \
# --skip-contract-compilation-override \

zk_inception chain create \
--chain-name gateway \
--chain-id 505 \
--prover-mode no-proofs \
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode rollup \
--base-token-address 0x0000000000000000000000000000000000000001 \
--base-token-price-nominator 1 \
--base-token-price-denominator 1 \
--set-as-default false \
--ignore-prerequisites --skip-submodules-checkout --skip-contract-compilation-override

zk_inception chain init \
--deploy-paymaster \
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_gateway \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_gateway \
--chain gateway --skip-submodules-checkout

zk_inception chain convert-to-gateway --chain gateway --ignore-prerequisites

zk_inception server --ignore-prerequisites --chain gateway &> ./gateway.log &

sleep 20

zk_inception chain migrate-to-gateway --chain era --gateway-chain-name gateway

zk_inception chain migrate-from-gateway --chain era --gateway-chain-name gateway

zk_inception chain migrate-to-gateway --chain era --gateway-chain-name gateway

zk_inception server --ignore-prerequisites --chain era &> ./rollup.log &

sleep 20

zk_supervisor test integration --no-deps --ignore-prerequisites --chain era
8 changes: 8 additions & 0 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ jobs:
ci_run zk_inception chain migrate-to-gateway --chain era --gateway-chain-name gateway
ci_run zk_inception chain migrate-to-gateway --chain validium --gateway-chain-name gateway
ci_run zk_inception chain migrate-to-gateway --chain custom_token --gateway-chain-name gateway

- name: Migrate back era
run: |
ci_run zk_inception chain migrate-from-gateway --chain era --gateway-chain-name gateway

- name: Migrate to gateway again
run: |
ci_run zk_inception chain migrate-to-gateway --chain era --gateway-chain-name gateway

- name: Build test dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion contracts
Submodule contracts updated 58 files
+1 −0 l1-contracts/.env
+15 −1 l1-contracts/contracts/bridge/BridgedStandardERC20.sol
+9 −6 l1-contracts/contracts/bridge/L1Nullifier.sol
+2 −2 l1-contracts/contracts/bridge/L2SharedBridgeLegacy.sol
+18 −1 l1-contracts/contracts/bridge/L2WrappedBaseToken.sol
+6 −0 l1-contracts/contracts/bridge/asset-router/AssetRouterBase.sol
+29 −0 l1-contracts/contracts/bridge/asset-router/IL1AssetRouter.sol
+4 −2 l1-contracts/contracts/bridge/asset-router/IL2AssetRouter.sol
+41 −5 l1-contracts/contracts/bridge/asset-router/L1AssetRouter.sol
+32 −11 l1-contracts/contracts/bridge/asset-router/L2AssetRouter.sol
+4 −0 l1-contracts/contracts/bridge/interfaces/IBridgedStandardToken.sol
+1 −1 l1-contracts/contracts/bridge/interfaces/IL2SharedBridgeLegacy.sol
+10 −2 l1-contracts/contracts/bridge/ntv/INativeTokenVault.sol
+29 −2 l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol
+7 −5 l1-contracts/contracts/bridge/ntv/L2NativeTokenVault.sol
+31 −14 l1-contracts/contracts/bridge/ntv/NativeTokenVault.sol
+10 −4 l1-contracts/contracts/bridgehub/Bridgehub.sol
+1 −1 l1-contracts/contracts/bridgehub/CTMDeploymentTracker.sol
+1 −1 l1-contracts/contracts/bridgehub/IBridgehub.sol
+1 −1 l1-contracts/contracts/bridgehub/ICTMDeploymentTracker.sol
+5 −0 l1-contracts/contracts/common/Config.sol
+19 −12 l1-contracts/contracts/common/L1ContractErrors.sol
+78 −0 l1-contracts/contracts/dev-contracts/test/L2NativeTokenVaultDev.sol
+3 −0 l1-contracts/contracts/state-transition/chain-interfaces/IAdmin.sol
+67 −487 l1-contracts/deploy-scripts/DeployL1.s.sol
+483 −0 l1-contracts/deploy-scripts/DeployUtils.s.sol
+102 −18 l1-contracts/deploy-scripts/GatewayPreparation.s.sol
+30 −26 l1-contracts/deploy-scripts/RegisterZKChain.s.sol
+1 −1 l1-contracts/package.json
+3 −1 l1-contracts/src.ts/deploy.ts
+11 −3 l1-contracts/test/foundry/l1/integration/AssetRouterTest.t.sol
+5 −5 l1-contracts/test/foundry/l1/integration/BridgeHubInvariantTests.t.sol
+5 −5 l1-contracts/test/foundry/l1/integration/BridgehubTests.t.sol
+65 −6 l1-contracts/test/foundry/l1/integration/DeploymentTest.t.sol
+97 −107 l1-contracts/test/foundry/l1/integration/L1GatewayTests.t.sol
+3 −2 l1-contracts/test/foundry/l1/integration/_GatewayPreparationForTests.sol
+3 −3 l1-contracts/test/foundry/l1/integration/_SharedGatewayDeployer.t.sol
+25 −18 l1-contracts/test/foundry/l1/integration/_SharedL1ContractDeployer.t.sol
+11 −6 l1-contracts/test/foundry/l1/integration/_SharedZKChainDeployer.t.sol
+1 −1 l1-contracts/test/foundry/l1/integration/deploy-scripts/script-config/config-deploy-l1.toml
+51 −0 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2Erc20L1Test.t.sol
+16 −54 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2Erc20TestAbstract.t.sol
+51 −0 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2GatewayL1Test.t.sol
+85 −0 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2GatewayTestAbstract.t.sol
+25 −20 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/L2WethTestAbstract.t.sol
+202 −0 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/_SharedL2ContractDeployer.sol
+129 −0 l1-contracts/test/foundry/l1/integration/l2-tests-in-l1-context/_SharedL2ContractL1DeployerUtils.sol
+0 −5 l1-contracts/test/foundry/l1/unit/concrete/Bridges/L1SharedBridge/_L1SharedBridge_Shared.t.sol
+49 −0 l1-contracts/test/foundry/l2/integration/L2ERC20BridgeTest.t.sol
+60 −0 l1-contracts/test/foundry/l2/integration/L2GatewayTests.t.sol
+114 −45 l1-contracts/test/foundry/l2/integration/L2Utils.sol
+36 −0 l1-contracts/test/foundry/l2/integration/WETH.t.sol
+41 −0 l1-contracts/test/foundry/l2/integration/_SharedL2ContractL2DeployerUtils.sol
+1 −1 l2-contracts/test/foundry/unit/data-availability/ValidiumL2DAValidator.t.sol
+11 −11 system-contracts/SystemContractsHashes.json
+2 −2 system-contracts/contracts/L2GatewayUpgrade.sol
+2 −2 system-contracts/contracts/L2GenesisUpgrade.sol
+2 −2 system-contracts/contracts/L2GenesisUpgradeHelper.sol
3 changes: 3 additions & 0 deletions core/lib/config/src/configs/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ pub struct ContractsConfig {
pub l2_da_validator_addr: Option<Address>,

pub chain_admin_addr: Option<Address>,

pub settlement_layer: Option<u64>,
}

impl ContractsConfig {
Expand All @@ -78,6 +80,7 @@ impl ContractsConfig {
user_facing_diamond_proxy_addr: Some(Address::repeat_byte(0x16)),
chain_admin_addr: Some(Address::repeat_byte(0x18)),
l2_da_validator_addr: Some(Address::repeat_byte(0x19)),
settlement_layer: Some(0),
}
}
}
4 changes: 4 additions & 0 deletions core/lib/config/src/configs/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ pub struct GatewayChainConfig {
pub diamond_proxy_addr: Address,
pub chain_admin_addr: Option<Address>,
pub governance_addr: Address,
pub settlement_layer: u64,
}

impl GatewayChainConfig {
pub fn from_gateway_and_chain_data(
gateway_config: &GatewayConfig,
diamond_proxy_addr: Address,
chain_admin_addr: Address,
settlement_layer: u64,
) -> Self {
// FIXME: there is no "governnace" for a chain, only an admin, we
// need to figure out what we mean here
Expand All @@ -48,6 +50,7 @@ impl GatewayChainConfig {
diamond_proxy_addr,
chain_admin_addr: Some(chain_admin_addr),
governance_addr: chain_admin_addr,
settlement_layer,
}
}
}
Expand All @@ -64,6 +67,7 @@ impl From<ContractsConfig> for GatewayChainConfig {
diamond_proxy_addr: value.diamond_proxy_addr,
chain_admin_addr: value.chain_admin_addr,
governance_addr: value.governance_addr,
settlement_layer: value.settlement_layer.unwrap(),
}
}
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ impl Distribution<configs::ContractsConfig> for EncodeDist {
l2_da_validator_addr: rng.gen(),
base_token_addr: self.sample_opt(|| rng.gen()),
chain_admin_addr: self.sample_opt(|| rng.gen()),
settlement_layer: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ mod tests {
)),
chain_admin_addr: Some(addr("0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
l2_da_validator_addr: Some(addr("0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
settlement_layer: Some(0),
}
}

Expand Down Expand Up @@ -129,6 +130,7 @@ CONTRACTS_USER_FACING_DIAMOND_PROXY_ADDR="0xF00B988a98Ca742e7958DeF9F7823b590871
CONTRACTS_L2_NATIVE_TOKEN_VAULT_PROXY_ADDR="0xfc073319977e314f251eae6ae6be76b0b3baeecf"
CONTRACTS_L2_DA_VALIDATOR_ADDR="0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_CHAIN_ADMIN_ADDR="0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_SETTLEMENT_LAYER="0"
"#;
lock.set_env(config);

Expand Down
2 changes: 2 additions & 0 deletions core/lib/protobuf_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl ProtoRepr for proto::Contracts {
.map(|x| parse_h160(x))
.transpose()
.context("chain_admin_addr")?,
settlement_layer: self.settlement_layer,
})
}

Expand Down Expand Up @@ -191,6 +192,7 @@ impl ProtoRepr for proto::Contracts {
user_facing_diamond_proxy: this
.user_facing_diamond_proxy_addr
.map(|a| format!("{:?}", a)),
settlement_layer: this.settlement_layer,
}
}
}
2 changes: 2 additions & 0 deletions core/lib/protobuf_config/src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl ProtoRepr for proto::GatewayChainConfig {
governance_addr: required(&self.governance_addr)
.and_then(|x| parse_h160(x))
.context("governance_addr")?,
settlement_layer: *required(&self.settlement_layer)?,
})
}

Expand All @@ -45,6 +46,7 @@ impl ProtoRepr for proto::GatewayChainConfig {
diamond_proxy_addr: Some(format!("{:?}", this.diamond_proxy_addr)),
chain_admin_addr: this.chain_admin_addr.map(|x| format!("{:?}", x)),
governance_addr: Some(format!("{:?}", this.governance_addr)),
settlement_layer: Some(this.settlement_layer),
}
}
}
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/contracts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ message Contracts {
optional EcosystemContracts ecosystem_contracts = 4;
optional string user_facing_bridgehub = 5;
optional string user_facing_diamond_proxy = 6;
optional uint64 settlement_layer = 7;
}
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ message GatewayChainConfig {
optional string diamond_proxy_addr = 4;
optional string chain_admin_addr = 5;
optional string governance_addr = 6;
optional uint64 settlement_layer = 7;
}
1 change: 0 additions & 1 deletion core/node/api_server/src/web3/namespaces/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ impl ZksNamespace {
batch_number: L1BatchNumber,
) -> Result<Option<L1ProcessingDetails>, Web3Error> {
let mut storage = self.state.acquire_connection().await?;
println!("\n\nHey1\n\n");
self.state
.start_info
.ensure_not_pruned(batch_number, &mut storage)
Expand Down
15 changes: 8 additions & 7 deletions core/node/genesis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ impl GenesisParams {
) -> Result<GenesisParams, GenesisError> {
println!(
"
bootloader_hash = \"{:?}\"
default_aa_hash = \"{:?}\"
GENESIS_PROTOCOL_SEMANTIC_VERSION = \"{:?}\"
bootloader_hash: {:?}
default_aa_hash: {:?}
genesis_protocol_semantic_version: 0.{:?}.{:?}
",
base_system_contracts.hashes().bootloader,
base_system_contracts.hashes().default_aa,
config.protocol_version.unwrap(),
config.protocol_version.unwrap().minor,
config.protocol_version.unwrap().patch,
);
let base_system_contracts_hashes = BaseSystemContractsHashes {
bootloader: config
Expand Down Expand Up @@ -339,9 +340,9 @@ pub async fn ensure_genesis_state(
} = insert_genesis_batch(&mut transaction, genesis_params).await?;
println!(
"
GENESIS_ROOT = \"{:?}\"
GENESIS_BATCH_COMMITMENT = \"{:?}\"
GENESIS_ROLLUP_LEAF_INDEX = \"{:?}\"
genesis_root: {:?}
genesis_batch_commitment: {:?}
genesis_rollup_leaf_index: {:?}
",
root_hash, commitment, rollup_last_leaf_index
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,26 @@ impl WiringLayer for PKSigningEthClientLayer {
BoundEthInterfaceForBlobsResource(Box::new(signing_client_for_blobs))
});
let signing_client_for_gateway = if input.gateway_client.is_some() {
let private_key = self.wallets.operator.private_key();
let GatewayEthInterfaceResource(gateway_client) = input.gateway_client.unwrap();
let signing_client_for_blobs = PKSigningClient::new_raw(
private_key.clone(),
self.gateway_contracts_config.unwrap().diamond_proxy_addr,
gas_adjuster_config.default_priority_fee_per_gas,
self.sl_chain_id,
gateway_client,
);
Some(BoundEthInterfaceForL2Resource(Box::new(
signing_client_for_blobs,
)))
if self
.gateway_contracts_config
.clone()
.is_some_and(|v| v.settlement_layer != 0_u64)
{
let private_key = self.wallets.operator.private_key();
let GatewayEthInterfaceResource(gateway_client) = input.gateway_client.unwrap();
let signing_client_for_blobs = PKSigningClient::new_raw(
private_key.clone(),
self.gateway_contracts_config.unwrap().diamond_proxy_addr,
gas_adjuster_config.default_priority_fee_per_gas,
self.sl_chain_id,
gateway_client,
);
Some(BoundEthInterfaceForL2Resource(Box::new(
signing_client_for_blobs,
)))
} else {
None
}
} else {
None
};
Expand Down
3 changes: 2 additions & 1 deletion core/tests/ts-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"ts-jest": "^29.0.1",
"ts-node": "^10.1.0",
"typescript": "^4.3.5",
"zksync-ethers": "^6.9.0",
"zksync-ethers": "git+https://github.com/zksync-sdk/zksync-ethers#ra/fix-l2-l1-bridging",
"zksync-ethers-gw": "https://github.com/zksync-sdk/zksync-ethers#kl/gateway-support",
"elliptic": "^6.5.5",
"yaml": "^2.4.2"
}
Expand Down
4 changes: 4 additions & 0 deletions core/tests/ts-integration/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export function getContractSource(relativePath: string): string {
return source;
}

export function readContract(path: string, fileName: string) {
return JSON.parse(fs.readFileSync(`${path}/${fileName}.sol/${fileName}.json`, { encoding: 'utf-8' }));
}

/**
* Performs a contract deployment
*
Expand Down
2 changes: 1 addition & 1 deletion core/tests/ts-integration/tests/contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('Smart contract behavior checks', () => {

// We manually provide a constant, since otherwise the exception would be thrown
// while estimating gas
await expect(counterContract.incrementWithRevert(5, true, { gasLimit: 5000000, gasPrice })).toBeReverted([]);
await expect(counterContract.incrementWithRevert(5, true, { gasLimit: 5000000, gasPrice })).toBeReverted();

// The tx has been reverted, so the value Should not have been changed:
const newValue = await counterContract.get();
Expand Down
2 changes: 1 addition & 1 deletion core/tests/ts-integration/tests/erc20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as ethers from 'ethers';
import { scaledGasPrice, waitForBlockToBeFinalizedOnL1 } from '../src/helpers';
import { L2_DEFAULT_ETH_PER_ACCOUNT } from '../src/context-owner';

describe('ERC20 contract checks', () => {
describe('L1 ERC20 contract checks', () => {
let testMaster: TestMaster;
let alice: zksync.Wallet;
let bob: zksync.Wallet;
Expand Down
Loading
Loading