-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from rsksmart/add-pegout-request-from-contrac…
…t-test Adds 'should reject and not refund a pegout when a contract is trying…
- Loading branch information
Showing
6 changed files
with
466 additions
and
2,794 deletions.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
interface BridgeInterface { | ||
function releaseBtc() external payable; | ||
} | ||
|
||
contract CallReleaseBtcContract { | ||
|
||
BridgeInterface public bridgeContract = BridgeInterface(0x0000000000000000000000000000000001000006); | ||
|
||
function callBridgeReleaseBtc() external payable { | ||
bridgeContract.releaseBtc{value:msg.value}(); | ||
} | ||
|
||
} |
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,37 @@ | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const solUtils = require('./sol-utils'); | ||
const TEST_RELEASE_BTC_CONTRACT = '../contracts/CallReleaseBtcContract.sol'; | ||
const TEST_RELEASE_BTC_CONTRACT_NAME = 'CallReleaseBtcContract'; | ||
const SOLIDITY_COMPILER_VERSION = 'v0.8.26+commit.8a97fa7a'; | ||
|
||
/** | ||
* Deploys the CallReleaseBtcContract contract. | ||
* @param {RskTransactionHelper} rskTxHelper | ||
* @param {string} from the funded rsk address from which the contract will be deployed. | ||
* @returns {Promise<Contract>} the deployed contract. | ||
*/ | ||
const deployCallReleaseBtcContract = async (rskTxHelper, from) => { | ||
|
||
const fullPath = path.resolve(__dirname, TEST_RELEASE_BTC_CONTRACT); | ||
const source = fs.readFileSync(fullPath).toString(); | ||
|
||
const callReleaseBtcContract = await solUtils.compileAndDeploy( | ||
SOLIDITY_COMPILER_VERSION, | ||
source, | ||
TEST_RELEASE_BTC_CONTRACT_NAME, | ||
[], | ||
rskTxHelper, | ||
{ | ||
from | ||
} | ||
); | ||
|
||
return callReleaseBtcContract; | ||
|
||
}; | ||
|
||
module.exports = { | ||
deployCallReleaseBtcContract, | ||
}; |
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
Oops, something went wrong.