Skip to content

Commit

Permalink
harmony-one#95 fixed executeRedeem interface , all tests passed
Browse files Browse the repository at this point in the history
    ✓ Register OLD Vault with 10 Wei Collateral (94ms)
    ✓ Issue 0.5 OneBtc (836ms)
    ✓ Request Replace (116ms)
    ✓ Register NEW Vault with 10 Wei Collateral (78ms)
    ✓ Accept Replace (602ms)
    ✓ Execute Replace (95ms)
  • Loading branch information
hashmesan committed Apr 28, 2022
1 parent 7453d4b commit 94667c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions contract/bridge/contracts/Replace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ abstract contract Replace is VaultRegistry, Request {

// cap to maximum replaceable token
require(btcAmount <= requestableTokens, "exceeds eligible replacement");
uint256 toBeReplacedIncrease = MathUpgradeable.min(
requestableTokens,
btcAmount
);

// 5% griefing is calculated on collateral?
(
Expand Down
6 changes: 3 additions & 3 deletions contract/bridge/test/Replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ contract("Replace unit test", (accounts) => {

const collateral = await this.ExchangeRateOracleWrapper.wrappedToCollateral(eligibleBTCReplace);
const griefingCollateral = (collateral * 5 / 100).toString(); // 5%
console.log("Eligible=", eligibleBTCReplace.toString(), eligibleBTCReplace.toString(), griefingCollateral.toString());

const req = await this.OneBtc.requestReplace(
this.vaultId,
Expand Down Expand Up @@ -183,15 +182,16 @@ contract("Replace unit test", (accounts) => {
const btcTx = issueTxMock(replaceId, btcBase58, btcAmount);
const btcBlockNumberMock = 1000;
const btcTxIndexMock = 2;
const heightAndIndex = (btcBlockNumberMock << 32) | btcTxIndexMock;
const btcTxHeightMock = (btcBlockNumberMock << 32);
const headerMock = Buffer.alloc(0);
const proofMock = Buffer.alloc(0);

const req = await this.OneBtc.executeReplace(
replaceId,
proofMock,
btcTx.toBuffer(),
heightAndIndex,
btcTxIndexMock,
btcTxHeightMock,
headerMock
);

Expand Down

0 comments on commit 94667c2

Please sign in to comment.