Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean tracker #2763

Open
17 of 21 tasks
Jouzo opened this issue Dec 27, 2023 · 2 comments
Open
17 of 21 tasks

Ocean tracker #2763

Jouzo opened this issue Dec 27, 2023 · 2 comments
Assignees

Comments

@Jouzo
Copy link
Collaborator

Jouzo commented Dec 27, 2023

On-going Implementation PR #2724

Summary

WIP

TODO

  • API Versioning
  • Network handling
@Jouzo
Copy link
Collaborator Author

Jouzo commented Jan 9, 2024

Block indexing @canonbrother

@canonbrother
Copy link
Contributor

canonbrother commented Apr 9, 2024

Test suites checklist

oracles.defid.ts

list/get

  • should list
  • should get oracle a TA-USD feed
  • should get oracle a TB-USD feed
  • should get oracle b TB-USD feed
  • should get oracles by owner address

prices.defid.ts

list/get

  • should list
  • should get ticker
  • should get feeds
  • should get oracles

loan.collateral.controller.defid.ts

list

  • should listCollateralTokens
  • should listCollateralTokens with pagination
  • should listCollateralTokens with an empty object if size 100 next 300 which is out of range

get

  • should get collateral token by symbol
  • should throw error while getting non-existent collateral token id

loan.token.controller.defid.ts

list

  • should listLoanTokens
  • should listLoanTokens with pagination
  • should listLoanTokens with an empty object if size 100 next 300 which is out of range

get

  • should get loan token by symbol
  • should throw error while getting non-existent loan token id

transaction.controller.defid.ts

get

  • should get a single transaction ed0267f
  • should due to non-existent transaction

getVins

  • should return list of vin
  • should return empty page if txid is not valid
    ○ skipped should return list of vin when next is out of range

getVouts

  • should return list of vout (3 ms)
  • should return empty page if txid is not valid
    ○ skipped should return list of vout when next is out of range

poolpair.fees.service.defid.ts

get best path - DEX burn fees

  • should return fees - CAT to DFI - Both token fees direction are in
  • should return fees - DFI to CAT - Both token fees direction are in
  • should return fees - DFI to DOG - Both token fees direction is out
  • should return fees - DOG to DFI - Both token fees direction is out
  • should return fees - KOALA to DFI - TokenA fee direction is in
  • should return fees - DFI to KOALA - TokenA fee direction is in
  • should return fees - FISH to DFI - TokenB fee direction is out
  • should return fees - DFI to FISH - TokenB fee direction is out
  • should return fees (bidirectional) - DFI <-> TURTLE - TokenA fee direction is both
  • should return fees (bidirectional) - DFI <-> PANDA - TokenA fee direction is both
  • should return fees (bidirectional) - DFI <-> RABBIT - Both token fees direction are both
  • should return fees (bidirectional) - DFI <-> FOX - if tokenA fee direction is not set
  • should return fees (bidirectional) - DFI <-> LION - if tokenB fee direction is not set
  • should return fees (bidirectional) - DFI <-> TIGER - if both token fees direction are not set
  • should return [] if dex fees is not set

get best path - DEX estimated return

  • should less dex fees in estimatedReturnLessDexFees - 1 leg
  • should less dex fees in estimatedReturnLessDexFees - 2 legs
  • should not less dex fees if dex fees is not set

poolpair.swap.controller.defid.ts

poolswap buy-sell indicator

  • should get pool swap details
  • should get composite pool swap for 2 jumps
  • should get composite pool swap for 2 jumps scenario 2
  • should get composite pool swap for 3 jumps
  • should get direct pool swap for composite swap

poolpair.defid.ts

poolswap aggregated

  • should show aggregated swaps for 24h and 30d

masternode.controller.defid.ts

list

  • should list masternodes
  • should list masternodes with pagination

get

  • should get a masternode with id
  • should due to non-existent masternode

resign

timelock

  • should get masternode with timelock

poolpair.swap.verbose.controller.defid.ts

poolswap buy-sell indicator

  • should get pool swap details
  • should get composite pool swap for 2 jumps
  • should get composite pool swap for 2 jumps scenario 2
  • should get composite pool swap for 3 jumps
  • should get direct pool swap for composite swap

loan.vault.controller.defid.ts

loan

  • should listVaults with size only

get

  • should get vault by vaultId
  • should throw error while getting non-existent vault

rawtx.controller.defid.ts

