-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pegin it register btc tx negative height #2888
base: pegin-it-repeatedTx
Are you sure you want to change the base?
Pegin it register btc tx negative height #2888
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
de4c30f
to
b699b73
Compare
ea9584e
to
171c569
Compare
b699b73
to
171c569
Compare
171c569
to
3d5d7e9
Compare
fac66b3
to
25c1834
Compare
e4f10cd
to
68a0f15
Compare
a4aee36
to
be35cf6
Compare
be35cf6
to
bc71e17
Compare
List<UTXO> expectedFederationUTXOs = federationSupport.getActiveFederationBtcUTXOs(); | ||
|
||
// Act | ||
bridgeSupport.registerBtcTransaction(rskTx, bitcoinTransaction.bitcoinSerialize(), -1, pmtWithTransactions.bitcoinSerialize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the logic internal logic, this should throw a new RegisterBtcTransactionException("Could not validate transaction")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, this test should be failing then. Maybe we are missing something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No exception is thrown because of negative height or repeated btc transactions. The exception is caught within the BridgeSupport::registerBtcTransaction method and it prints a log. I'll add this as a future issue to review.
@Test | ||
void registerBtcTransaction_forALegacyBtcTransactionWithNegativeHeight_shouldNotPerformAnyChange() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Test | |
void registerBtcTransaction_forALegacyBtcTransactionWithNegativeHeight_shouldNotPerformAnyChange() throws Exception { | |
@Test | |
void registerBtcTransaction_whenLegacyBtcTransactionWithNegativeHeight_shouldNotPerformAnyChange() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
List<UTXO> expectedFederationUTXOs = federationSupport.getActiveFederationBtcUTXOs(); | ||
|
||
// Act | ||
bridgeSupport.registerBtcTransaction(rskTx, bitcoinTransaction.bitcoinSerialize(), -1, pmtWithTransactions.bitcoinSerialize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, this test should be failing then. Maybe we are missing something here?
rskj-core/src/test/java/co/rsk/peg/RegisterBtcTransactionIT.java
Outdated
Show resolved
Hide resolved
@@ -169,7 +188,8 @@ private BtcTransaction createPegInTransaction(Address federationAddress, Coin co | |||
private void assertLogPegInBtc() { | |||
Sha256Hash peginTransactionHash = bitcoinTransaction.getHash(); | |||
List<DataWord> encodedTopics = getEncodedTopics(BridgeEvents.PEGIN_BTC.getEvent(), rskReceiver.toString(), peginTransactionHash.getBytes()); | |||
byte[] encodedData = getEncodedData(BridgeEvents.PEGIN_BTC.getEvent(), minimumPeginValue.getValue(), 0); | |||
int protocolVersion = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Quality Gate passedIssues Measures |
No description provided.