Skip to content

Commit f8ba726

Browse files
authored
Merge pull request #2187 from oasisprotocol/lw/fix-failed-debonding
Don't throw on failed debonding transaction
2 parents 97fbca8 + c4d5f3c commit f8ba726

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.changelog/2187.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't throw on failed debonding transaction

src/vendors/nexus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ export function getNexusAPIs(url: string | 'https://nexus.oasis.io/v1/') {
112112
// Temporary workaround for missing amount in staking.ReclaimEscrow
113113
const transactionsWithFixedAmount = await Promise.all(
114114
mergedTransactions.map(async transaction => {
115-
if (transaction.method === ConsensusTxMethod.StakingReclaimEscrow) {
115+
if (transaction.method === ConsensusTxMethod.StakingReclaimEscrow && transaction.success) {
116116
const eventsResponse = await api.consensusEventsGet({
117117
limit: 1,
118118
txHash: transaction.hash,
119119
type: ConsensusEventType.StakingEscrowDebondingStart,
120120
})
121-
const amount = (eventsResponse.events[0].body as { amount?: number })?.amount
121+
const amount = (eventsResponse.events[0]?.body as { amount?: number })?.amount
122122
return {
123123
...transaction,
124124
body: {

0 commit comments

Comments
 (0)