-
Notifications
You must be signed in to change notification settings - Fork 2
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
01-04-54-post-iris-call-receive-headers / 01-04-55-post-iris-call-receive-header #26
Merged
jeremy-then
merged 10 commits into
main
from
refactor/01-04-54-post-iris-call-receive-headers
Jan 8, 2024
+138
−121
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2b2c409
refactor/01-04-54-post-iris-call-receive-headers
e2cecf1
helpers declaration fix
1061f28
forgotten comments
0c30e59
refactor/01-04-54-post-iris-call-receive-headers
145f475
getBlockHeader() part, test encapsulation
f325463
Updating bridge before running receiveHeader test
jeremy-then 74de4a0
Updates to node v20
jeremy-then c920d95
Using the last fed after the fed change.
jeremy-then ff3cd61
addressing review comments
6a7f4da
file names updates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,6 +9,9 @@ let rskTxHelper; | |||||
let btcTxHelper; | ||||||
let bridge; | ||||||
|
||||||
const HEADER_RECEIVED_OK = 0; | ||||||
const RECEIVE_HEADER_CALLED_TOO_SOON = "-1"; | ||||||
|
||||||
const fulfillRequirementsToRunAsSingleTestFile = async () => { | ||||||
const forkName = process.env.FORK_NAME || getLatestForkName().name; | ||||||
await activateFork(Runners.common.forks[forkName]); | ||||||
|
@@ -36,12 +39,11 @@ const execute = (description, getRskHost) => { | |||||
const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); | ||||||
const blockchainInitialHeigth = await bridge.methods.getBtcBlockchainBestChainHeight().call(); | ||||||
|
||||||
await sendTxWithCheck( | ||||||
rskTxHelper, | ||||||
bridge.methods.receiveHeader(ensure0x(blockHeader)), | ||||||
cowAddress, | ||||||
(result) => { expect(Number(result)).to.be.equal(0) } | ||||||
); | ||||||
const receiveHeaderMethodCall = bridge.methods.receiveHeader(ensure0x(blockHeader)); | ||||||
const checkCallback = (result) => { expect(Number(result)).to.be.equal(HEADER_RECEIVED_OK) }; | ||||||
|
||||||
await sendTxWithCheck(rskTxHelper, receiveHeaderMethodCall, cowAddress, checkCallback); | ||||||
|
||||||
const blockchainFinalHeight = await bridge.methods.getBtcBlockchainBestChainHeight().call(); | ||||||
expect(Number(blockchainFinalHeight)).to.be.equal(Number(blockchainInitialHeigth) + 1); | ||||||
}); | ||||||
|
@@ -50,7 +52,7 @@ const execute = (description, getRskHost) => { | |||||
const blockHashes = await btcTxHelper.mine(); | ||||||
const blockHeader = await btcTxHelper.getBlockHeader(blockHashes[0], false); | ||||||
const result = await bridge.methods.receiveHeader(ensure0x(blockHeader)).call(); | ||||||
expect(result).to.be.equal('-1'); | ||||||
expect(result).to.be.equal(RECEIVE_HEADER_CALLED_TOO_SOON); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
That should do it |
||||||
} | ||||||
); | ||||||
}); | ||||||
|
@@ -59,5 +61,3 @@ const execute = (description, getRskHost) => { | |||||
module.exports = { | ||||||
execute, | ||||||
}; | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const twoWpTests = require('../lib/tests/post_iris_call_receive_headers'); | ||
const receiveHeadersTests = require('../lib/tests/call_receive_headers'); | ||
|
||
twoWpTests.execute('Calling receiveHeaders after iris300', () => Runners.hosts.federate.host); | ||
receiveHeadersTests.execute('Calling receiveHeaders after iris300', () => Runners.hosts.federate.host); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const twoWpTests = require('../lib/tests/post_iris_call_receive_header'); | ||
const receiveHeaderTests = require('../lib/tests/call_receive_header'); | ||
|
||
twoWpTests.execute('Calling receiveHeader after iris300', () => Runners.hosts.federate.host); | ||
receiveHeaderTests.execute('Calling receiveHeader after iris300', () => Runners.hosts.federate.host); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const receiveHeadersTests = require('../lib/tests/call_receive_headers'); | ||
|
||
receiveHeadersTests.execute('Calling receiveHeaders last fork is active', () => Runners.hosts.federate.host); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const receiveHeaderTests = require('../lib/tests/call_receive_header'); | ||
|
||
receiveHeaderTests.execute('Calling receiveHeader last fork is active', () => Runners.hosts.federate.host); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const receiveHeadersTests = require('../lib/tests/call_receive_headers'); | ||
|
||
receiveHeadersTests.execute('Calling receiveHeaders after federation change', () => Runners.hosts.federate.host); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const receiveHeaderTests = require('../lib/tests/call_receive_header'); | ||
|
||
receiveHeaderTests.execute('Calling receiveHeader after federation change', () => Runners.hosts.federates[Runners.hosts.federates.length - 1].host); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why string?