Skip to content

Commit

Permalink
feat: update l2 erc20 bridge address in updater as well (#3500)
Browse files Browse the repository at this point in the history
## What ❔

update l2 erc20 bridge address as well as l2 shared bridge

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

Co-authored-by: Jobe Smith <[email protected]>
  • Loading branch information
perekopskiy and jobesmith-man authored Jan 17, 2025
1 parent 4c381a8 commit fe3c7b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/node/api_server/src/web3/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ impl BridgeAddressesHandle {
self.0.write().await.l1_shared_default_bridge = Some(l1_shared_bridge);
}

pub async fn update_l2_shared_bridge(&self, l2_shared_bridge: Address) {
pub async fn update_l2_bridges(&self, l2_shared_bridge: Address) {
self.0.write().await.l2_shared_default_bridge = Some(l2_shared_bridge);
self.0.write().await.l2_erc20_default_bridge = Some(l2_shared_bridge);
}

pub async fn read(&self) -> api::BridgeAddresses {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl L1UpdaterInner {
// - To not undo the previous change in case of a network error
if info.should_use_l2_asset_router {
self.bridge_address_updater
.update_l2_shared_bridge(L2_ASSET_ROUTER_ADDRESS)
.update_l2_bridges(L2_ASSET_ROUTER_ADDRESS)
.await;
}
}
Expand Down

0 comments on commit fe3c7b2

Please sign in to comment.