Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Commit

Permalink
feat(whale-api): Add froms info on auction batch (#698)
Browse files Browse the repository at this point in the history
* temp solution for listauction labelling

* fix test

* remove only

* add a checker to prevent dup element in froms[]

* rm vault.auction.batch.bid model, bloody workaround to find bidder within the auction period

* revert untouch change

* inject network

* fix poolpair test

* get froms via vaultAuctionHistoryMapper query

* test imprv

* code order

* fix tes

* fix pp test

* fix pp.test.ts

* convert human readable addr from placeauctionbid index

* revert placeauctionbid, remap hex to addr on ctrl layer

* revert place.auction.bid
  • Loading branch information
canonbrother authored Feb 23, 2022
1 parent 5d41bd7 commit 9d0ab6c
Show file tree
Hide file tree
Showing 7 changed files with 354 additions and 256 deletions.
2 changes: 2 additions & 0 deletions packages/whale-api-client/__tests__/api/loan.auction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ describe('list', () => {
expect(vault.batches).toStrictEqual([
{
collaterals: expect.any(Array),
froms: [],
highestBid: {
amount: {
activePrice: expect.any(Object),
Expand All @@ -332,6 +333,7 @@ describe('list', () => {
},
{
collaterals: expect.any(Array),
froms: [],
index: 1,
loan: expect.any(Object)
}
Expand Down
1 change: 1 addition & 0 deletions packages/whale-api-client/__tests__/api/loan.vault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ describe('get', () => {
batches: [
{
index: 0,
froms: [],
collaterals: [
{
amount: '10000.00000000',
Expand Down
4 changes: 2 additions & 2 deletions packages/whale-api-client/__tests__/api/poolpairs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ describe('poolpair info', () => {
expect.assertions(2)
try {
await client.poolpairs.get('A-DFI')
} catch (err) {
} catch (err: any) {
expect(err).toBeInstanceOf(WhaleApiException)
expect(err.error).toStrictEqual({
code: 400,
Expand All @@ -328,7 +328,7 @@ describe('poolpair info', () => {
expect.assertions(2)
try {
await client.poolpairs.get('999')
} catch (err) {
} catch (err: any) {
expect(err).toBeInstanceOf(WhaleApiException)
expect(err.error).toStrictEqual({
code: 404,
Expand Down
1 change: 1 addition & 0 deletions packages/whale-api-client/src/api/loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export interface LoanVaultLiquidationBatch {
collaterals: LoanVaultTokenAmount[]
loan: LoanVaultTokenAmount
highestBid?: HighestBid
froms: string[]
}

export enum LoanVaultState {
Expand Down
Loading

0 comments on commit 9d0ab6c

Please sign in to comment.