Skip to content

Commit

Permalink
Bridge tokens: fix recipient type & downgrade rust toolchain (#234)
Browse files Browse the repository at this point in the history
* Fix recipient type on withdraw

* Bump crates versions

* Downgrade rust-toolchain

* Fix test

* Update contracts builds

* Fix test
  • Loading branch information
karim-en authored Oct 16, 2023
1 parent 52bfcf2 commit 69f5cce
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 13 deletions.
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


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.

0 comments on commit 69f5cce

Please sign in to comment.