Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan committed Nov 13, 2024
1 parent 56cb055 commit b82f672
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/canisters/registry/impl/src/updates/add_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async fn add_token_impl(
}
Err(message) => {
error!(%user_id, ?message, "Error transferring listing fee");
return PaymentFailed("message".to_string());
return PaymentFailed(message.to_string());
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion backend/integration_tests/src/client/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ pub mod happy_path {
pub fn approve_transfer(env: &mut PocketIc, user: &User, args: &user_canister::approve_transfer::Args) {
let response = super::approve_transfer(env, user.principal, user.canister(), args);

assert!(matches!(response, user_canister::approve_transfer::Response::Success));
match response {
user_canister::approve_transfer::Response::Success => (),
response => panic!("'approve_transfer' error: {response:?}"),
};
}
}
10 changes: 6 additions & 4 deletions backend/integration_tests/src/registry_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::ops::Deref;
use std::time::Duration;
use testing::rng::{random_principal, random_string};
use types::{CanisterId, Cryptocurrency};
use utils::consts::SNS_GOVERNANCE_CANISTER_ID;

#[test]
fn add_token_succeeds() {
Expand Down Expand Up @@ -44,7 +43,10 @@ fn add_token_succeeds() {
},
);

assert!(matches!(add_token_response, registry_canister::add_token::Response::Success));
match add_token_response {
registry_canister::add_token::Response::Success => (),
response => panic!("'add_token' error: {response:?}"),
};

env.tick();

Expand Down Expand Up @@ -197,9 +199,9 @@ fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Pr
env,
&user,
&user_canister::approve_transfer::Args {
spender: SNS_GOVERNANCE_CANISTER_ID.into(), // CHAT BURN address
spender: canister_ids.registry.into(),
ledger_canister_id: Cryptocurrency::CHAT.ledger_canister_id().unwrap(),
amount: 100_000_000,
amount: 100_000_000 + Cryptocurrency::CHAT.fee().unwrap(),
expires_in: None,
pin: None,
},
Expand Down

0 comments on commit b82f672

Please sign in to comment.