Skip to content

Commit 9a2fa9b

Browse files
authored
chore(ops): updated node to v4.0.0-beta4 (#2108)
<!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: 1. Updates node to https://github.com/DeFiCh/ain/releases/tag/v4.0.0-beta4 2. Set ICX feature flag - DeFiCh/ain#2059 #### Which issue(s) does this PR fixes?: <!-- (Optional) Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Fixes # #### Additional comments?:
1 parent 595a0e5 commit 9a2fa9b

29 files changed

+84
-12
lines changed

apps/playground-api/__tests__/modules/PlaygroundModule.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ it('should have gov set', async () => {
183183
'v0/token/17/fixed_interval_price_id': 'TR50/USD',
184184
'v0/token/17/loan_minting_enabled': 'true',
185185
'v0/token/17/loan_minting_interest': '3',
186-
'v0/params/feature/evm': 'true'
186+
'v0/params/feature/evm': 'true',
187+
'v0/params/feature/icx': 'true'
187188
})
188189
})
189190

apps/playground-api/src/setups/setup.gov.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,12 @@ export class SetupGov extends PlaygroundSetup<Record<string, any>> {
159159
}
160160
})
161161
await this.generate(1)
162+
163+
await this.client.masternode.setGov({
164+
ATTRIBUTES: {
165+
'v0/params/feature/icx': 'true'
166+
}
167+
})
168+
await this.generate(1)
162169
}
163170
}

apps/whale-api/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.7'
22

33
services:
44
defi-blockchain:
5-
image: defi/defichain:master-b6fc51097
5+
image: defi/defichain:master-c14a2ba13
66
ports:
77
- "19554:19554"
88
command: >

packages/jellyfish-api-core/__tests__/category/account/getTokenBalances.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('Account', () => {
101101
}
102102
})
103103

