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

Bridge tokens: fix recipient type & downgrade rust toolchain #234

Merged
merged 6 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ res/ERC20MetadataLogger.json: metadata-connector/contracts/ERC20MetadataLogger.s

test: export BRIDGE_TOKEN = $(realpath res/bridge_token.wasm)
test:
rustup install 1.70.0 && \
cd bridge-token-factory && \
cargo test --all
cargo +1.70.0 test --all
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we run the tests with toolchain 1.70.0, if we downgrade it to 1.69.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The 1.70 is required for dev deps, eg near-workspace crate



test-token-locker:
Expand Down
4 changes: 2 additions & 2 deletions bridge-token-factory/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bridge-token-factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bridge-token-factory"
version = "0.2.1"
version = "0.2.2"
authors = ["Near Inc <[email protected]>"]
edition = "2021"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion bridge-token-factory/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.70.0"
channel = "1.69.0"
components = ["clippy", "rustfmt"]
6 changes: 3 additions & 3 deletions bridge-token-factory/tests/token_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ async fn test_upgrade() {

// Verify the factory version
let factory_version: String = factory.view("version").await.unwrap().json().unwrap();
assert_eq!(factory_version, "0.2.1");
assert_eq!(factory_version, "0.2.2");

// Set alice as super admin
let result = factory
Expand Down Expand Up @@ -582,7 +582,7 @@ async fn test_upgrade() {
.unwrap()
.json()
.unwrap();
assert_eq!(token_version, "0.2.1");
assert_eq!(token_version, "0.2.2");

// Upgrade the bridge token over factory (redeploy the same version)
let result = alice
Expand All @@ -605,7 +605,7 @@ async fn test_upgrade() {
.unwrap()
.json()
.unwrap();
assert_eq!(token_version, "0.2.1");
assert_eq!(token_version, "0.2.2");

// Grant alice the `PauseManager` role
let result = alice
Expand Down
2 changes: 1 addition & 1 deletion bridge-token/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bridge-token/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bridge-token"
version = "0.2.1"
version = "0.2.2"
authors = ["Near Inc <[email protected]>"]
edition = "2021"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion bridge-token/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.70.0"
channel = "1.69.0"
components = ["clippy", "rustfmt"]
4 changes: 2 additions & 2 deletions bridge-token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub trait ExtBridgeTokenFactory {
fn finish_withdraw(
&self,
#[serializer(borsh)] amount: Balance,
#[serializer(borsh)] recipient: AccountId,
#[serializer(borsh)] recipient: String,
) -> Promise;
}

Expand Down Expand Up @@ -113,7 +113,7 @@ impl BridgeToken {

ext_bridge_token_factory::ext(self.controller.clone())
.with_static_gas(FINISH_WITHDRAW_GAS)
.finish_withdraw(amount.into(), recipient.parse().unwrap())
.finish_withdraw(amount.into(), recipient)
}

pub fn account_storage_usage(&self) -> StorageUsage {
Expand Down
Binary file modified res/bridge_token.wasm
Binary file not shown.
Binary file modified res/bridge_token_factory.wasm
Binary file not shown.