Skip to content

Commit

Permalink
refine td params
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Nov 27, 2023
1 parent 3817c56 commit 9fa66cb
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MasterNodeRegTestContainer } from '@defichain/testcontainers'
import { ContainerAdapterClient } from '../../container_adapter_client'
import { TransferDomainKey, TransferDomainType } from '../../../src/category/account'
import { TransferDomainType, TransferDomainOptionalInfo } from '../../../src/category/account'
import waitForExpect from 'wait-for-expect'
import BigNumber from 'bignumber.js'

Expand Down Expand Up @@ -138,7 +138,7 @@ describe('Account', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await container.generate(1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MasterNodeRegTestContainer } from '@defichain/testcontainers'
import { ContainerAdapterClient } from '../../container_adapter_client'
import { TransferDomainKey, TransferDomainType } from '../../../src/category/account'
import { TransferDomainType, TransferDomainOptionalInfo } from '../../../src/category/account'
import { RpcApiError } from '@defichain/jellyfish-api-core'
import BigNumber from 'bignumber.js'

Expand Down Expand Up @@ -100,7 +100,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -120,7 +120,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -140,7 +140,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -160,7 +160,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -180,7 +180,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -200,7 +200,7 @@ describe('TransferDomain', () => {
amount: '1@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -220,7 +220,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -240,7 +240,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -260,7 +260,7 @@ describe('TransferDomain', () => {
amount: 'invalid@DFI', // invalid amount
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -280,7 +280,7 @@ describe('TransferDomain', () => {
amount: 'invalid@DFI', // invalid amount
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -300,7 +300,7 @@ describe('TransferDomain', () => {
amount: '3@BTC', // not match
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -320,7 +320,7 @@ describe('TransferDomain', () => {
amount: '3@BTC', // not match
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -340,7 +340,7 @@ describe('TransferDomain', () => {
amount: '3@DFI', // not match
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -360,7 +360,7 @@ describe('TransferDomain', () => {
amount: '3@BTC', // not match
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -380,7 +380,7 @@ describe('TransferDomain', () => {
amount: '-1@DFI', // invalid
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -400,7 +400,7 @@ describe('TransferDomain', () => {
amount: '-1@DFI', // invalid
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -421,7 +421,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: 1 // invalid
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -442,7 +442,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -462,7 +462,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: 1 // invalid
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -482,7 +482,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -502,7 +502,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM // same domain
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -522,7 +522,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM // same domain
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -542,7 +542,7 @@ describe('TransferDomain', () => {
amount: '999999@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -562,7 +562,7 @@ describe('TransferDomain', () => {
amount: '99999999@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
const mempool: string[] = await container.call('getrawmempool')
Expand All @@ -586,7 +586,7 @@ describe('TransferDomain', () => {
amount: '3@DESC#128',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -606,7 +606,7 @@ describe('TransferDomain', () => {
amount: '3@DESC#128',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -626,7 +626,7 @@ describe('TransferDomain', () => {
amount: '10@DFI-BTC',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -649,7 +649,7 @@ describe('TransferDomain', () => {
amount: '10@DFI-BTC',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -672,7 +672,7 @@ describe('TransferDomain', () => {
amount: '1@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
},
{
src: {
Expand All @@ -685,7 +685,7 @@ describe('TransferDomain', () => {
amount: '1@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -705,7 +705,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
},
{
src: {
Expand All @@ -718,7 +718,7 @@ describe('TransferDomain', () => {
amount: '4@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
await expect(promise).rejects.toThrow(RpcApiError)
Expand All @@ -744,7 +744,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid).toStrictEqual('string')
Expand Down Expand Up @@ -781,7 +781,7 @@ describe('TransferDomain', () => {
amount: '3@DFI',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid).toStrictEqual('string')
Expand Down Expand Up @@ -816,7 +816,7 @@ describe('TransferDomain', () => {
amount: '3@BTC',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid1).toStrictEqual('string')
Expand Down Expand Up @@ -849,7 +849,7 @@ describe('TransferDomain', () => {
amount: '3@BTC',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid1).toStrictEqual('string')
Expand Down Expand Up @@ -882,7 +882,7 @@ describe('TransferDomain', () => {
amount: '3@AAPL',
domain: TransferDomainType.EVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid).toStrictEqual('string')
Expand Down Expand Up @@ -914,7 +914,7 @@ describe('TransferDomain', () => {
amount: '3@AAPL',
domain: TransferDomainType.DVM
},
[TransferDomainKey.SINGLE_KEY_CHECK]: false
singlekeycheck: false as unknown as TransferDomainOptionalInfo
}
])
expect(typeof txid).toStrictEqual('string')
Expand Down
Loading

0 comments on commit 9fa66cb

Please sign in to comment.