Skip to content

Commit

Permalink
chore(ops): updated node to v4.0.0-beta4 (#2108)
Browse files Browse the repository at this point in the history
<!--  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?:
  • Loading branch information
thedoublejay committed Jun 28, 2023
1 parent 595a0e5 commit 9a2fa9b
Show file tree
Hide file tree
Showing 29 changed files with 84 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ it('should have gov set', async () => {
'v0/token/17/fixed_interval_price_id': 'TR50/USD',
'v0/token/17/loan_minting_enabled': 'true',
'v0/token/17/loan_minting_interest': '3',
'v0/params/feature/evm': 'true'
'v0/params/feature/evm': 'true',
'v0/params/feature/icx': 'true'
})
})

Expand Down
7 changes: 7 additions & 0 deletions apps/playground-api/src/setups/setup.gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,12 @@ export class SetupGov extends PlaygroundSetup<Record<string, any>> {
}
})
await this.generate(1)

await this.client.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})
await this.generate(1)
}
}
2 changes: 1 addition & 1 deletion apps/whale-api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
defi-blockchain:
image: defi/defichain:master-b6fc51097
image: defi/defichain:master-c14a2ba13
ports:
- "19554:19554"
command: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Account', () => {
}
})

it('should getTokenBlaances with including eth', async () => {
it('should getTokenBalances with including eth', async () => {
await client.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/evm': 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('TransferDomain', () => {
}
])
await expect(promise).rejects.toThrow(RpcApiError)
await expect(promise).rejects.toThrow('Src address must not be an ETH address in case of "DVM" domain')
await expect(promise).rejects.toThrow('Src address must be a legacy or Bech32 address in case of "DVM" domain')
})

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

it('(dvm -> evm) should fail if address is invalid', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('ICXOrderBook.claimDFCHTLC', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('ICXOrderBook.closeOffer', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('ICXOrderBook.closeOrder', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('ICX Complex test scenarios', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('ICXOrderBook.createOrder', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('ICXOrderBook.getOrder', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export class ICXSetup {
await createToken(this.container, symbolBTC, createTokenOptions)
}

async setupICXFlag (): Promise<void> {
await this.client.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})
await this.container.generate(1)
}

async initializeTokensIds (): Promise<void> {
let tokenInfo = await this.container.call('gettoken', [symbolBTC])
idBTC = Object.keys(tokenInfo)[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('ICXOrderBook.listHTLCs', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('ICXOrderBook.listOrders', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('ICXOrderBook.makeOffer', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('ICXOrderBook.submitDFCHTLC', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('ICXOrderBook.submitExtHTLC', () => {
await icxSetup.createBTCDFIPool()
await icxSetup.addLiquidityToBTCDFIPool(1, 100)
await icxSetup.setTakerFee(0.001)
await icxSetup.setupICXFlag()
})

afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ describe('Update Masternode', () => {
const ownerAddress = await client.wallet.getNewAddress()
const masternodeId = await client.masternode.createMasternode(ownerAddress)

await container.generate(1)
await container.generate(20)

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

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

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

{
Expand All @@ -352,7 +352,7 @@ describe('Update Masternode', () => {
})

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

Expand Down
6 changes: 5 additions & 1 deletion packages/jellyfish-testing/__tests__/icxorderbook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ describe('ICX', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()

await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})
await testing.icxorderbook.createAccounts()
await testing.rpc.account.utxosToAccount({ [testing.icxorderbook.accountDFI]: `${500}@${testing.icxorderbook.symbolDFI}` })
await testing.rpc.account.utxosToAccount({ [testing.icxorderbook.accountBTC]: `${10}@${testing.icxorderbook.symbolDFI}` }) // for fee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe('claim DFC HTLC', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ describe('close ICX offer', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ describe('close ICX order', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ describe('create ICX order', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to testing.container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ describe('make ICX offer', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to testing.container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe('submit DFC HTLC', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe('submit EXT HTLC', () => {
beforeAll(async () => {
await testing.container.start()
await testing.container.waitForWalletCoinbaseMaturity()
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})

providers = await getProviders(testing.container)
providers.setEllipticPair(WIF.asEllipticPair(GenesisKeys[0].owner.privKey)) // set it to container default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ beforeEach(async () => {

// Prep 1000 DFI Token for testing
await testing.token.dfi({ amount: 1000 })
await testing.rpc.masternode.setGov({
ATTRIBUTES: {
'v0/params/feature/icx': 'true'
}
})
await testing.generate(1)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/testcontainers/src/containers/DeFiDContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export abstract class DeFiDContainer extends DockerContainer {
if (process?.env?.DEFICHAIN_DOCKER_IMAGE !== undefined) {
return process.env.DEFICHAIN_DOCKER_IMAGE
}
return 'defi/defichain:master-b6fc51097' // renovate.json regexManagers
return 'defi/defichain:master-c14a2ba13' // renovate.json regexManagers
}

public static readonly DefaultStartOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class NativeChainContainer extends GenericContainer {
if (process?.env?.DEFICHAIN_DOCKER_IMAGE !== undefined) {
return process.env.DEFICHAIN_DOCKER_IMAGE
}
return 'defi/defichain:master-b6fc51097' // renovate.json regexManagers
return 'defi/defichain:master-c14a2ba13' // renovate.json regexManagers
}

public static readonly PREFIX = 'defichain-testcontainers-'
Expand Down

0 comments on commit 9a2fa9b

Please sign in to comment.