Skip to content

Commit 0735195

Browse files
committed
chore(appv2-movement): nix-fmt applied
Signed-off-by: Kaan Caglan <caglankaan@gmail.com>
1 parent 4d013bd commit 0735195

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

app2/src/lib/components/Transfer/index.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function getError(state: TransferStateUnion): string | null {
5757
switch (state._tag) {
5858
case "Empty":
5959
return null
60-
case "EVM":
61-
case "Aptos":
60+
case "EVM":
61+
case "Aptos":
6262
case "Cosmos": {
6363
const innerState = state.state
6464
if (innerState._tag === "Filling") return null
@@ -82,8 +82,8 @@ function getStepName(state: TransferStateUnion): string | null {
8282
switch (state._tag) {
8383
case "Empty":
8484
return null
85-
case "EVM":
86-
case "Aptos":
85+
case "EVM":
86+
case "Aptos":
8787
case "Cosmos":
8888
return state.state._tag
8989
}

app2/src/lib/components/Transfer/transfer.svelte.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
isComplete as isAptosComplete,
2828
nextState as aptosNextState,
2929
TransferSubmission as AptosTransferSubmission,
30-
SwitchChainState as AptosSwitchChainState,
3130
TransferReceiptState as AptosTransferReceiptState
3231
} from "$lib/services/transfer-ucs03-aptos"
3332
import { chains } from "$lib/stores/chains.svelte.ts"
@@ -87,7 +86,7 @@ export class Transfer {
8786
const sourceChainValue = this.sourceChain.value
8887
if (sourceChainValue.rpc_type === "evm") {
8988
return TransferState.EVM(EvmTransferSubmission.Filling())
90-
} else if(sourceChainValue.rpc_type === "aptos") {
89+
} else if (sourceChainValue.rpc_type === "aptos") {
9190
return TransferState.Aptos(AptosTransferSubmission.Filling())
9291
}
9392
return TransferState.Cosmos(CosmosTransferSubmission.Filling())
@@ -372,7 +371,7 @@ export class Transfer {
372371
currentEvmState = nextEvmState
373372
if (currentEvmState !== null && isEvmComplete(currentEvmState)) break
374373
}
375-
} else if(sourceChainValue.rpc_type === "cosmos") {
374+
} else if (sourceChainValue.rpc_type === "cosmos") {
376375
let cosmosState: CosmosTransferSubmission
377376
if (this.state._tag === "Cosmos") {
378377
// If failed, reset the failed step to InProgress
@@ -431,7 +430,7 @@ export class Transfer {
431430
console.info("this.state._tag is: ", this.state._tag)
432431
let aptosState: AptosTransferSubmission
433432
if (this.state._tag === "Aptos") {
434-
console.info("state._tag is aptos")
433+
console.info("state._tag is aptos")
435434
// If failed, reset the failed step to InProgress
436435
if (hasAptosFailedExit(this.state.state)) {
437436
switch (this.state.state._tag) {
@@ -463,7 +462,8 @@ export class Transfer {
463462
console.info("aptosState: ", aptosState)
464463

465464
const newState = await aptosNextState(aptosState, this.transferResult.args, sourceChainValue)
466-
this._stateOverride = newState !== null ? TransferState.Aptos(newState) : TransferState.Empty()
465+
this._stateOverride =
466+
newState !== null ? TransferState.Aptos(newState) : TransferState.Empty()
467467

468468
let currentaptosState = newState
469469
while (currentaptosState !== null && !hasAptosFailedExit(currentaptosState)) {

app2/src/lib/services/shared/address.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export const deriveReceiverEffect = (input: string) =>
1616
)
1717
}
1818

19-
if(isHexMovement(trimmed, { strict: true })) { // TODO: Do we need more verification like getAddress and so on?
19+
if (isHexMovement(trimmed, { strict: true })) {
20+
// TODO: Do we need more verification like getAddress and so on?
2021
return yield* Effect.try({
2122
try: () => trimmed,
2223
catch: err =>
@@ -36,7 +37,7 @@ export const deriveReceiverEffect = (input: string) =>
3637
cause: err
3738
})
3839
})
39-
}
40+
}
4041

4142
return yield* Effect.try({
4243
try: () => {
@@ -56,13 +57,12 @@ export const getDerivedReceiverSafe = (input: string): Option.Option<string> =>
5657
return result._tag === "Right" ? Option.some(result.right) : Option.none()
5758
}
5859

59-
6060
export function isHexMovement(
6161
value: unknown,
6262
{ strict = true }: { strict?: boolean } = {}
6363
): boolean {
64-
if (!value) return false;
65-
if (typeof value !== 'string') return false;
64+
if (!value) return false
65+
if (typeof value !== "string") return false
6666
// In strict mode, require a 0x prefix and exactly 64 hex characters after it.
67-
return strict ? /^0x[0-9a-fA-F]{64}$/.test(value) : value.startsWith('0x') && value.length === 66;
67+
return strict ? /^0x[0-9a-fA-F]{64}$/.test(value) : value.startsWith("0x") && value.length === 66
6868
}

app2/src/lib/services/transfer-ucs03-aptos/state.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Data, type Exit, type Effect } from "effect"
22
import type { Hash } from "viem"
33
import type { submitTransfer, waitForTransferReceipt } from "./transactions-aptos.ts"
4-
import type { switchChainA } from "./chain.ts"
54

65
type EffectToExit<T> = T extends Effect.Effect<infer A, infer E, any> ? Exit.Exit<A, E> : never
76

0 commit comments

Comments
 (0)