Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Replace S3 example urls (#1055)
Browse files Browse the repository at this point in the history
Replaces the URLs `gnosis-safe-token-logos.s3.amazonaws.com` that were used as an example to `example.com`
  • Loading branch information
fmrsabino authored Jan 24, 2023
1 parent c95979b commit e6b35f2
Show file tree
Hide file tree
Showing 42 changed files with 288 additions and 218 deletions.
8 changes: 6 additions & 2 deletions src/common/converters/tests/balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ fn erc20_token_balance_usd_balance() {
decimals: 8,
symbol: "cETH".to_string(),
name: "Compound Ether 📈".to_string(),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string()),
logo_uri: Some(
"https://example.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string(),
),
},
balance: "5002".to_string(),
fiat_balance: "0.0014".to_string(),
Expand Down Expand Up @@ -80,7 +82,9 @@ fn erc20_token_balance_fiat_is_twice_usd() {
decimals: 8,
symbol: "cETH".to_string(),
name: "Compound Ether 📈".to_string(),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string()),
logo_uri: Some(
"https://example.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string(),
),
},
balance: "5002".to_string(),
fiat_balance: "0.0028".to_string(),
Expand Down
8 changes: 6 additions & 2 deletions src/common/converters/tests/balances_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ fn erc20_token_balance_usd_balance() {
decimals: 8,
symbol: "cETH".to_string(),
name: "Compound Ether 📈".to_string(),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string()),
logo_uri: Some(
"https://example.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string(),
),
},
balance: "5002".to_string(),
fiat_balance: "0.00142".to_string(),
Expand Down Expand Up @@ -82,7 +84,9 @@ fn erc20_token_balance_fiat_is_twice_usd() {
decimals: 8,
symbol: "cETH".to_string(),
name: "Compound Ether 📈".to_string(),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string()),
logo_uri: Some(
"https://example.com/0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e.png".to_string(),
),
},
balance: "5002".to_string(),
fiat_balance: "0.00285".to_string(),
Expand Down
104 changes: 54 additions & 50 deletions src/common/converters/tests/transfer_erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ async fn erc20_transfer_dto_to_incoming_transfer_transaction() {
sender: AddressEx::address_only("0xfFfa5813ED9a5DB4880D7303DB7d0cBe41bC771F"),
recipient: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
direction: TransferDirection::Incoming,
transfer_info: TransferInfo::Erc20(
Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
}
),
transfer_info: TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
}),
};

let actual = Erc20TransferDto::to_transfer_transaction(
Expand Down Expand Up @@ -70,23 +70,23 @@ async fn erc20_transfer_dto_to_incoming_transfer_transaction_with_address_info()
});

let expected = Transfer {
sender: AddressEx{
sender: AddressEx {
value: "0xfFfa5813ED9a5DB4880D7303DB7d0cBe41bC771F".to_string(),
name: Some("".to_string()),
logo_uri: None
logo_uri: None,
},
recipient: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
direction: TransferDirection::Incoming,
transfer_info: TransferInfo::Erc20(
Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
}
),
transfer_info: TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
}),
};

let actual = Erc20TransferDto::to_transfer_transaction(
Expand Down Expand Up @@ -122,22 +122,22 @@ async fn erc20_transfer_dto_to_outgoing_transfer_transaction_with_address_info()

let expected = Transfer {
sender: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
recipient: AddressEx{
recipient: AddressEx {
value: "0xfFfa5813ED9a5DB4880D7303DB7d0cBe41bC771F".to_string(),
name: Some("".to_string()),
logo_uri: None
logo_uri: None,
},
direction: TransferDirection::Outgoing,
transfer_info: TransferInfo::Erc20(
Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
}
),
transfer_info: TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
}),
};

let actual = Erc20TransferDto::to_transfer_transaction(
Expand All @@ -160,16 +160,16 @@ async fn erc20_transfer_dto_to_transfer_info_token_available() {
mock_info_provider.expect_safe_info().times(0);
mock_info_provider.expect_token_info().times(0);

let expected = TransferInfo::Erc20(
Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
}
);
let expected = TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
value: "1000000000000000000".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
});

let actual = Erc20TransferDto::to_transfer_info(&erc20_transfer, &mut mock_info_provider).await;

