patch script for strictness

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-08-31 13:55:15 +02:00
parent 4919364d67
commit cec0fcab99
1 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ async function main() {
bank as any bank as any
).indexedDepositsByMangoAccounts.add( ).indexedDepositsByMangoAccounts.add(
token.indexedPosition.mul( token.indexedPosition.mul(
banksMapUsingTokenIndex.get(token.tokenIndex).depositIndex, banksMapUsingTokenIndex.get(token.tokenIndex)!.depositIndex,
), ),
); );
} }
@ -69,7 +69,7 @@ async function main() {
).indexedBorrowsByMangoAccounts.add( ).indexedBorrowsByMangoAccounts.add(
token.indexedPosition token.indexedPosition
.abs() .abs()
.mul(banksMapUsingTokenIndex.get(token.tokenIndex).borrowIndex), .mul(banksMapUsingTokenIndex.get(token.tokenIndex)!.borrowIndex),
); );
} }
}), }),
@ -82,7 +82,7 @@ async function main() {
coder() coder()
.accounts.decode( .accounts.decode(
'token', 'token',
(await client.program.provider.connection.getAccountInfo(bank.vault)) (await client.program.provider.connection.getAccountInfo(bank.vault))!
.data, .data,
) )
.amount.toNumber(), .amount.toNumber(),
@ -102,7 +102,7 @@ async function main() {
`\n ${'bank'.padEnd(40)} ${bank.publicKey}` + `\n ${'bank'.padEnd(40)} ${bank.publicKey}` +
`\n ${'vault'.padEnd(40)} ${bank.vault}` + `\n ${'vault'.padEnd(40)} ${bank.vault}` +
`\n ${'mint'.padEnd(40)} ${bank.mint}` + `\n ${'mint'.padEnd(40)} ${bank.mint}` +
`\n ${'price'.padEnd(40)} ${bank.price.toNumber()}` + `\n ${'price'.padEnd(40)} ${bank.price?.toNumber()}` +
`\n ${'uiPrice'.padEnd(40)} ${bank.uiPrice}` + `\n ${'uiPrice'.padEnd(40)} ${bank.uiPrice}` +
`\n ${'error'.padEnd(40)} ${error}` + `\n ${'error'.padEnd(40)} ${error}` +
`\n ${'collectedFeesNative'.padEnd(40)} ${bank.collectedFeesNative}` + `\n ${'collectedFeesNative'.padEnd(40)} ${bank.collectedFeesNative}` +