Skip to content

Commit 6e8d247

Browse files
authored
Merge branch 'feature/2.4' into fix/VULN-601
2 parents a087190 + a78bd22 commit 6e8d247

File tree

18 files changed

+274
-266
lines changed

18 files changed

+274
-266
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions: read-all
77

88
jobs:
99
checkout-and-build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@163217dfcd28294438ea1c1c149cfaf66eec283e # v4.2.1

package-lock.json

Lines changed: 42 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@rsksmart/bridges-core-sdk": "^0.4.1",
2525
"@rsksmart/flyover-sdk": "^1.6.2",
2626
"@rsksmart/rlogin": "^1.6.1",
27-
"@rsksmart/rlogin-ledger-provider": "^1.0.4",
27+
"@rsksmart/rlogin-ledger-provider": "^1.0.5-alpha",
2828
"@rsksmart/rlogin-trezor-provider": "^1.0.4",
2929
"@rsksmart/rsk-precompiled-abis": "^6.0.0-ARROWHEAD",
3030
"@rsksmart/rsk-utils": "^1.1.0",

src/common/components/status/StatusProgressBar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default defineComponent({
8686
const btcTicker = environmentContext.getBtcTicker();
8787
const rbtcTicker = environmentContext.getRbtcTicker();
8888
const txFailed = computed(() => props.txWithError
89-
|| status.value.flyoverStatus === FlyoverStatus.FAILED);
89+
|| status.value.flyoverStatus?.status === FlyoverStatus.FAILED);
9090
const txDetails = useStateAttribute<PegoutStatusDataModel|PeginStatus|FlyoverStatusModel>('status', 'txDetails');
9191
const isPegOut = computed((): boolean => status.value.type === TxStatusType.PEGOUT
9292
|| status.value.type === TxStatusType.FLYOVER_PEGOUT);
@@ -122,7 +122,7 @@ export default defineComponent({
122122
labelOne = `Send ${rbtcTicker} to Liquidity Provider`;
123123
labelTwo = `Liquidity Provider received ${rbtcTicker}`;
124124
labelThree = `Liquidity Provider send ${btcTicker}`;
125-
switch (status.value.flyoverStatus) {
125+
switch (status.value.flyoverStatus?.status) {
126126
case FlyoverStatus.PENDING:
127127
zero = 100;
128128
first = 100;
@@ -203,7 +203,7 @@ export default defineComponent({
203203
labelOne = `Send ${btcTicker} to Liquidity Provider`;
204204
labelTwo = `Liquidity Provider received ${btcTicker}`;
205205
labelThree = `Liquidity Provider send ${rbtcTicker}`;
206-
switch (status.value.flyoverStatus) {
206+
switch (status.value.flyoverStatus?.status) {
207207
case FlyoverStatus.PENDING:
208208
zero = 100;
209209
first = 100;

src/common/components/status/StatusSummary.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export default defineComponent({
152152
},
153153
...(props.withTxIds ? [{
154154
title: 'Transaction ID',
155-
value: props.details.txId || '-',
156-
link: getBtcTxExplorerUrl(props.details.txId),
155+
value: props.details.btcTxId || '-',
156+
link: getBtcTxExplorerUrl(props.details.btcTxId),
157157
}] : []),
158158
];
159159
});
@@ -206,9 +206,9 @@ export default defineComponent({
206206
},
207207
...(props.withTxIds ? [{
208208
title: 'Transaction ID',
209-
value: props.details.rskTxId && !props.txWithError
210-
? props.details.rskTxId : '-',
211-
link: getRskTxExplorerUrl(props.details.rskTxId),
209+
value: props.details.txId && !props.txWithError
210+
? props.details.txId : '-',
211+
link: getRskTxExplorerUrl(props.details.txId),
212212
}] : []),
213213
];
214214
});

src/common/components/status/TxPegin.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ import {
3232
NormalizedSummary,
3333
TxStatusMessage,
3434
FlyoverStatusModel,
35+
TxStatus,
3536
} from '@/common/types';
3637
import EnvironmentContextProviderService from '@/common/providers/EnvironmentContextProvider';
3738
import * as constants from '@/common/store/constants';
3839
import { getTime, setStatusMessage, toSatoshiBigIntString } from '@/common/utils';
39-
import { useAction, useGetter, useStateAttribute } from '@/common/store/helper';
40+
import {
41+
useAction, useGetter, useStateAttribute,
42+
} from '@/common/store/helper';
4043
import StatusProgressBar from '@/common/components/status/StatusProgressBar.vue';
4144
import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service';
4245
import StatusSummary from '@/common/components/status/StatusSummary.vue';
@@ -97,6 +100,7 @@ export default defineComponent({
97100
const environmentContext = EnvironmentContextProviderService.getEnvironmentContext();
98101
99102
const txDetails = useStateAttribute<PeginStatus | FlyoverStatusModel>('status', 'txDetails');
103+
const flyoverStatus = useStateAttribute<TxStatus['flyoverStatus']>('status', 'flyoverStatus');
100104
const isRejected = useGetter<boolean>('status', constants.STATUS_IS_REJECTED);
101105
const setAmount = useAction('pegInTx', constants.PEGIN_TX_ADD_AMOUNT_TO_TRANSFER);
102106
const peginInit = useAction('pegInTx', constants.PEGIN_TX_INIT);
@@ -122,7 +126,7 @@ export default defineComponent({
122126
amountReceivedString: status.btc.amountTransferred.toString(),
123127
fee: status.btc.fees,
124128
recipientAddress: status.rsk.recipientAddress,
125-
txId: status.btc.txId,
129+
btcTxId: status.btc.txId,
126130
refundAddress: status.btc.refundAddress,
127131
federationAddress: status.btc.federationAddress,
128132
total: total.toBTCTrimmedString(),
@@ -144,7 +148,8 @@ export default defineComponent({
144148
fee: status.fee,
145149
recipientAddress: status.recipientAddress,
146150
senderAddress: status.senderAddress,
147-
txId: status.txHash,
151+
txId: flyoverStatus.value?.txId,
152+
btcTxId: status.txHash,
148153
};
149154
});
150155

src/common/components/status/TxPegout.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
NormalizedSummary,
2020
FlyoverStatusModel,
2121
WeiBig,
22+
TxStatus,
2223
} from '@/common/types';
2324
import StatusProgressBar from '@/common/components/status/StatusProgressBar.vue';
2425
import { useStateAttribute } from '@/common/store/helper';
@@ -41,6 +42,7 @@ export default defineComponent({
4142
const typeSummary = props.isFlyover ? TxStatusType.FLYOVER_PEGOUT : TxStatusType.PEGOUT;
4243
4344
const txDetails = useStateAttribute<PegoutStatusDataModel | FlyoverStatusModel>('status', 'txDetails');
45+
const flyoverStatus = useStateAttribute<TxStatus['flyoverStatus']>('status', 'flyoverStatus');
4446
const pegOutEstimatedFee = useStateAttribute<SatoshiBig>('status', 'pegOutEstimatedFee');
4547
const calculatedGasFee = useStateAttribute<WeiBig>('pegOutTx', 'calculatedFee');
4648
@@ -91,6 +93,7 @@ export default defineComponent({
9193
recipientAddress: status.recipientAddress,
9294
senderAddress: status.senderAddress,
9395
txId: status.txHash,
96+
btcTxId: flyoverStatus.value?.txId,
9497
};
9598
});
9699

src/common/services/FlyoverService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,11 @@ export default class FlyoverService {
459459
}
460460

461461
public getPeginStatus(quoteHash: string) {
462-
return new Promise<string>((resolve, reject) => {
462+
return new Promise<{status: string, txId: string}>((resolve, reject) => {
463463
this.flyover?.getPeginStatus(quoteHash)
464464
.then((detailedStatus) => {
465465
const status = FlyoverUtils.getSimpleQuoteStatus(detailedStatus.status.state);
466-
resolve(status);
466+
resolve({ status, txId: detailedStatus.status.callForUserTxHash });
467467
})
468468
.catch((error) => {
469469
reject(new ServiceError(
@@ -477,11 +477,11 @@ export default class FlyoverService {
477477
}
478478

479479
public getPegoutStatus(quoteHash: string) {
480-
return new Promise<string>((resolve, reject) => {
480+
return new Promise<{status: string, txId: string}>((resolve, reject) => {
481481
this.flyover?.getPegoutStatus(quoteHash)
482482
.then((detailedStatus) => {
483483
const status = FlyoverUtils.getSimpleQuoteStatus(detailedStatus.status.state);
484-
resolve(status);
484+
resolve({ status, txId: detailedStatus.status.lpBtcTxHash });
485485
})
486486
.catch((error) => {
487487
reject(new ServiceError(

0 commit comments

Comments
 (0)