Expand Down Expand Up @@ -213,13 +213,15 @@ async fn erc20_transfer_dto_get_token_info_present() {
mock_info_provider.expect_safe_info().times(0);
mock_info_provider.expect_token_info().times(0);

let expected = TransferInfo::Erc20 (Erc20Transfer{
let expected = TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
value: "1000000000000000000".to_string()
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
value: "1000000000000000000".to_string(),
});
let actual = Erc20TransferDto::to_transfer_info(&erc20_transfer, &mut mock_info_provider).await;

Expand All @@ -240,13 +242,15 @@ async fn erc20_transfer_dto_get_token_info_not_present() {
.times(1)
.return_once(move |_| Ok(token_info));

let expected = TransferInfo::Erc20 (Erc20Transfer{
let expected = TransferInfo::Erc20(Erc20Transfer {
token_address: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa".to_string(),
token_name: Some("Dai".to_string()),
token_symbol: Some("DAI".to_string()),
decimals: Some(18),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string()),
value: "1000000000000000000".to_string()
logo_uri: Some(
"https://example.com/0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa.png".to_string(),
),
value: "1000000000000000000".to_string(),
});

let actual = Erc20TransferDto::to_transfer_info(&erc20_transfer, &mut mock_info_provider).await;
Expand Down
98 changes: 55 additions & 43 deletions src/common/converters/tests/transfer_erc721.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ async fn erc721_transfer_dto_to_incoming_transfer_transaction() {
sender: AddressEx::address_only("0x938bae50a210b80EA233112800Cd5Bc2e7644300"),
recipient: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
direction: TransferDirection::Incoming,
transfer_info: TransferInfo::Erc721(
Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string()),
}
),
transfer_info: TransferInfo::Erc721(Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
}),
};

let actual = Erc721TransferDto::to_transfer_transaction(
Expand Down Expand Up @@ -69,18 +69,22 @@ async fn erc721_transfer_dto_to_incoming_transfer_transaction_with_address_info(
});

let expected = Transfer {
sender: AddressEx { value: "0x938bae50a210b80EA233112800Cd5Bc2e7644300".to_string(), name: Some("".to_string()), logo_uri: None },
sender: AddressEx {
value: "0x938bae50a210b80EA233112800Cd5Bc2e7644300".to_string(),
name: Some("".to_string()),
logo_uri: None,
},
recipient: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
direction: TransferDirection::Incoming,
transfer_info: TransferInfo::Erc721(
Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string()),
}
),
transfer_info: TransferInfo::Erc721(Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
}),
};

let actual = Erc721TransferDto::to_transfer_transaction(
Expand Down Expand Up @@ -116,17 +120,21 @@ async fn erc721_transfer_dto_to_outgoing_transfer_transaction_with_address_info(

let expected = Transfer {
sender: AddressEx::address_only("0x1230B3d59858296A31053C1b8562Ecf89A2f888b"),
recipient: AddressEx{ value: "0x938bae50a210b80EA233112800Cd5Bc2e7644300".to_string(), name: Some("".to_string()), logo_uri: None },
recipient: AddressEx {
value: "0x938bae50a210b80EA233112800Cd5Bc2e7644300".to_string(),
name: Some("".to_string()),
logo_uri: None,
},
direction: TransferDirection::Outgoing,
transfer_info: TransferInfo::Erc721(
Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string()),
}
),
transfer_info: TransferInfo::Erc721(Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
}),
};

let actual = Erc721TransferDto::to_transfer_transaction(
Expand All @@ -149,15 +157,15 @@ async fn erc721_transfer_dto_to_transfer_info_token_available() {
mock_info_provider.expect_safe_info().times(0);
mock_info_provider.expect_token_info().times(0);

let expected = TransferInfo::Erc721(
Erc721Transfer {
token_id: "37".to_string(),
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string()),
}
);
let expected = TransferInfo::Erc721(Erc721Transfer {
token_id: "37".to_string(),
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
});

let actual =
Erc721TransferDto::to_transfer_info(&erc721_transfer, &mut mock_info_provider).await;
Expand Down Expand Up @@ -202,13 +210,15 @@ async fn erc721_transfer_dto_get_token_info_present() {
mock_info_provider.expect_safe_info().times(0);
mock_info_provider.expect_token_info().times(0);

let expected = TransferInfo::Erc721(Erc721Transfer{
let expected = TransferInfo::Erc721(Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string())
}) ;
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
});

let actual =
Erc721TransferDto::to_transfer_info(&erc721_transfer, &mut mock_info_provider).await;
Expand All @@ -231,12 +241,14 @@ async fn erc721_transfer_dto_get_token_info_not_present() {
.times(1)
.return_once(move |_| Ok(token_info));

let expected = TransferInfo::Erc721 (Erc721Transfer{
let expected = TransferInfo::Erc721(Erc721Transfer {
token_address: "0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98".to_string(),
token_id: "37".to_string(),
token_name: Some("PV Memorial Token".to_string()),
token_symbol: Some("PVT".to_string()),
logo_uri: Some("https://gnosis-safe-token-logos.s3.amazonaws.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string()),
logo_uri: Some(
"https://example.com/0x8979D84FF2c2B797dFEc02469d3a5322cBEf4b98.png".to_string(),
),
});

let actual =
Expand Down
Loading

0 comments on commit e6b35f2

Please sign in to comment.