Skip to content

Commit 23c52c3

Browse files
authored
Merge pull request #303 from rsksmart/remove-pre-reed-setup
Removes pre reed setup
2 parents be679e8 + 155cbcd commit 23c52c3

File tree

9 files changed

+11
-44
lines changed

9 files changed

+11
-44
lines changed

lib/tests/change-federation.js

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ const execute = (description, newFederationConfig, segwitToSegwitFederationChang
125125
let notAuthorized1Address;
126126
let notAuthorized2Address;
127127
let notAuthorized3Address;
128-
let reed800IsActive;
129128

130129
describe(description, async function() {
131130

@@ -179,22 +178,14 @@ const execute = (description, newFederationConfig, segwitToSegwitFederationChang
179178

180179
newFederationBtcPublicKeys = newFederationPublicKeys.map(federator => federator[KEY_TYPE_BTC]);
181180

182-
reed800IsActive = await Runners.common.forks.reed800.isAlreadyActive();
183-
184181
const expectedNewFederationErpRedeemScriptBuffer = redeemScriptParser.getP2shErpRedeemScript(newFederationBtcPublicKeys.map(key => removePrefix0x(key)), ERP_PUBKEYS, ERP_CSV_VALUE);
185182
expectedNewFederationErpRedeemScript = expectedNewFederationErpRedeemScriptBuffer.toString('hex');
186183

187-
expectedNewFederationAddress = reed800IsActive ?
188-
redeemScriptParser.getP2shP2wshAddressFromRedeemScript('REGTEST', expectedNewFederationErpRedeemScriptBuffer)
189-
:
190-
redeemScriptParser.getAddressFromRedeemScript('REGTEST', expectedNewFederationErpRedeemScriptBuffer);
184+
expectedNewFederationAddress = redeemScriptParser.getP2shP2wshAddressFromRedeemScript('REGTEST', expectedNewFederationErpRedeemScriptBuffer);
191185

192186
const flyoverNewFederationRedeemScript = redeemScriptParser.getFlyoverRedeemScript(expectedNewFederationErpRedeemScriptBuffer, FLYOVER_DERIVATION_HASH);
193187

194-
expectedFlyoverAddress = reed800IsActive ?
195-
redeemScriptParser.getP2shP2wshAddressFromRedeemScript('REGTEST', flyoverNewFederationRedeemScript)
196-
:
197-
redeemScriptParser.getAddressFromRedeemScript('REGTEST', flyoverNewFederationRedeemScript);
188+
expectedFlyoverAddress = redeemScriptParser.getP2shP2wshAddressFromRedeemScript('REGTEST', flyoverNewFederationRedeemScript);
198189

199190
initialActiveFederationInfo = await getActiveFederationInfo(bridge);
200191

@@ -482,17 +473,13 @@ const execute = (description, newFederationConfig, segwitToSegwitFederationChang
482473

483474
const svpFundTransaction = bitcoinJsLib.Transaction.fromHex(rawSvpFundTransaction);
484475

485-
if(!reed800IsActive) {
486-
svpFundTransaction.ins.forEach(input => {
487-
expect(input.witness.length).to.be.equal(0, 'The SVP fund transaction inputs should not have witness data when TDB800 is not active.');
488-
});
489-
} else if(!segwitToSegwitFederationChange) {
476+
if(!segwitToSegwitFederationChange) {
490477
svpFundTransaction.ins.forEach(input => {
491-
expect(input.witness.length).to.be.equal(0, 'The SVP fund transaction inputs should not have witness data when TDB800 is active and there has been no previous p2sh to p2wsh federation change.');
478+
expect(input.witness.length).to.be.equal(0, 'The SVP fund transaction inputs should not have witness data when there has not been a previous p2sh to p2wsh federation change.');
492479
});
493480
} else if(segwitToSegwitFederationChange) {
494481
svpFundTransaction.ins.forEach(input => {
495-
expect(input.witness.length).to.be.greaterThan(0, 'The SVP fund transaction inputs should have witness data when TDB800 and there has been a previous p2sh to p2wsh federation change.');
482+
expect(input.witness.length).to.be.greaterThan(0, 'The SVP fund transaction inputs should have witness data when there has been a previous p2sh to p2wsh federation change.');
496483
});
497484
}
498485

@@ -597,11 +584,9 @@ const execute = (description, newFederationConfig, segwitToSegwitFederationChang
597584

598585
svpSpendBtcTransaction = bitcoinJsLib.Transaction.fromHex(removePrefix0x(releaseBtcEvent.arguments.btcRawTransaction));
599586

600-
if(reed800IsActive) {
601-
svpSpendBtcTransaction.ins.forEach(input => {
602-
expect(input.witness.length).to.be.greaterThan(0, 'The SVP Spend transaction inputs should have witness data when TDB800 is active.');
603-
});
604-
}
587+
svpSpendBtcTransaction.ins.forEach(input => {
588+
expect(input.witness.length).to.be.greaterThan(0, 'The SVP Spend transaction inputs should have witness data.');
589+
});
605590

606591
// Mining the SVP Spend transaction in bitcoin to register it in the Bridge
607592
await waitForBitcoinTxToBeInMempool(btcTxHelper, svpSpendBtcTransaction.getId());

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ global.Runners = {
9595
arrowhead600: createForkObject('arrowhead600', 1),
9696
arrowhead631: createForkObject('arrowhead631', 1),
9797
lovell700: createForkObject('lovell700', 1),
98-
reed800: createForkObject('reed800', 1900),
98+
reed800: createForkObject('reed800', 1),
9999
},
100100
additionalFederationAddresses: []
101101
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const federationChangeTests = require('../lib/tests/change-federation');
22

3-
federationChangeTests.execute('Initial Federation change from genesis to p2sh', Runners.config.federations.secondFederation);
3+
federationChangeTests.execute('Initial Federation change from genesis to p2wsh', Runners.config.federations.secondFederation);

tests/01_00_00-2wp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const twoWpTests = require('../lib/tests/2wp');
22

3-
twoWpTests.execute('BTC <=> RSK 2WP after p2sh federation change');
3+
twoWpTests.execute('BTC <=> RSK 2WP after p2wsh federation change');

tests/01_01_00-activate-tbd800.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/01_01_00-change-federation.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/01_01_01-2wp.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/01_01_01-change-federation.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/01_01_02-2wp.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)