Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyi2811 committed Jun 2, 2021
1 parent 1216741 commit b682ac7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { MasterNodeRegTestContainer } from '@defichain/testcontainers'
import { ContainerAdapterClient } from '../../container_adapter_client'
import { UTXO } from '../../../src/category/token'
import { RpcApiError } from '../../../src'

describe('Token', () => {
Expand Down Expand Up @@ -72,17 +71,9 @@ describe('Token', () => {

expect(tokenBalances.length).toStrictEqual(1)

const { txid } = await container.fundAddress(from, 10)
const { txid, vout } = await container.fundAddress(from, 10)

const utxos = await container.call('listunspent')
const inputs: UTXO[] = utxos.filter((utxo: UTXO) => utxo.txid === txid).map((utxo: UTXO) => {
return {
txid: utxo.txid,
vout: utxo.vout
}
})

const data = await client.token.mintTokens('5@DETH', inputs)
const data = await client.token.mintTokens('5@DETH', [{ txid, vout }])

expect(typeof data).toStrictEqual('string')
expect(data.length).toStrictEqual(64)
Expand Down
2 changes: 1 addition & 1 deletion packages/jellyfish-api-core/src/category/token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiClient } from '../.'

type TokenRegexType = `${string}@${string}`
type TokenRegexType = `${number}@${string}`

/**
* Token RPCs for DeFi Blockchain
Expand Down
2 changes: 1 addition & 1 deletion website/docs/jellyfish/api/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ interface token {
mintTokens (payload: TokenRegexType, utxos: UTXO[] = []): Promise<string>
}

type TokenRegexType = `${string}@${string}`
type TokenRegexType = `${number}@${string}`

interface UTXO {
txid: string
Expand Down

0 comments on commit b682ac7

Please sign in to comment.