1
- import { assert , describe , it , expect } from "@effect/vitest"
1
+ import { assert , describe , it } from "@effect/vitest"
2
2
// TODO: fix mocking instancing
3
3
import { vi } from "vitest"
4
4
import { type Context , Effect , Exit , Layer } from "effect"
@@ -12,12 +12,11 @@ import {
12
12
createCosmosToEvmFungibleAssetOrder ,
13
13
createCosmosToCosmosFungibleAssetOrder
14
14
} from "../../src/ucs03/fungible-asset-order.js"
15
- import { toHex } from "viem"
16
15
import { ensureHex } from "@unionlabs/sdk/utils/index"
17
16
18
- vi . mock ( ' ../../src/graphql/unwrapped-quote-token.js' , async ( importOriginal ) => {
17
+ vi . mock ( " ../../src/graphql/unwrapped-quote-token.js" , async importOriginal => {
19
18
return {
20
- ...await importOriginal < typeof import ( ' ../../src/graphql/unwrapped-quote-token.js' ) > ( ) ,
19
+ ...( await importOriginal < typeof import ( " ../../src/graphql/unwrapped-quote-token.js" ) > ( ) ) ,
21
20
graphqlQuoteTokenUnwrapQuery : ( ) => Effect . succeed ( "0x12345" )
22
21
}
23
22
} )
@@ -100,7 +99,7 @@ const evmIntent = {
100
99
baseAmount : 1000000000000000000n , // 1 token with 18 decimals
101
100
quoteAmount : 500000000000000000n , // 0.5 token with 18 decimals
102
101
sourceChainId : "chainId" ,
103
- sourceChannelId : 999 ,
102
+ sourceChannelId : 999
104
103
} as const
105
104
106
105
const cosmosIntent = {
@@ -110,7 +109,7 @@ const cosmosIntent = {
110
109
baseAmount : BigInt ( 1000000 ) , // 1 token with 6 decimals
111
110
quoteAmount : BigInt ( 500000 ) , // 0.5 token with 6 decimals
112
111
sourceChainId : "chainId" ,
113
- sourceChannelId : 999 ,
112
+ sourceChannelId : 999
114
113
} as const
115
114
116
115
const EvmToEvm = Layer . mergeAll (
@@ -282,14 +281,18 @@ describe("Fungible Asset Order Tests", () => {
282
281
283
282
describe ( "Error handling" , ( ) => {
284
283
it . layer ( EvmToEvmError ) ( it => {
285
- it . effect ( "should handle errors when creating EVM to EVM fungible asset order with invalid input" , ( ) =>
286
- Effect . gen ( function * ( ) {
287
- const result = yield * Effect . exit ( createEvmToEvmFungibleAssetOrder ( {
288
- ...evmIntent ,
289
- sender : "nonHexSender"
290
- } as unknown as any ) )
291
- assert . isTrue ( Exit . isFailure ( result ) )
292
- } )
284
+ it . effect (
285
+ "should handle errors when creating EVM to EVM fungible asset order with invalid input" ,
286
+ ( ) =>
287
+ Effect . gen ( function * ( ) {
288
+ const result = yield * Effect . exit (
289
+ createEvmToEvmFungibleAssetOrder ( {
290
+ ...evmIntent ,
291
+ sender : "nonHexSender"
292
+ } as unknown as any )
293
+ )
294
+ assert . isTrue ( Exit . isFailure ( result ) )
295
+ } )
293
296
)
294
297
} )
295
298
0 commit comments