Skip to content

Feature/GBI-2521 - Add isPegoutRefundable method#26

Merged
AndresQuijano merged 5 commits intoflyover-2.2.0from
feature/GBI-2521
Apr 3, 2025
Merged

Feature/GBI-2521 - Add isPegoutRefundable method#26
AndresQuijano merged 5 commits intoflyover-2.2.0from
feature/GBI-2521

Conversation

@Luisfc68
Copy link
Copy Markdown
Collaborator

@Luisfc68 Luisfc68 commented Mar 20, 2025

What

  • Add isPegoutRefundable in FlyoverSDK and integration tests
  • Update isPegoutQuotePaid to use FlyoverContext
  • Remove unnecessary logs from integration tests

Why

This function is to let the consumer know if a pegout can be refunded so they can enable that action in their UI

Task

https://rsklabs.atlassian.net/browse/GBI-2521

Update

After the last changes, I needed to add a function to the core package. I added it in this commit in a new branch called version-0.5.0, this is only temporary we can discuss later in which core version we're going to include that function

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2025

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 3 package(s) with unknown licenses.
See the Details below.

License Issues

integration-test/package-lock.json

PackageVersionLicenseIssue Type
..1.6.3NullUnknown License

package-lock.json

PackageVersionLicenseIssue Type
@rsksmart/bridges-core-sdk0.5.0NullUnknown License

package.json

PackageVersionLicenseIssue Type
@rsksmart/bridges-core-sdk^0.5.0NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
npm/.. 1.6.3 UnknownUnknown
npm/@rsksmart/bridges-core-sdk 0.5.0 UnknownUnknown
npm/@rsksmart/bridges-core-sdk ^0.5.0 UnknownUnknown

Scanned Files

  • integration-test/package-lock.json
  • package-lock.json
  • package.json

@Luisfc68 Luisfc68 marked this pull request as draft March 20, 2025 20:06
@Luisfc68 Luisfc68 changed the base branch from flyover-patch-sync to flyover-2.2.0 March 20, 2025 20:06
@Luisfc68 Luisfc68 marked this pull request as ready for review March 21, 2025 13:30
description: 'Network not specified for pegout quote'
},
PEG_OUT_REFUND_NOT_EXPIRED_BY_BLOCKS: {
code: 'FLYOVER-SDK-0008',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have error coders list?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

}

function isExpiredByDate (quote: PegoutQuoteDetail): boolean {
return quote.expireDate < (Date.now() / 1000)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client-side time can be manipulated. It would be safer to also check that the difference between expireDate and current time is substantial (e.g., greater than a certain threshold).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll replace with last's block timestamp, that should address both points. Firstly because its a more reliable source of info, secondly because if the timestamp of the last block is expired then the actual time (and therefore the time when the refund is eventually called) is probably going to be higher so there difference increases

@AndresQuijano AndresQuijano merged commit 088940f into flyover-2.2.0 Apr 3, 2025
4 checks passed
@Luisfc68 Luisfc68 deleted the feature/GBI-2521 branch May 5, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants