Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-13 12:53:59 +04:00
parent 5ca696d677
commit 579b3cba32
27 changed files with 887 additions and 58 deletions

View file

@ -14,10 +14,12 @@ internal object PromoCampaignConverter {
campaign = campaign,
payoutTokens = all.tokens.orEmpty().map { token ->
PromoPayoutToken(
tokenId = token.tokenId,
tokenAddress = token.tokenAddress,
tokenSymbol = token.tokenSymbol,
tokenName = token.tokenName,
networkId = token.networkId,
decimals = token.decimals,
)
},
timeline = PromoTimeline(

View file

@ -54,7 +54,16 @@ internal class DefaultPromoRepositoryTest {
name = campaign.slug,
all = All(
timeline = Timeline("2026-06-23T00:00:00.000Z", "2026-08-31T20:59:59.000Z"),
tokens = listOf(PromoToken("0xToken", "USDT", "Tether USD", "ethereum")),
tokens = listOf(
PromoToken(
tokenId = "tether",
tokenAddress = "0xToken",
tokenSymbol = "USDT",
tokenName = "Tether USD",
networkId = "ethereum",
decimals = 6,
),
),
status = "active",
link = "",
),

View file

@ -18,7 +18,16 @@ internal class PromoCampaignConverterTest {
// Arrange
val all = All(
timeline = Timeline(start = "2026-06-23T00:00:00.000Z", end = "2026-08-31T20:59:59.000Z"),
tokens = listOf(PromoToken("0xdac1", "USDT", "Tether USD", "ethereum")),
tokens = listOf(
PromoToken(
tokenId = "tether",
tokenAddress = "0xdac1",
tokenSymbol = "USDT",
tokenName = "Tether USD",
networkId = "ethereum",
decimals = 6,
),
),
status = "active",
link = "",
)
@ -29,7 +38,14 @@ internal class PromoCampaignConverterTest {
// Assert
assertThat(result.campaign).isEqualTo(campaign)
assertThat(result.payoutTokens).containsExactly(
PromoPayoutToken("0xdac1", "USDT", "Tether USD", "ethereum"),
PromoPayoutToken(
tokenId = "tether",
tokenAddress = "0xdac1",
tokenSymbol = "USDT",
tokenName = "Tether USD",
networkId = "ethereum",
decimals = 6,
),
)
assertThat(result.timeline.start).isEqualTo(Instant.parse("2026-06-23T00:00:00.000Z"))
assertThat(result.timeline.end).isEqualTo(Instant.parse("2026-08-31T20:59:59.000Z"))