Skip to content

Commit

Permalink
remove price feed on finance
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Angelle committed Aug 31, 2023
1 parent 3a17887 commit e85dd4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 1 addition & 8 deletions centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,7 @@ export function ExternalFinanceForm({ loan }: { loan: LoanType }) {
const price = CurrencyBalance.fromFloat(values.price, pool.currency.decimals)
const faceValue = CurrencyBalance.fromFloat(values.faceValue, 18)

doFinanceTransaction([
loan.poolId,
loan.id,
faceValue,
price,
(loan.pricing as ExternalPricingInfo).Isin,
account.actingAddress,
])
doFinanceTransaction([loan.poolId, loan.id, faceValue, price, account.actingAddress])
actions.setSubmitting(false)
},
validateOnMount: true,
Expand Down
8 changes: 3 additions & 5 deletions centrifuge-js/src/modules/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1341,10 +1341,10 @@ export function getPoolsModule(inst: Centrifuge) {
}

function financeExternalLoan(
args: [poolId: string, loanId: string, quantity: BN, price: BN, isin: string, aoProxy: string],
args: [poolId: string, loanId: string, quantity: BN, price: BN, aoProxy: string],
options?: TransactionOptions
) {
const [poolId, loanId, quantity, price, isin, aoProxy] = args
const [poolId, loanId, quantity, price, aoProxy] = args
const $api = inst.getApi()
return $api.pipe(
switchMap((api) => {
Expand All @@ -1355,9 +1355,7 @@ export function getPoolsModule(inst: Centrifuge) {
external: { quantity: quantity.toString(), settlementPrice: price.toString() },
})
)
const oracleFeedSubmittable = api.tx.priceOracle.feedValues([[{ Isin: isin }, price]])
const batchSubmittable = api.tx.utility.batchAll([oracleFeedSubmittable, borrowSubmittable])
return inst.wrapSignAndSend(api, batchSubmittable, options)
return inst.wrapSignAndSend(api, borrowSubmittable, options)
})
)
}
Expand Down

0 comments on commit e85dd4f

Please sign in to comment.