Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdivine committed Oct 29, 2024
1 parent e367eb1 commit cf97221
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/signer/canister/tests/it/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ mod eth_address {
use super::*;

/// A standard eth_address call, including payment.
fn paid_eth_address(test_env: &TestSetup, caller: Principal, principal: Option<Principal>) -> Result<Result<EthAddressResponse, EthAddressError>, String> {
fn paid_eth_address(
test_env: &TestSetup,
caller: Principal,
principal: Option<Principal>,
) -> Result<Result<EthAddressResponse, EthAddressError>, String> {
let payment_type = PaymentType::CallerPaysIcrc2Cycles;
let payment_recipient = cycles_ledger::Account {
owner: test_env.signer.canister_id(),
Expand All @@ -199,9 +203,11 @@ mod eth_address {
.expect("Failed to call ledger canister")
.expect("Failed to approve payment");

test_env
.signer
.eth_address(caller, &EthAddressRequest { principal }, &Some(payment_type))
test_env.signer.eth_address(
caller,
&EthAddressRequest { principal },
&Some(payment_type),
)
}

#[test]
Expand Down Expand Up @@ -237,7 +243,13 @@ mod eth_address {
#[test]
fn test_anonymous_cannot_call_eth_address() {
let test_env = TestSetup::default();
let response = test_env.signer.eth_address(Principal::anonymous(), &EthAddressRequest{principal: Some(test_env.user)}, &Some(PaymentType::CallerPaysIcrc2Cycles));
let response = test_env.signer.eth_address(
Principal::anonymous(),
&EthAddressRequest {
principal: Some(test_env.user),
},
&Some(PaymentType::CallerPaysIcrc2Cycles),
);
assert!(response.is_err());
assert_eq!(
response.unwrap_err(),
Expand All @@ -248,7 +260,13 @@ mod eth_address {
#[test]
fn test_cannot_call_eth_address_of_for_anonymous() {
let test_env = TestSetup::default();
let response = test_env.signer.eth_address(test_env.user, &EthAddressRequest{principal: Some(Principal::anonymous())}, &Some(PaymentType::CallerPaysIcrc2Cycles));
let response = test_env.signer.eth_address(
test_env.user,
&EthAddressRequest {
principal: Some(Principal::anonymous()),
},
&Some(PaymentType::CallerPaysIcrc2Cycles),
);
assert!(response.is_err());
assert!(response
.unwrap_err()
Expand Down

0 comments on commit cf97221

Please sign in to comment.