104-
it('should getTokenBlaances with including eth', async () => {
104+
it('should getTokenBalances with including eth', async () => {
105105
await client.masternode.setGov({
106106
ATTRIBUTES: {
107107
'v0/params/feature/evm': 'true'

packages/jellyfish-api-core/__tests__/category/account/transferDomain.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('TransferDomain', () => {
118118
}
119119
])
120120
await expect(promise).rejects.toThrow(RpcApiError)
121-
await expect(promise).rejects.toThrow('Src address must not be an ETH address in case of "DVM" domain')
121+
await expect(promise).rejects.toThrow('Src address must be a legacy or Bech32 address in case of "DVM" domain')
122122
})
123123

124124
it('(evm -> dvm) should fail if source address and source domain are not match', async () => {
@@ -175,7 +175,7 @@ describe('TransferDomain', () => {
175175
}
176176
])
177177
await expect(promise).rejects.toThrow(RpcApiError)
178-
await expect(promise).rejects.toThrow('Dst address must not be an ETH address in case of "DVM" domain')
178+
await expect(promise).rejects.toThrow('Dst address must be a legacy or Bech32 address in case of "DVM" domain')
179179
})
180180

181181
it('(dvm -> evm) should fail if address is invalid', async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/claimDFCHTLC.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe('ICXOrderBook.claimDFCHTLC', () => {
2929
await icxSetup.createBTCDFIPool()
3030
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
3131
await icxSetup.setTakerFee(0.001)
32+
await icxSetup.setupICXFlag()
3233
})
3334

3435
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/closeOffer.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('ICXOrderBook.closeOffer', () => {
3030
await icxSetup.createBTCDFIPool()
3131
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
3232
await icxSetup.setTakerFee(0.001)
33+
await icxSetup.setupICXFlag()
3334
})
3435

3536
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/closeOrder.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('ICXOrderBook.closeOrder', () => {
3939
await icxSetup.createBTCDFIPool()
4040
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
4141
await icxSetup.setTakerFee(0.001)
42+
await icxSetup.setupICXFlag()
4243
})
4344

4445
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/complexTests.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('ICX Complex test scenarios', () => {
4646
await icxSetup.createBTCDFIPool()
4747
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
4848
await icxSetup.setTakerFee(0.001)
49+
await icxSetup.setupICXFlag()
4950
})
5051

5152
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/createOrder.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('ICXOrderBook.createOrder', () => {
2525
await icxSetup.createBTCDFIPool()
2626
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
2727
await icxSetup.setTakerFee(0.001)
28+
await icxSetup.setupICXFlag()
2829
})
2930

3031
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('ICXOrderBook.getOrder', () => {
3939
await icxSetup.createBTCDFIPool()
4040
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
4141
await icxSetup.setTakerFee(0.001)
42+
await icxSetup.setupICXFlag()
4243
})
4344

4445
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/icx_setup.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ export class ICXSetup {
6767
await createToken(this.container, symbolBTC, createTokenOptions)
6868
}
6969

70+
async setupICXFlag (): Promise<void> {
71+
await this.client.masternode.setGov({
72+
ATTRIBUTES: {
73+
'v0/params/feature/icx': 'true'
74+
}
75+
})
76+
await this.container.generate(1)
77+
}
78+
7079
async initializeTokensIds (): Promise<void> {
7180
let tokenInfo = await this.container.call('gettoken', [symbolBTC])
7281
idBTC = Object.keys(tokenInfo)[0]

packages/jellyfish-api-core/__tests__/category/icxorderbook/listHTLCs.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('ICXOrderBook.listHTLCs', () => {
3737
await icxSetup.createBTCDFIPool()
3838
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
3939
await icxSetup.setTakerFee(0.001)
40+
await icxSetup.setupICXFlag()
4041
})
4142

4243
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/listOrders.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('ICXOrderBook.listOrders', () => {
3939
await icxSetup.createBTCDFIPool()
4040
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
4141
await icxSetup.setTakerFee(0.001)
42+
await icxSetup.setupICXFlag()
4243
})
4344

4445
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/makeOffer.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('ICXOrderBook.makeOffer', () => {
3939
await icxSetup.createBTCDFIPool()
4040
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
4141
await icxSetup.setTakerFee(0.001)
42+
await icxSetup.setupICXFlag()
4243
})
4344

4445
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/submitDFCHTLC.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('ICXOrderBook.submitDFCHTLC', () => {
3737
await icxSetup.createBTCDFIPool()
3838
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
3939
await icxSetup.setTakerFee(0.001)
40+
await icxSetup.setupICXFlag()
4041
})
4142

4243
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/icxorderbook/submitExtHTLC.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('ICXOrderBook.submitExtHTLC', () => {
3737
await icxSetup.createBTCDFIPool()
3838
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
3939
await icxSetup.setTakerFee(0.001)
40+
await icxSetup.setupICXFlag()
4041
})
4142

4243
afterAll(async () => {

packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ describe('Update Masternode', () => {
289289
const ownerAddress = await client.wallet.getNewAddress()
290290
const masternodeId = await client.masternode.createMasternode(ownerAddress)
291291

292-
await container.generate(1)
292+
await container.generate(20)
293293

294294
{
295295
const ownerAddressNew = await client.wallet.getNewAddress('', AddressType.P2SH_SEGWIT)
@@ -315,7 +315,7 @@ describe('Update Masternode', () => {
315315
rewardAddress
316316
})
317317
await expect(promise).rejects.toThrow(RpcApiError)
318-
await expect(promise).rejects.toThrow(`rewardAddress (${rewardAddress}) does not refer to a P2PKH or P2WPKH address`)
318+
await expect(promise).rejects.toThrow('Reward address must be P2PKH or P2WPKH type\', code: -32600, method: updatemasternode')
319319
}
320320
})
321321

@@ -332,7 +332,7 @@ describe('Update Masternode', () => {
332332
})
333333

334334
await expect(promise).rejects.toThrow(RpcApiError)
335-
await expect(promise).rejects.toThrow(`RpcApiError: 'ownerAddress (${invalidAddress}) does not refer to a P2PKH or P2WPKH address', code: -8, method: updatemasternode`)
335+
await expect(promise).rejects.toThrow(`ownerAddress (${invalidAddress}) does not refer to a P2PKH or P2WPKH address`)
336336
}
337337

338338
{
@@ -352,7 +352,7 @@ describe('Update Masternode', () => {
352352
})
353353

354354
await expect(promise).rejects.toThrow(RpcApiError)
355-
await expect(promise).rejects.toThrow(`RpcApiError: 'rewardAddress (${invalidAddress}) does not refer to a P2PKH or P2WPKH address', code: -8, method: updatemasternode`)
355+
await expect(promise).rejects.toThrow(`rewardAddress (${invalidAddress}) does not refer to a P2SH, P2PKH or P2WPKH address`)
356356
}
357357
})
358358

packages/jellyfish-testing/__tests__/icxorderbook.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ describe('ICX', () => {
1111
beforeAll(async () => {
1212
await testing.container.start()
1313
await testing.container.waitForWalletCoinbaseMaturity()
14-
14+
await testing.rpc.masternode.setGov({
15+
ATTRIBUTES: {
16+
'v0/params/feature/icx': 'true'
17+
}
18+
})
1519
await testing.icxorderbook.createAccounts()
1620
await testing.rpc.account.utxosToAccount({ [testing.icxorderbook.accountDFI]: `${500}@${testing.icxorderbook.symbolDFI}` })
1721
await testing.rpc.account.utxosToAccount({ [testing.icxorderbook.accountBTC]: `${10}@${testing.icxorderbook.symbolDFI}` }) // for fee

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_claim_dfc_htlc.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ describe('claim DFC HTLC', () => {
1818
beforeAll(async () => {
1919
await testing.container.start()
2020
await testing.container.waitForWalletCoinbaseMaturity()
21+
await testing.rpc.masternode.setGov({
22+
ATTRIBUTES: {
23+
'v0/params/feature/icx': 'true'
24+
}
25+
})
2126

2227
providers = await getProviders(testing.container)
2328
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_icx_close_offer.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ describe('close ICX offer', () => {
1616
beforeAll(async () => {
1717
await testing.container.start()
1818
await testing.container.waitForWalletCoinbaseMaturity()
19+
await testing.rpc.masternode.setGov({
20+
ATTRIBUTES: {
21+
'v0/params/feature/icx': 'true'
22+
}
23+
})
1924

2025
providers = await getProviders(testing.container)
2126
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_icx_close_order.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ describe('close ICX order', () => {
1616
beforeAll(async () => {
1717
await testing.container.start()
1818
await testing.container.waitForWalletCoinbaseMaturity()
19+
await testing.rpc.masternode.setGov({
20+
ATTRIBUTES: {
21+
'v0/params/feature/icx': 'true'
22+
}
23+
})
1924

2025
providers = await getProviders(testing.container)
2126
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_icx_create_order.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ describe('create ICX order', () => {
1616
beforeAll(async () => {
1717
await testing.container.start()
1818
await testing.container.waitForWalletCoinbaseMaturity()
19+
await testing.rpc.masternode.setGov({
20+
ATTRIBUTES: {
21+
'v0/params/feature/icx': 'true'
22+
}
23+
})
1924

2025
providers = await getProviders(testing.container)
2126
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to testing.container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_icx_make_offer.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ describe('make ICX offer', () => {
1616
beforeAll(async () => {
1717
await testing.container.start()
1818
await testing.container.waitForWalletCoinbaseMaturity()
19+
await testing.rpc.masternode.setGov({
20+
ATTRIBUTES: {
21+
'v0/params/feature/icx': 'true'
22+
}
23+
})
1924

2025
providers = await getProviders(testing.container)
2126
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to testing.container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_submit_dfc_htlc.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ describe('submit DFC HTLC', () => {
1818
beforeAll(async () => {
1919
await testing.container.start()
2020
await testing.container.waitForWalletCoinbaseMaturity()
21+
await testing.rpc.masternode.setGov({
22+
ATTRIBUTES: {
23+
'v0/params/feature/icx': 'true'
24+
}
25+
})
2126

2227
providers = await getProviders(testing.container)
2328
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default

packages/jellyfish-transaction-builder/__tests__/txn/txn_builder_submit_ext_htlc.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ describe('submit EXT HTLC', () => {
1818
beforeAll(async () => {
1919
await testing.container.start()
2020
await testing.container.waitForWalletCoinbaseMaturity()
21+
await testing.rpc.masternode.setGov({
22+
ATTRIBUTES: {
23+
'v0/params/feature/icx': 'true'
24+
}
25+
})
2126

2227
providers = await getProviders(testing.container)
2328
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default

packages/jellyfish-transaction-builder/__tests__/txn/varint_gt_128.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ beforeEach(async () => {
110110

111111
// Prep 1000 DFI Token for testing
112112
await testing.token.dfi({ amount: 1000 })
113+
await testing.rpc.masternode.setGov({
114+
ATTRIBUTES: {
115+
'v0/params/feature/icx': 'true'
116+
}
117+
})
113118
await testing.generate(1)
114119
})
115120

packages/testcontainers/src/containers/DeFiDContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export abstract class DeFiDContainer extends DockerContainer {
3636
if (process?.env?.DEFICHAIN_DOCKER_IMAGE !== undefined) {
3737
return process.env.DEFICHAIN_DOCKER_IMAGE
3838
}
39-
return 'defi/defichain:master-b6fc51097' // renovate.json regexManagers
39+
return 'defi/defichain:master-c14a2ba13' // renovate.json regexManagers
4040
}
4141

4242
public static readonly DefaultStartOptions = {

packages/testcontainers/src/containers/NativeChainContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class NativeChainContainer extends GenericContainer {
2929
if (process?.env?.DEFICHAIN_DOCKER_IMAGE !== undefined) {
3030
return process.env.DEFICHAIN_DOCKER_IMAGE
3131
}
32-
return 'defi/defichain:master-b6fc51097' // renovate.json regexManagers
32+
return 'defi/defichain:master-c14a2ba13' // renovate.json regexManagers
3333
}
3434

3535
public static readonly PREFIX = 'defichain-testcontainers-'

0 commit comments

Comments
 (0)