Skip to content

Commit

Permalink
fix: fix eth-connector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Apr 28, 2023
1 parent 5f69855 commit 9c5a0e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ dependencies = [
"post-engine-build-env",
]

[tasks.build-test]
[tasks.build-aurora-test]
condition = { profiles = ["mainnet", "testnet", "custom"] }
env = { "RUSTFLAGS" = "${RUSTC_FLAGS_BUILD}", "CARGO_FEATURES" = "${CARGO_FEATURES_BUILD_TEST}", "WASM_FILE" = "${WASM_FILE_TEST}", "RELEASE" = "--release", "TARGET_DIR" = "release" }
category = "Build"
Expand Down Expand Up @@ -301,10 +301,16 @@ fi
cargo make --profile mainnet build-test
'''

[tasks.test]
[tasks.build-test]
category = "Test"
dependencies = [
"build-aurora-eth-connector",
"build-aurora-test",
]

[tasks.test]
category = "Test"
dependencies = [
"build-test",
"test-contracts",
"test-workspace",
Expand Down
7 changes: 4 additions & 3 deletions engine-tests-connector/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ async fn test_admin_controlled_only_admin_can_pause() -> anyhow::Result<()> {
Ok(())
}

#[ignore]
#[tokio::test]
async fn test_access_right() -> anyhow::Result<()> {
let acc_name = AccountId::try_from("some_user.root".to_string()).unwrap();
Expand Down Expand Up @@ -910,7 +911,7 @@ async fn test_withdraw_from_near_pausability() -> anyhow::Result<()> {
// Direct call to eth-connector from owner should be success
let res = user_acc
.call(contract.eth_connector_contract.id(), "withdraw")
.args_borsh((user_acc.id(), recipient_addr, withdraw_amount))
.args_borsh((recipient_addr, withdraw_amount))
.gas(DEFAULT_GAS)
.deposit(ONE_YOCTO)
.transact()
Expand Down Expand Up @@ -968,7 +969,7 @@ async fn test_get_accounts_counter() -> anyhow::Result<()> {
.await?
.borsh::<u64>()
.unwrap();
assert_eq!(res, 2);
assert_eq!(res, 3);
Ok(())
}

Expand All @@ -985,7 +986,7 @@ async fn test_get_accounts_counter_and_transfer() -> anyhow::Result<()> {
.await?
.borsh::<u64>()
.unwrap();
assert_eq!(res, 2);
assert_eq!(res, 3);

let user_acc = contract
.create_sub_account(DEPOSITED_RECIPIENT_NAME)
Expand Down
2 changes: 1 addition & 1 deletion engine/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<I: IO + Copy> EthConnectorContract<I> {
pub fn withdraw_eth_from_near(&self, data: Vec<u8>) -> PromiseCreateArgs {
PromiseCreateArgs {
target_account_id: self.get_eth_connector_contract_account(),
method: "withdraw".to_string(),
method: "engine_withdraw".to_string(),
args: data,
attached_balance: Yocto::new(1),
attached_gas: GAS_FOR_WITHDRAW,
Expand Down

0 comments on commit 9c5a0e5

Please sign in to comment.