Skip to content

Commit 0911a75

Browse files
authored
Update USDF pushes to refer to wallet Cash Reserves (#7)
1 parent 7c7e23a commit 0911a75

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

geyser/integration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"github.com/code-payments/flipcash2-server/account"
99
"github.com/code-payments/flipcash2-server/push"
10-
ocp_geyser "github.com/code-payments/ocp-server/ocp/worker/geyser"
1110
ocp_common "github.com/code-payments/ocp-server/ocp/common"
11+
ocp_geyser "github.com/code-payments/ocp-server/ocp/worker/geyser"
1212
)
1313

1414
type Integration struct {
@@ -35,7 +35,7 @@ func (i *Integration) OnDepositReceived(ctx context.Context, owner, mint *ocp_co
3535
}
3636

3737
if ocp_common.IsCoreMint(mint) {
38-
return push.SendUsdcReceivedFromDepositPush(ctx, i.pusher, userID, usdMarketValue)
38+
return push.SendUsdfReceivedFromDepositPush(ctx, i.pusher, userID, usdMarketValue)
3939
}
4040
return push.SendFlipcashCurrencyReceivedFromDepositPush(ctx, i.pusher, userID, currencyName, usdMarketValue)
4141
}

push/pushes.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,41 @@ import (
1414
)
1515

1616
var (
17-
defaultLocale = language.English
18-
usdcAmountPrinter = message.NewPrinter(defaultLocale)
17+
defaultLocale = language.English
18+
amountPrinter = message.NewPrinter(defaultLocale)
1919
)
2020

21-
func SendUsdcReceivedFromDepositPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, usdMarketValue float64) error {
22-
title := "Cash Now Available"
23-
body := usdcAmountPrinter.Sprintf(
24-
"$%.2f was added to your Flipcash wallet",
21+
func SendUsdfReceivedFromDepositPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, usdMarketValue float64) error {
22+
title := "Cash Reserves Now Available"
23+
body := amountPrinter.Sprintf(
24+
"$%.2f of Cash Reserves was added to your Flipcash wallet",
2525
usdMarketValue,
2626
)
2727
return pusher.SendBasicPushes(ctx, title, body, user)
2828
}
2929

3030
func SendFlipcashCurrencyReceivedFromDepositPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, currencyName string, usdMarketValue float64) error {
3131
title := fmt.Sprintf("%s Now Available", currencyName)
32-
body := usdcAmountPrinter.Sprintf(
32+
body := amountPrinter.Sprintf(
3333
"$%.2f of %s was added to your Flipcash wallet",
3434
usdMarketValue,
3535
currencyName,
3636
)
3737
return pusher.SendBasicPushes(ctx, title, body, user)
3838
}
3939

40-
func SendUsdcReceivedFromSwapPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, region ocp_currency.Code, nativeAmount float64) error {
41-
title := "Cash Now Available"
42-
body := usdcAmountPrinter.Sprintf(
43-
"%s was added to your Flipcash wallet",
40+
func SendUsdfReceivedFromSwapPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, region ocp_currency.Code, nativeAmount float64) error {
41+
title := "Cash Reserves Now Available"
42+
body := amountPrinter.Sprintf(
43+
"%s of Cash Reserves was added to your Flipcash wallet",
4444
localization.FormatFiat(defaultLocale, region, nativeAmount),
4545
)
4646
return pusher.SendBasicPushes(ctx, title, body, user)
4747
}
4848

4949
func SendFlipcashCurrencyReceivedFromSwapPush(ctx context.Context, pusher Pusher, user *commonpb.UserId, currencyName string, region ocp_currency.Code, nativeAmount float64) error {
5050
title := fmt.Sprintf("%s Now Available", currencyName)
51-
body := usdcAmountPrinter.Sprintf(
51+
body := amountPrinter.Sprintf(
5252
"%s of %s was added to your Flipcash wallet",
5353
localization.FormatFiat(defaultLocale, region, nativeAmount),
5454
currencyName,

swap/integration.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77

88
"github.com/code-payments/flipcash2-server/account"
99
"github.com/code-payments/flipcash2-server/push"
10-
ocp_swap "github.com/code-payments/ocp-server/ocp/worker/swap"
11-
ocp_common "github.com/code-payments/ocp-server/ocp/common"
1210
ocp_currency "github.com/code-payments/ocp-server/currency"
11+
ocp_common "github.com/code-payments/ocp-server/ocp/common"
12+
ocp_swap "github.com/code-payments/ocp-server/ocp/worker/swap"
1313
)
1414

1515
type Integration struct {
@@ -31,7 +31,7 @@ func (i *Integration) OnSwapFinalized(ctx context.Context, owner, mint *ocp_comm
3131
}
3232

3333
if ocp_common.IsCoreMint(mint) {
34-
return push.SendUsdcReceivedFromSwapPush(ctx, i.pusher, userID, region, nativeAmount)
34+
return push.SendUsdfReceivedFromSwapPush(ctx, i.pusher, userID, region, nativeAmount)
3535
}
3636
return push.SendFlipcashCurrencyReceivedFromSwapPush(ctx, i.pusher, userID, currencyName, region, nativeAmount)
3737
}

0 commit comments

Comments
 (0)