test

  • should accept valid txn (18 ms)
  • should accept valid txn with given maxFeeRate
  • should throw BadRequestError due to invalid txn
  • should throw BadRequestError due to high fees

send

  • should send valid txn and validate tx out
  • should send valid txn with given maxFeeRate and validate tx out
  • should throw BadRequestException due to invalid txn
  • should throw BadRequestException due to high fees

get

  • should accept valid txn and return hex
  • should throw NotFoundException due to tx id not found

poolpair.controller.defid.ts

list

  • should list
  • should list with pagination
  • should list with undefined next pagination

get

  • should get (5 ms)
  • should throw error while getting non-existent poolpair

get best path

  • should be bidirectional swap path - listPaths(a, b) === listPaths(b, a)
  • should get best swap path - 2 legs
  • should get correct swap path - 3 legs
  • should ignore correct swap path > 3 legs
  • should return direct path even if composite swap paths has greater return
  • should deduct commission fee - 1 leg
  • should deduct commission and dex fees - 2 legs
  • should have no swap path - isolated token H
  • should throw error for invalid tokenId

get all paths

  • should be bidirectional swap path - listPaths(a, b) === listPaths(b, a)
  • should get correct swap path - 2 legs
  • should get correct swap path - 3 legs
  • should ignore correct swap paths > 3 legs
  • should get multiple swap paths
  • should handle cyclic swap paths
  • should have no swap path - isolated token H
  • should throw error when fromToken === toToken
  • should throw error for invalid tokenId

get list swappable tokens

  • should list correct swappable tokens
  • should not show status:false tokens
  • should list no tokens for token that is not swappable with any
  • should throw error for invalid / non-existent tokenId

latest dex prices

  • should get latest dex prices - denomination: DFI
  • should get latest dex prices - denomination: USDT
  • should get consistent, mathematically sound dex prices - USDT and DFI
  • should get consistent, mathematically sound dex prices - A and B
  • should list DAT tokens only - O (non-DAT token) is not included in result
  • should list DAT tokens only - status:false tokens are excluded

param validation - denomination

  • should throw error for invalid denomination

governance.controller.defid.ts

governance - listProposals and getProposal

  • should listProposals
  • should listProposals with size
  • should listProposals with status
  • should listProposals with type
  • should listProposals with cycle
  • should listProposals with status and type
  • should listProposals with status, type and cycle
  • should listProposals with pagination
  • should listProposals with all record when limit is 0
  • should listProposals with all record when all flag is true
  • should listProposals with status and pagination
  • should listProposals with type and pagination
  • should listProposals with status, type and pagination
  • should getProposal for CFP
  • should getProposal for VOC

governance - listProposalVotes

  • should listProposalVotes
  • should listProposalVotes with cycle
  • should listProposalVotes with all records when limit is 0
  • should listProposalVotes with all records when all flag is true
  • should listProposalVotes with all masternodes
  • should listProposalVotes with all masternodes and cycle
  • should listProposalVotes with all masternodes, cycle and pagination

token.controller.defid.ts

list

  • should listTokens
  • should listTokens with pagination
  • should listTokens with an empty object if size 100 next 300 which is out of range

get

  • should get DFI by DFI numeric id
  • should get DBTC-DETH by DBTC-DETH numeric id
  • should throw error while getting non-existent token

fee.controller.defid.ts

fee/estimate

  • should have fee of 0.00005 and not 0.00005 after adding activity

stats.controller.defid.ts

  • should getRewardDistribution

loan.scheme.controller.defid.ts

loan

  • should listLoanSchemes
  • should listSchemes with pagination
  • should listSchemes with an empty object if size 100 next 300 which is out of range

get

  • should get scheme by symbol (1 ms)
  • should throw error while getting non-existent scheme

block.controller.defid.ts

get

  • should get block based on hash
  • get should get block with height
  • should get undefined with invalid hash

list

  • should return paginated list of blocks
  • should return all the blocks if the size is out of range
  • list would return the latest set if next is outside of range
  • list would return the latest set if next is 0

getTransactions

  • should get transactions from a block by hash
  • getTransactions should not get transactions by height
  • getTransactions should get empty array when hash is not valid
  • getTransactions should get empty array when height is not valid
  • should list transactions in the right order

parseHeight

  • should return undefined for negative integer
  • should return undefined for float
  • should return number for positive integers
  • should return undefined for empty string
  • should return undefined for undefined
  • should return undefined for strings with characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants