Skip to content

Commit

Permalink
fix: return whirlpool oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
sol-mocha committed Apr 22, 2023
1 parent f76a2d7 commit a1a7e7a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 68 deletions.
4 changes: 4 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ components:
- whirlpool
- tokenVaultA
- tokenVaultB
- oracle

properties:
whirlpool:
Expand All @@ -1013,6 +1014,9 @@ components:
tokenVaultB:
type: string
example: "2wMQTELEgEcK7V3gwZBH58WvGcRZsyaWNpebqyFugGKe"
oracle:
type: string
example: "HtXk9cvY5isaeVawiaTFUrM6AH31g2Xbrq9qVQRvJVdL"

tokenAccount:
type: object
Expand Down
135 changes: 68 additions & 67 deletions pkg/api/apispec/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/api/routes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func vaultTokenSwapToAPI(vault *model.Vault, tokenSwap *model.TokenSwap) apispec

func vaultWhirlpoolToAPI(vault *model.Vault, orcaWhirlpool *model.OrcaWhirlpool) apispec.OrcaWhirlpoolConfig {
return apispec.OrcaWhirlpoolConfig{
Oracle: orcaWhirlpool.Oracle,
TokenVaultA: orcaWhirlpool.TokenVaultA,
TokenVaultB: orcaWhirlpool.TokenVaultB,
Whirlpool: orcaWhirlpool.Pubkey,
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/routes/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,9 @@ func TestUtils(t *testing.T) {
assert.Equal(t, orcaWhirlpool.Pubkey, apiModel.Whirlpool)
assert.Equal(t, orcaWhirlpool.TokenVaultA, apiModel.TokenVaultA)
assert.Equal(t, orcaWhirlpool.TokenVaultB, apiModel.TokenVaultB)
assert.Equal(t, orcaWhirlpool.Oracle, apiModel.Oracle)
// if the line below needs to be updated, add the field assertion above
assert.Equal(t, reflect.TypeOf(apiModel).NumField(), 4)
assert.Equal(t, reflect.TypeOf(apiModel).NumField(), 5)

assert.Equal(t, vault.TokenAMint, apiModel.TokenAMint)
assert.Equal(t, vault.TokenBMint, apiModel.TokenBMint)
Expand Down

0 comments on commit a1a7e7a

Please sign in to comment.