Skip to content

Commit beae8c8

Browse files
committed
fix(ocp): correct owner cluster for account creation for new tokens
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 93ebd44 commit beae8c8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/flipcash/shared/onramp/deeplinks/src/main/kotlin/com/flipcash/app/onramp/internal/ExternalWalletDeeplinkState.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,9 @@ class ExternalWalletDeeplinkState(
378378
val amountToSend = requireNotNull(amount) { "Amount is null" }
379379
val transactionSignature = requireNotNull(signature) { "Transaction not signed" }
380380

381-
val tokenizedOwner = owner.withTimelockForToken(token)
382381
return withContext(NonCancellable) {
383382
transactionController.buy(
384-
owner = tokenizedOwner,
383+
owner = owner,
385384
amount = amountToSend,
386385
of = token,
387386
swapId = swapId,

services/opencode/src/main/kotlin/com/getcode/opencode/controllers/TransactionController.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,12 @@ class TransactionController @Inject constructor(
259259
fund: (suspend (SwapRequest) -> Result<Unit>)? = null,
260260
): Result<SwapId> {
261261
trace("Starting ${amount.nativeAmount.formatted()} buy of ${of.symbol}")
262+
val tokenizedOwner = owner.withTimelockForToken(of)
263+
262264
// create an account if we don't currently have one for this token
263265
val accountResult = if (!accountController.hasAccountFor(of.address)) {
264266
accountController.createUserAccount(
265-
ownerForMint = owner,
267+
ownerForMint = tokenizedOwner,
266268
mint = of.address
267269
)
268270
} else {

0 commit comments

Comments
 (0)