Skip to content

Commit

Permalink
Fix and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo committed Aug 2, 2021
1 parent 21c39c7 commit 3b543a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Spv', () => {
const pubKeyA = await container.call('spv_getaddresspubkey', [await container.call('spv_getnewaddress')])
const pubKeyB = await container.call('spv_getaddresspubkey', [await container.call('spv_getnewaddress')])

const promise = client.spv.createHtlc(pubKeyA, pubKeyB, { timeout: '4194304' })
const promise = client.spv.createHtlc(pubKeyA, pubKeyB, { timeout: '4194304' }) // SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22)
await expect(promise).rejects.toThrow(RpcApiError)
await expect(promise).rejects.toThrow("RpcApiError: 'Invalid block denominated relative timeout', code: -3, method: spv_createhtlc")
})
Expand Down
4 changes: 2 additions & 2 deletions packages/jellyfish-api-core/src/category/spv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BigNumber from 'bignumber.js'
export const HTLC_MINIMUM_BLOCK_COUNT = 9

/**
* SPV RPCs for DeFi Blockchain
* SPV RPCs for Bitcoin Blockchain
*/
export class Spv {
private readonly client: ApiClient
Expand Down Expand Up @@ -62,7 +62,7 @@ export class Spv {
* Creates a Bitcoin address whose funds can be unlocked with a seed or as a refund.
*
* @param {string} receiverPubKey The public key of the possessor of the seed
* @param {number} ownerPubKey The public key of the recipient of the refund
* @param {string} ownerPubKey The public key of the recipient of the refund
* @param {CreateHtlcOptions} options
* @param {string} options.timeout Timeout of the contract (denominated in blocks) relative to its placement in the blockchain. Minimum 9. See HTLC_MINIMUM_BLOCK_COUNT
* @param {string} [options.seed] SHA256 hash of the seed. If none provided one will be generated
Expand Down

0 comments on commit 3b543a6

Please sign in to comment.