@xyo-network/chain-bridge 1.15.2 → 1.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/node/driver/indexer/ChainHydratedBlocksObservable.d.ts +4 -4
- package/dist/node/driver/indexer/ChainHydratedBlocksObservable.d.ts.map +1 -1
- package/dist/node/driver/mongo/MongoMap.d.ts +3 -2
- package/dist/node/driver/mongo/MongoMap.d.ts.map +1 -1
- package/dist/node/index.mjs +300 -683
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/interface/interface/IntentIndexerInterface.d.ts +5 -3
- package/dist/node/interface/interface/IntentIndexerInterface.d.ts.map +1 -1
- package/dist/node/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.d.ts +28 -0
- package/dist/node/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/ERC20TransferObserver/index.d.ts +2 -0
- package/dist/node/interface/service/Observer/ERC20TransferObserver/index.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/ERC20TransferObserver/spec/ERC20TransferObserver.spec.d.ts +2 -0
- package/dist/node/interface/service/Observer/ERC20TransferObserver/spec/ERC20TransferObserver.spec.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.d.ts +36 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/index.d.ts +2 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/index.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/spec/LiquidityPoolBridgeObserver.spec.d.ts +2 -0
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/spec/LiquidityPoolBridgeObserver.spec.d.ts.map +1 -0
- package/dist/node/interface/service/Observer/Observer.d.ts +1 -1
- package/dist/node/interface/service/Observer/Observer.d.ts.map +1 -1
- package/dist/node/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/ChainBridgeRelayInterface.d.ts +1 -1
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayInterface.d.ts.map +1 -0
- package/dist/node/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/ChainBridgeRelayService.d.ts +1 -1
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayService.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/ChainBridgeRelay/index.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/ChainBridgeRelay/spec/ChainBridgeRelayService.spec.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.d.ts +57 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/index.d.ts +2 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/index.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/spec/LiquidityPoolBridgeRelay.spec.d.ts +2 -0
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/spec/LiquidityPoolBridgeRelay.spec.d.ts.map +1 -0
- package/dist/node/interface/service/Relay/index.d.ts +2 -0
- package/dist/node/interface/service/Relay/index.d.ts.map +1 -0
- package/dist/node/interface/service/index.d.ts +1 -1
- package/dist/node/interface/service/index.d.ts.map +1 -1
- package/dist/node/manifest/getLocator.d.ts.map +1 -1
- package/dist/node/manifest/public/index.d.ts +6 -2
- package/dist/node/manifest/public/index.d.ts.map +1 -1
- package/dist/node/server/app.d.ts +1 -2
- package/dist/node/server/app.d.ts.map +1 -1
- package/dist/node/server/routes/addRoutes.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts +3 -0
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/index.d.ts +2 -0
- package/dist/node/server/routes/bridge/index.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/middleware/index.d.ts +2 -0
- package/dist/node/server/routes/bridge/middleware/index.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/middleware/requestHandlerValidator.d.ts +32 -0
- package/dist/node/server/routes/bridge/middleware/requestHandlerValidator.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts +3 -0
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/index.d.ts +2 -0
- package/dist/node/server/routes/bridge/routeDefinitions/index.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.d.ts +6 -0
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/index.d.ts +2 -0
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/index.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routeDefinition.d.ts +8 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routeDefinition.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts +3 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.d.ts +3 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.d.ts +3 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts +3 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/index.d.ts +5 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/index.d.ts.map +1 -0
- package/dist/node/server/routes/healthz/get.d.ts +2 -1
- package/dist/node/server/routes/healthz/get.d.ts.map +1 -1
- package/dist/node/server/routes/index.d.ts +0 -1
- package/dist/node/server/routes/index.d.ts.map +1 -1
- package/dist/node/server/server.d.ts.map +1 -1
- package/package.json +62 -55
- package/src/driver/indexer/ChainHydratedBlocksObservable.ts +5 -5
- package/src/driver/indexer/spec/ChainBlocksObservable.spec.ts +6 -3
- package/src/driver/indexer/spec/ChainHydratedBlocksObservable.spec.ts +10 -4
- package/src/driver/mongo/MongoMap.ts +13 -3
- package/src/interface/interface/IntentIndexerInterface.ts +5 -4
- package/src/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.ts +181 -0
- package/src/interface/service/Observer/ERC20TransferObserver/index.ts +1 -0
- package/src/interface/service/Observer/ERC20TransferObserver/spec/ERC20TransferObserver.spec.ts +271 -0
- package/src/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.ts +212 -0
- package/src/interface/service/Observer/LiquidityPoolBridgeObserver/index.ts +1 -0
- package/src/interface/service/Observer/LiquidityPoolBridgeObserver/spec/LiquidityPoolBridgeObserver.spec.ts +313 -0
- package/src/interface/service/Observer/Observer.ts +1 -1
- package/src/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/ChainBridgeRelayInterface.ts +1 -1
- package/src/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/ChainBridgeRelayService.ts +1 -1
- package/src/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/spec/ChainBridgeRelayService.spec.ts +7 -5
- package/src/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.ts +227 -0
- package/src/interface/service/Relay/LiquidityPoolBridgeRelay/index.ts +1 -0
- package/src/interface/service/Relay/LiquidityPoolBridgeRelay/spec/LiquidityPoolBridgeRelay.spec.ts +237 -0
- package/src/interface/service/Relay/index.ts +1 -0
- package/src/interface/service/index.ts +1 -1
- package/src/manifest/getLocator.ts +7 -6
- package/src/manifest/node.json +1 -1
- package/src/manifest/public/Chain.json +3 -109
- package/src/manifest/public/Ethereum.json +88 -0
- package/src/manifest/public/XL1.json +88 -0
- package/src/manifest/public/index.ts +15 -6
- package/src/server/app.ts +5 -12
- package/src/server/routes/addRoutes.ts +2 -6
- package/src/server/routes/bridge/addBridgeRoutes.ts +10 -0
- package/src/server/routes/bridge/index.ts +1 -0
- package/src/server/routes/bridge/middleware/index.ts +1 -0
- package/src/server/routes/bridge/middleware/requestHandlerValidator.ts +120 -0
- package/src/server/routes/bridge/routeDefinitions/getRouteDefinitions.ts +13 -0
- package/src/server/routes/bridge/routeDefinitions/index.ts +1 -0
- package/src/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.ts +18 -0
- package/src/server/routes/bridge/routeDefinitions/pathParams/index.ts +1 -0
- package/src/server/routes/bridge/routeDefinitions/routeDefinition.ts +18 -0
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.ts +55 -0
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.ts +58 -0
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.ts +83 -0
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts +55 -0
- package/src/server/routes/bridge/routeDefinitions/routes/index.ts +4 -0
- package/src/server/routes/healthz/get.ts +1 -1
- package/src/server/routes/index.ts +0 -2
- package/src/server/server.ts +11 -14
- package/dist/node/interface/service/ChainBridgeRelay/ChainBridgeRelayInterface.d.ts.map +0 -1
- package/dist/node/interface/service/ChainBridgeRelay/ChainBridgeRelayService.d.ts.map +0 -1
- package/dist/node/interface/service/ChainBridgeRelay/index.d.ts.map +0 -1
- package/dist/node/interface/service/ChainBridgeRelay/spec/ChainBridgeRelayService.spec.d.ts.map +0 -1
- package/dist/node/server/routes/rpc/index.d.ts +0 -2
- package/dist/node/server/routes/rpc/index.d.ts.map +0 -1
- package/dist/node/server/routes/rpc/routes/addRpcRoutes.d.ts +0 -3
- package/dist/node/server/routes/rpc/routes/addRpcRoutes.d.ts.map +0 -1
- package/dist/node/server/routes/rpc/routes/index.d.ts +0 -2
- package/dist/node/server/routes/rpc/routes/index.d.ts.map +0 -1
- package/src/manifest/public/Pending.json +0 -35
- package/src/server/routes/rpc/index.ts +0 -1
- package/src/server/routes/rpc/routes/addRpcRoutes.ts +0 -22
- package/src/server/routes/rpc/routes/index.ts +0 -1
- /package/dist/node/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/index.d.ts +0 -0
- /package/dist/node/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/spec/ChainBridgeRelayService.spec.d.ts +0 -0
- /package/src/interface/service/{ChainBridgeRelay → Relay/ChainBridgeRelay}/index.ts +0 -0
package/src/interface/service/Relay/LiquidityPoolBridgeRelay/spec/LiquidityPoolBridgeRelay.spec.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { assertEx } from '@xylabs/assert'
|
|
2
|
+
import type { Address } from '@xylabs/hex'
|
|
3
|
+
import { toAddress, toHex } from '@xylabs/hex'
|
|
4
|
+
import { Account } from '@xyo-network/account'
|
|
5
|
+
import type { AccountInstance } from '@xyo-network/account-model'
|
|
6
|
+
import {
|
|
7
|
+
type BridgeableToken, BridgeableToken__factory, type LiquidityPoolBridge, LiquidityPoolBridge__factory,
|
|
8
|
+
} from '@xyo-network/typechain'
|
|
9
|
+
import type {
|
|
10
|
+
BridgeIntent, BridgeSourceObservation, ChainId,
|
|
11
|
+
} from '@xyo-network/xl1-protocol'
|
|
12
|
+
import {
|
|
13
|
+
AttoXL1ConvertFactor, BridgeIntentSchema, BridgeSourceObservationSchema,
|
|
14
|
+
} from '@xyo-network/xl1-protocol'
|
|
15
|
+
import type { Config } from '@xyo-network/xl1-protocol-sdk'
|
|
16
|
+
import { getDefaultConfig } from '@xyo-network/xl1-protocol-sdk'
|
|
17
|
+
import {
|
|
18
|
+
parseEther, Wallet, WebSocketProvider,
|
|
19
|
+
} from 'ethers'
|
|
20
|
+
import {
|
|
21
|
+
beforeAll, beforeEach, describe, expect, it, vi,
|
|
22
|
+
} from 'vitest'
|
|
23
|
+
|
|
24
|
+
import type {
|
|
25
|
+
BridgeDestinationObservationIndexerInterface, BridgeIntentIndexerInterface, BridgeSourceObservationIndexerInterface, ChainBridgeRelayInterface,
|
|
26
|
+
LockingBridgeIntentProcessorInterface, UnlockingBridgeIntentProcessorInterface,
|
|
27
|
+
} from '../../../../interface/index.ts'
|
|
28
|
+
import type { LiquidityPoolBridgeRelayParams } from '../LiquidityPoolBridgeRelay.ts'
|
|
29
|
+
import { LiquidityPoolBridgeRelay } from '../LiquidityPoolBridgeRelay.ts'
|
|
30
|
+
|
|
31
|
+
describe.skip('LiquidityPoolBridgeRelay', () => {
|
|
32
|
+
// Test ERC-20 deployed to Hardhat local chain
|
|
33
|
+
const TOKEN_ADDRESS = '0x5FbDB2315678afecb367f032d93F642f64180aa3'
|
|
34
|
+
const bridgeAddress = '0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f'
|
|
35
|
+
const WS_URL = 'ws://127.0.0.1:8545'
|
|
36
|
+
const provider = new WebSocketProvider(WS_URL)
|
|
37
|
+
let ethBridgeSender: Wallet
|
|
38
|
+
let ethBridgeReceiver: Wallet
|
|
39
|
+
let token: BridgeableToken
|
|
40
|
+
let bridge: LiquidityPoolBridge
|
|
41
|
+
let xl1Address: Address
|
|
42
|
+
let account: AccountInstance
|
|
43
|
+
let config: Config
|
|
44
|
+
let destinationObservations: BridgeDestinationObservationIndexerInterface
|
|
45
|
+
let destinationRelay: ChainBridgeRelayInterface
|
|
46
|
+
let intentProcessed: LockingBridgeIntentProcessorInterface
|
|
47
|
+
let intentProcessing: UnlockingBridgeIntentProcessorInterface
|
|
48
|
+
let intents: BridgeIntentIndexerInterface
|
|
49
|
+
let sourceObservations: BridgeSourceObservationIndexerInterface
|
|
50
|
+
let relay: LiquidityPoolBridgeRelay
|
|
51
|
+
let intent: BridgeIntent
|
|
52
|
+
let srcObservation: BridgeSourceObservation
|
|
53
|
+
|
|
54
|
+
const xl1ChainId: ChainId = toAddress('0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9')
|
|
55
|
+
const xl1TxHash = toHex('0x4444444444444444444444444444444444444444444444444444444444444444') // Some XL1 tx hash
|
|
56
|
+
const srcAmountBigint = 100n * AttoXL1ConvertFactor.xl1
|
|
57
|
+
const srcAmount = toHex(srcAmountBigint)
|
|
58
|
+
const destAmount = srcAmount // 1:1 for test
|
|
59
|
+
const ethChainId = toHex('0x7A69')
|
|
60
|
+
const bridgeableTokenContract = toHex(TOKEN_ADDRESS)
|
|
61
|
+
|
|
62
|
+
const createRandomWallet = async (): Promise<Wallet> => {
|
|
63
|
+
// Create random account
|
|
64
|
+
const account = await Account.random()
|
|
65
|
+
expect(account.private?.hex).toBeDefined()
|
|
66
|
+
const key = assertEx(account.private?.hex)
|
|
67
|
+
|
|
68
|
+
// Create a wallet from the private key
|
|
69
|
+
const wallet = new Wallet(key, provider)
|
|
70
|
+
const deployer = await provider.getSigner(0)
|
|
71
|
+
|
|
72
|
+
// Fund the wallet with some ETH for gas
|
|
73
|
+
const fundTx = await deployer.sendTransaction({ to: wallet.address, value: parseEther('1') })
|
|
74
|
+
await fundTx.wait()
|
|
75
|
+
|
|
76
|
+
// Ensure wallet has ETH
|
|
77
|
+
const balance = await provider.getBalance(wallet.address)
|
|
78
|
+
expect(balance).toBeGreaterThan(0n)
|
|
79
|
+
|
|
80
|
+
// Return the created wallet
|
|
81
|
+
return wallet
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
beforeAll(async () => {
|
|
85
|
+
account = await Account.fromPrivateKey('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80')
|
|
86
|
+
config = getDefaultConfig()
|
|
87
|
+
const deployer = await provider.getSigner(0)
|
|
88
|
+
ethBridgeSender = await createRandomWallet()
|
|
89
|
+
|
|
90
|
+
token = BridgeableToken__factory.connect(TOKEN_ADDRESS, deployer)
|
|
91
|
+
bridge = LiquidityPoolBridge__factory.connect(bridgeAddress, deployer)
|
|
92
|
+
const owner = await bridge.owner()
|
|
93
|
+
expect(owner).toBeDefined()
|
|
94
|
+
expect(owner).to.eq(deployer.address)
|
|
95
|
+
const amount = srcAmountBigint * 2n
|
|
96
|
+
await token.mint(await bridge.getAddress(), parseEther(amount.toString()))
|
|
97
|
+
expect(await token.balanceOf(await bridge.getAddress())).toBeGreaterThanOrEqual(amount)
|
|
98
|
+
await token.mint(ethBridgeSender.address, parseEther(amount.toString()))
|
|
99
|
+
expect(await token.balanceOf(ethBridgeSender.address)).toBeGreaterThanOrEqual(amount)
|
|
100
|
+
|
|
101
|
+
intents = {
|
|
102
|
+
addIntent: vi.fn().mockResolvedValue(true),
|
|
103
|
+
getIntentByNonce: vi.fn(),
|
|
104
|
+
getIntentsForDestination: vi.fn().mockResolvedValue([]),
|
|
105
|
+
getIntentsForSource: vi.fn().mockResolvedValue([]),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
sourceObservations = {
|
|
109
|
+
addObservation: vi.fn().mockResolvedValue(true),
|
|
110
|
+
getIntentForObservation: vi.fn().mockResolvedValue(null),
|
|
111
|
+
getObservationForIntent: vi.fn().mockResolvedValue(null),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
destinationObservations = {
|
|
115
|
+
addObservation: vi.fn().mockResolvedValue(true),
|
|
116
|
+
getIntentForObservation: vi.fn().mockResolvedValue(null),
|
|
117
|
+
getObservationForIntent: vi.fn().mockResolvedValue(null),
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
intentProcessed = {
|
|
121
|
+
isLocked: vi.fn().mockResolvedValue(null),
|
|
122
|
+
lock: vi.fn().mockResolvedValue(true),
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
intentProcessing = {
|
|
126
|
+
isLocked: vi.fn().mockResolvedValue(null),
|
|
127
|
+
lock: vi.fn().mockResolvedValue(true),
|
|
128
|
+
unlock: vi.fn().mockResolvedValue(true),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
destinationRelay = {
|
|
132
|
+
beginRelay: vi.fn().mockResolvedValue(true),
|
|
133
|
+
relaySync: vi.fn().mockResolvedValue(null),
|
|
134
|
+
onDestinationObservation: vi.fn().mockResolvedValue(false),
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
describe('relaySync', () => {
|
|
138
|
+
beforeEach(async () => {
|
|
139
|
+
xl1Address = (await Account.random()).address
|
|
140
|
+
ethBridgeReceiver = await createRandomWallet()
|
|
141
|
+
sourceObservations = {
|
|
142
|
+
addObservation: vi.fn().mockResolvedValue(true),
|
|
143
|
+
getObservationForIntent: vi.fn().mockResolvedValue(null),
|
|
144
|
+
getIntentForObservation: vi.fn().mockResolvedValue(null),
|
|
145
|
+
}
|
|
146
|
+
destinationObservations = {
|
|
147
|
+
addObservation: vi.fn().mockResolvedValue(true),
|
|
148
|
+
getObservationForIntent: vi.fn().mockResolvedValue(null),
|
|
149
|
+
getIntentForObservation: vi.fn().mockResolvedValue(null),
|
|
150
|
+
}
|
|
151
|
+
const nonce = Date.now().toString()
|
|
152
|
+
intent = {
|
|
153
|
+
// Source
|
|
154
|
+
src: xl1ChainId, // From XL1
|
|
155
|
+
srcAddress: xl1Address, // From XL1 sender
|
|
156
|
+
srcAmount,
|
|
157
|
+
srcToken: xl1ChainId, // In XL1
|
|
158
|
+
|
|
159
|
+
// Destination
|
|
160
|
+
dest: ethChainId, // To Ethereum
|
|
161
|
+
destAddress: toAddress(ethBridgeReceiver.address),
|
|
162
|
+
destAmount,
|
|
163
|
+
destToken: bridgeableTokenContract,
|
|
164
|
+
|
|
165
|
+
// Details
|
|
166
|
+
nonce,
|
|
167
|
+
|
|
168
|
+
schema: BridgeIntentSchema,
|
|
169
|
+
}
|
|
170
|
+
srcObservation = {
|
|
171
|
+
// Source
|
|
172
|
+
src: xl1ChainId, // From XL1
|
|
173
|
+
srcAddress: xl1Address, // From XL1 sender
|
|
174
|
+
srcAmount,
|
|
175
|
+
srcToken: xl1ChainId, // In XL1
|
|
176
|
+
|
|
177
|
+
// Destination
|
|
178
|
+
dest: ethChainId, // To Ethereum
|
|
179
|
+
destAddress: toAddress(ethBridgeReceiver.address),
|
|
180
|
+
destAmount,
|
|
181
|
+
destToken: bridgeableTokenContract,
|
|
182
|
+
|
|
183
|
+
// Observation
|
|
184
|
+
srcConfirmation: xl1TxHash,
|
|
185
|
+
|
|
186
|
+
schema: BridgeSourceObservationSchema,
|
|
187
|
+
}
|
|
188
|
+
intents = {
|
|
189
|
+
addIntent: vi.fn().mockResolvedValue(true),
|
|
190
|
+
getIntentByNonce: vi.fn().mockResolvedValue(intent),
|
|
191
|
+
getIntentsForDestination: vi.fn().mockResolvedValue([intent]),
|
|
192
|
+
getIntentsForSource: vi.fn().mockResolvedValue([]),
|
|
193
|
+
}
|
|
194
|
+
const params: LiquidityPoolBridgeRelayParams = {
|
|
195
|
+
account,
|
|
196
|
+
config,
|
|
197
|
+
bridgeAddress,
|
|
198
|
+
provider,
|
|
199
|
+
destinationObservations,
|
|
200
|
+
destinationRelay,
|
|
201
|
+
intentProcessed,
|
|
202
|
+
intentProcessing,
|
|
203
|
+
intents,
|
|
204
|
+
sourceObservations,
|
|
205
|
+
}
|
|
206
|
+
relay = await LiquidityPoolBridgeRelay.create(params)
|
|
207
|
+
})
|
|
208
|
+
it('should do nothing if source observation is null', async () => {
|
|
209
|
+
// Arrange
|
|
210
|
+
sourceObservations.getObservationForIntent = vi.fn().mockResolvedValue(null)
|
|
211
|
+
intentProcessing.lock = vi.fn().mockResolvedValue(true)
|
|
212
|
+
intentProcessing.unlock = vi.fn()
|
|
213
|
+
|
|
214
|
+
// Act
|
|
215
|
+
const result = await relay.relaySync(intent)
|
|
216
|
+
|
|
217
|
+
// Assert
|
|
218
|
+
expect(intentProcessing.lock).not.toHaveBeenCalled()
|
|
219
|
+
expect(result).toBe(null)
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
it('should lock and call destinationRelay.beginRelay if observation exists', async () => {
|
|
223
|
+
// Arrange
|
|
224
|
+
sourceObservations.getObservationForIntent = vi.fn().mockResolvedValue(srcObservation)
|
|
225
|
+
intentProcessing.lock = vi.fn().mockResolvedValue(true)
|
|
226
|
+
intentProcessing.unlock = vi.fn()
|
|
227
|
+
|
|
228
|
+
// Act
|
|
229
|
+
const result = await relay.relaySync(intent)
|
|
230
|
+
|
|
231
|
+
// Assert
|
|
232
|
+
expect(sourceObservations.getObservationForIntent).toHaveBeenCalledWith(intent)
|
|
233
|
+
expect(intentProcessing.lock).toHaveBeenCalledWith(account.address, intent)
|
|
234
|
+
expect(result).not.toBe(null)
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChainBridgeRelay/index.ts'
|
|
@@ -8,16 +8,18 @@ import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
|
8
8
|
import { MongoDBArchivistV2 } from '@xyo-network/archivist-mongodb'
|
|
9
9
|
import { ViewArchivist } from '@xyo-network/archivist-view'
|
|
10
10
|
import {
|
|
11
|
-
AddressBalanceDivinerV2, ArchivistSyncDiviner,
|
|
11
|
+
AddressBalanceDivinerV2, ArchivistSyncDiviner, HeadValidationDiviner,
|
|
12
12
|
} from '@xyo-network/chain-modules'
|
|
13
|
-
import
|
|
13
|
+
import { MemoryMap } from '@xyo-network/chain-protocol'
|
|
14
14
|
import { initTelemetry } from '@xyo-network/chain-telemetry'
|
|
15
15
|
import { AbstractModule, LoggerModuleStatusReporter } from '@xyo-network/module-abstract'
|
|
16
16
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
17
17
|
import type { MongoDBModuleParamsV2 } from '@xyo-network/module-model-mongodb'
|
|
18
18
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
19
19
|
import { MemorySentinel } from '@xyo-network/sentinel-memory'
|
|
20
|
-
import type {
|
|
20
|
+
import type {
|
|
21
|
+
BalancesStepSummary, Config, MapType,
|
|
22
|
+
} from '@xyo-network/xl1-protocol-sdk'
|
|
21
23
|
import { hasMongoConfig } from '@xyo-network/xl1-protocol-sdk'
|
|
22
24
|
|
|
23
25
|
import { MongoMap } from '../driver/index.ts'
|
|
@@ -52,7 +54,7 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
52
54
|
|
|
53
55
|
const locator = new ModuleFactoryLocator()
|
|
54
56
|
// Initialize with an in-memory map for backing the summary repository
|
|
55
|
-
let summaryMap: MapType<Hash, WithStorageMeta<BalancesStepSummary>> = new
|
|
57
|
+
let summaryMap: MapType<Hash, WithStorageMeta<BalancesStepSummary>> = new MemoryMap<Hash, WithStorageMeta<BalancesStepSummary>>()
|
|
56
58
|
// If there's a MongoDB configuration
|
|
57
59
|
const mongoConfig = config.storage?.mongo
|
|
58
60
|
if (hasMongoConfig(mongoConfig)) {
|
|
@@ -74,9 +76,8 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
74
76
|
summaryMap = await MongoMap.create<MongoMap<Hash, WithStorageMeta<BalancesStepSummary>>>({ sdk })
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
const summaryRepository = balanceSummaryRepositoryFromMap(summaryMap)
|
|
78
79
|
locator.register(AddressBalanceDivinerV2.factory<AddressBalanceDivinerV2>({
|
|
79
|
-
traceProvider, meterProvider, statusReporter,
|
|
80
|
+
traceProvider, meterProvider, statusReporter, summaryMap,
|
|
80
81
|
}))
|
|
81
82
|
|
|
82
83
|
const chainId = isDefined(config.chain.id)
|
package/src/manifest/node.json
CHANGED
|
@@ -8,127 +8,21 @@
|
|
|
8
8
|
"schema": "network.xyo.node.config"
|
|
9
9
|
},
|
|
10
10
|
"modules": {
|
|
11
|
-
"private": [
|
|
12
|
-
{
|
|
13
|
-
"config": {
|
|
14
|
-
"accountPath": "1/1'/1'",
|
|
15
|
-
"name": "Validated",
|
|
16
|
-
"getCache": {
|
|
17
|
-
"enabled": true,
|
|
18
|
-
"maxEntries": 5000
|
|
19
|
-
},
|
|
20
|
-
"payloadSdkConfig": {
|
|
21
|
-
"collection": "chain_validated"
|
|
22
|
-
},
|
|
23
|
-
"schema": "network.xyo.archivist.config"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"config": {
|
|
28
|
-
"accountPath": "1/1'/2'",
|
|
29
|
-
"schema": "network.xyo.diviner.chain.head.validation.config",
|
|
30
|
-
"eventSubscriptions": [
|
|
31
|
-
{
|
|
32
|
-
"sourceEvent": "inserted",
|
|
33
|
-
"sourceModule": "Chain:Submissions",
|
|
34
|
-
"targetModuleFunction": "divine"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"inArchivist": "Chain:Submissions",
|
|
38
|
-
"outArchivist": "Chain:Validated",
|
|
39
|
-
"name": "HeadValidationDiviner"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"config": {
|
|
44
|
-
"accountPath": "1/1'/3'",
|
|
45
|
-
"automations": [
|
|
46
|
-
{
|
|
47
|
-
"frequency": 1000,
|
|
48
|
-
"frequencyUnits": "millis",
|
|
49
|
-
"schema": "network.xyo.automation.interval",
|
|
50
|
-
"type": "interval"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"name": "ChainValidationSentinel",
|
|
54
|
-
"schema": "network.xyo.sentinel.config",
|
|
55
|
-
"synchronous": true,
|
|
56
|
-
"tasks": [
|
|
57
|
-
{
|
|
58
|
-
"mod": "HeadValidationDiviner",
|
|
59
|
-
"endPoint": "divine"
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"config": {
|
|
66
|
-
"accountPath": "1/1'/4'",
|
|
67
|
-
"automations": [
|
|
68
|
-
{
|
|
69
|
-
"frequency": 60000,
|
|
70
|
-
"frequencyUnits": "millis",
|
|
71
|
-
"schema": "network.xyo.automation.interval",
|
|
72
|
-
"type": "interval"
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"name": "AddressBalancePollingSentinel",
|
|
76
|
-
"schema": "network.xyo.sentinel.config",
|
|
77
|
-
"synchronous": true,
|
|
78
|
-
"tasks": [
|
|
79
|
-
{
|
|
80
|
-
"mod": "AddressBalanceDiviner",
|
|
81
|
-
"endPoint": "divine"
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
],
|
|
11
|
+
"private": [],
|
|
87
12
|
"public": [
|
|
88
13
|
{
|
|
89
14
|
"config": {
|
|
90
15
|
"accountPath": "1/1/1",
|
|
91
|
-
"name": "
|
|
16
|
+
"name": "Finalized",
|
|
92
17
|
"getCache": {
|
|
93
18
|
"enabled": true,
|
|
94
19
|
"maxEntries": 5000
|
|
95
20
|
},
|
|
96
21
|
"payloadSdkConfig": {
|
|
97
|
-
"collection": "
|
|
22
|
+
"collection": "chain_validated"
|
|
98
23
|
},
|
|
99
24
|
"schema": "network.xyo.archivist.config"
|
|
100
25
|
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"config": {
|
|
104
|
-
"accountPath": "1/1/2",
|
|
105
|
-
"name": "Finalized",
|
|
106
|
-
"allowedQueries": [
|
|
107
|
-
"network.xyo.query.archivist.get",
|
|
108
|
-
"network.xyo.query.archivist.next"
|
|
109
|
-
],
|
|
110
|
-
"getCache": {
|
|
111
|
-
"enabled": true,
|
|
112
|
-
"maxEntries": 5000
|
|
113
|
-
},
|
|
114
|
-
"originArchivist": "Chain:Validated",
|
|
115
|
-
"schema": "network.xyo.archivist.view.config"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"config": {
|
|
120
|
-
"accountPath": "1/1/3",
|
|
121
|
-
"schema": "network.xyo.diviner.chain.address.balance.config",
|
|
122
|
-
"archivist": "Chain:Validated",
|
|
123
|
-
"name": "AddressBalanceDiviner",
|
|
124
|
-
"eventSubscriptions": [
|
|
125
|
-
{
|
|
126
|
-
"sourceEvent": "inserted",
|
|
127
|
-
"sourceModule": "Chain:Validated",
|
|
128
|
-
"targetModuleFunction": "divine"
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
26
|
}
|
|
133
27
|
]
|
|
134
28
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{
|
|
5
|
+
"config": {
|
|
6
|
+
"accountPath": "3",
|
|
7
|
+
"name": "Ethereum",
|
|
8
|
+
"schema": "network.xyo.node.config"
|
|
9
|
+
},
|
|
10
|
+
"modules": {
|
|
11
|
+
"private": [
|
|
12
|
+
{
|
|
13
|
+
"config": {
|
|
14
|
+
"accountPath": "1/1'/1'",
|
|
15
|
+
"name": "BridgeIntent",
|
|
16
|
+
"getCache": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"maxEntries": 5000
|
|
19
|
+
},
|
|
20
|
+
"payloadSdkConfig": {
|
|
21
|
+
"collection": "chain_bridge_intents"
|
|
22
|
+
},
|
|
23
|
+
"schema": "network.xyo.archivist.config"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"config": {
|
|
28
|
+
"accountPath": "1/1'/2'",
|
|
29
|
+
"name": "BridgeSourceObservation",
|
|
30
|
+
"getCache": {
|
|
31
|
+
"enabled": true,
|
|
32
|
+
"maxEntries": 5000
|
|
33
|
+
},
|
|
34
|
+
"payloadSdkConfig": {
|
|
35
|
+
"collection": "chain_bridge_intents"
|
|
36
|
+
},
|
|
37
|
+
"schema": "network.xyo.archivist.config"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"config": {
|
|
42
|
+
"accountPath": "1/1'/3'",
|
|
43
|
+
"name": "BridgeDestinationObservation",
|
|
44
|
+
"getCache": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"maxEntries": 5000
|
|
47
|
+
},
|
|
48
|
+
"payloadSdkConfig": {
|
|
49
|
+
"collection": "chain_bridge_intents"
|
|
50
|
+
},
|
|
51
|
+
"schema": "network.xyo.archivist.config"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"config": {
|
|
56
|
+
"accountPath": "1/1'/4'",
|
|
57
|
+
"name": "BridgeIntentProcessing",
|
|
58
|
+
"getCache": {
|
|
59
|
+
"enabled": true,
|
|
60
|
+
"maxEntries": 5000
|
|
61
|
+
},
|
|
62
|
+
"payloadSdkConfig": {
|
|
63
|
+
"collection": "chain_bridge_intents"
|
|
64
|
+
},
|
|
65
|
+
"schema": "network.xyo.archivist.config"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"config": {
|
|
70
|
+
"accountPath": "1/1'/5'",
|
|
71
|
+
"name": "BridgeIntentProcessed",
|
|
72
|
+
"getCache": {
|
|
73
|
+
"enabled": true,
|
|
74
|
+
"maxEntries": 5000
|
|
75
|
+
},
|
|
76
|
+
"payloadSdkConfig": {
|
|
77
|
+
"collection": "chain_bridge_intents"
|
|
78
|
+
},
|
|
79
|
+
"schema": "network.xyo.archivist.config"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"public": []
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"schema": "network.xyo.manifest"
|
|
88
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{
|
|
5
|
+
"config": {
|
|
6
|
+
"accountPath": "2",
|
|
7
|
+
"name": "XL1",
|
|
8
|
+
"schema": "network.xyo.node.config"
|
|
9
|
+
},
|
|
10
|
+
"modules": {
|
|
11
|
+
"private": [
|
|
12
|
+
{
|
|
13
|
+
"config": {
|
|
14
|
+
"accountPath": "1/1'/1'",
|
|
15
|
+
"name": "BridgeIntent",
|
|
16
|
+
"getCache": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"maxEntries": 5000
|
|
19
|
+
},
|
|
20
|
+
"payloadSdkConfig": {
|
|
21
|
+
"collection": "chain_bridge_intents"
|
|
22
|
+
},
|
|
23
|
+
"schema": "network.xyo.archivist.config"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"config": {
|
|
28
|
+
"accountPath": "1/1'/2'",
|
|
29
|
+
"name": "BridgeSourceObservation",
|
|
30
|
+
"getCache": {
|
|
31
|
+
"enabled": true,
|
|
32
|
+
"maxEntries": 5000
|
|
33
|
+
},
|
|
34
|
+
"payloadSdkConfig": {
|
|
35
|
+
"collection": "chain_bridge_intents"
|
|
36
|
+
},
|
|
37
|
+
"schema": "network.xyo.archivist.config"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"config": {
|
|
42
|
+
"accountPath": "1/1'/3'",
|
|
43
|
+
"name": "BridgeDestinationObservation",
|
|
44
|
+
"getCache": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"maxEntries": 5000
|
|
47
|
+
},
|
|
48
|
+
"payloadSdkConfig": {
|
|
49
|
+
"collection": "chain_bridge_intents"
|
|
50
|
+
},
|
|
51
|
+
"schema": "network.xyo.archivist.config"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"config": {
|
|
56
|
+
"accountPath": "1/1'/4'",
|
|
57
|
+
"name": "BridgeIntentProcessing",
|
|
58
|
+
"getCache": {
|
|
59
|
+
"enabled": true,
|
|
60
|
+
"maxEntries": 5000
|
|
61
|
+
},
|
|
62
|
+
"payloadSdkConfig": {
|
|
63
|
+
"collection": "chain_bridge_intents"
|
|
64
|
+
},
|
|
65
|
+
"schema": "network.xyo.archivist.config"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"config": {
|
|
70
|
+
"accountPath": "1/1'/5'",
|
|
71
|
+
"name": "BridgeIntentProcessed",
|
|
72
|
+
"getCache": {
|
|
73
|
+
"enabled": true,
|
|
74
|
+
"maxEntries": 5000
|
|
75
|
+
},
|
|
76
|
+
"payloadSdkConfig": {
|
|
77
|
+
"collection": "chain_bridge_intents"
|
|
78
|
+
},
|
|
79
|
+
"schema": "network.xyo.archivist.config"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"public": []
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"schema": "network.xyo.manifest"
|
|
88
|
+
}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/manifest-model'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import ChainNode from './Chain.json' with { type: 'json' }
|
|
4
|
+
import XL1Node from './XL1.json' with { type: 'json' }
|
|
5
|
+
import EthereumNode from './Ethereum.json' with { type: 'json' }
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Chain Node Manifest
|
|
8
9
|
*/
|
|
9
|
-
export const ChainNodeManifest =
|
|
10
|
+
export const ChainNodeManifest = ChainNode as PackageManifestPayload
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* XL1 Node Manifest
|
|
12
14
|
*/
|
|
13
|
-
export const
|
|
15
|
+
export const XL1NodeManifest = XL1Node as PackageManifestPayload
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Ethereum Node Manifest
|
|
19
|
+
*/
|
|
20
|
+
export const EthereumNodeManifest = EthereumNode as PackageManifestPayload
|
|
21
|
+
|
|
14
22
|
/**
|
|
15
23
|
* Public Child Manifests
|
|
16
24
|
*/
|
|
17
25
|
export const PublicChildManifests: ModuleManifest[] = [
|
|
18
26
|
...ChainNodeManifest.nodes,
|
|
19
|
-
...
|
|
27
|
+
...XL1NodeManifest.nodes,
|
|
28
|
+
...EthereumNodeManifest.nodes,
|
|
20
29
|
]
|
package/src/server/app.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
customPoweredByHeader,
|
|
3
|
-
|
|
4
|
-
disableExpressDefaultPoweredByHeader,
|
|
5
|
-
getJsonBodyParser,
|
|
6
|
-
getJsonBodyParserOptions,
|
|
7
|
-
responseProfiler,
|
|
8
|
-
standardErrors,
|
|
9
|
-
standardResponses,
|
|
2
|
+
customPoweredByHeader, disableCaseSensitiveRouting, disableExpressDefaultPoweredByHeader, getJsonBodyParser, getJsonBodyParserOptions, responseProfiler,
|
|
3
|
+
standardErrors, standardResponses,
|
|
10
4
|
} from '@xylabs/express'
|
|
11
|
-
import type { NodeInstance } from '@xyo-network/node-model'
|
|
12
5
|
import compression from 'compression'
|
|
13
6
|
import cors from 'cors'
|
|
14
7
|
import type { Express } from 'express'
|
|
@@ -17,11 +10,11 @@ import express from 'express'
|
|
|
17
10
|
import { addInstrumentation } from './instrumentation.ts'
|
|
18
11
|
import { addRoutes } from './routes/index.ts'
|
|
19
12
|
|
|
20
|
-
export const getApp = (node: NodeInstance): Express => {
|
|
13
|
+
// export const getApp = (node: NodeInstance): Express => {
|
|
14
|
+
export const getApp = (): Express => {
|
|
21
15
|
addInstrumentation()
|
|
22
16
|
const app = express()
|
|
23
17
|
app.set('etag', false)
|
|
24
|
-
|
|
25
18
|
app.use(cors())
|
|
26
19
|
app.use(compression())
|
|
27
20
|
app.use(responseProfiler)
|
|
@@ -30,7 +23,7 @@ export const getApp = (node: NodeInstance): Express => {
|
|
|
30
23
|
disableExpressDefaultPoweredByHeader(app)
|
|
31
24
|
app.use(customPoweredByHeader)
|
|
32
25
|
disableCaseSensitiveRouting(app)
|
|
33
|
-
app.node = node
|
|
26
|
+
// app.node = node
|
|
34
27
|
addRoutes(app)
|
|
35
28
|
app.use(standardErrors)
|
|
36
29
|
return app
|