Skip to content
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

Using random seed for newAccountWithSeed #191

Open
wants to merge 1 commit into
base: rits-refactors-9-2024-integration
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/tests/2wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const execute = (description, getRskHost) => {
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper);
const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, senderRecipientInfo.btcSenderAddressInfo.address);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));
nathanieliov marked this conversation as resolved.
Show resolved Hide resolved

// Act

Expand Down Expand Up @@ -224,7 +224,7 @@ const execute = (description, getRskHost) => {
// The minimum pegin value minus 1 satoshis
const peginValueInSatoshis = minimumPeginValueInSatoshis - 1;

const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('rejectedPeginV1');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

// Act

Expand Down Expand Up @@ -343,7 +343,7 @@ const execute = (description, getRskHost) => {
await btcTxHelper.fundAddress(multisigSenderAddressInfo.address, Number(satoshisToBtc(minimumPeginValueInSatoshis + btcFeeInSatoshis)));
const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, multisigSenderAddressInfo.address);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1FromMultisig');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

// Act

Expand Down Expand Up @@ -381,7 +381,7 @@ const execute = (description, getRskHost) => {
await btcTxHelper.fundAddress(bech32SenderAddressInfo.address, Number(satoshisToBtc(minimumPeginValueInSatoshis + btcFeeInSatoshis)));
const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, bech32SenderAddressInfo.address);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1FromBech32');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

// Act

Expand Down Expand Up @@ -417,7 +417,7 @@ const execute = (description, getRskHost) => {
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper);
const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, senderRecipientInfo.btcSenderAddressInfo.address);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1WithBtcRefundAddress');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

// Act

Expand Down Expand Up @@ -497,7 +497,7 @@ const execute = (description, getRskHost) => {
const initial2wpBalances = await get2wpBalances(rskTxHelper, btcTxHelper);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper, 'p2sh-segwit', Number(satoshisToBtc(peginValueInSatoshis + btcFeeInSatoshis)));
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('rejectedPeginWithMultipleOpReturnOutputs');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

const data = [];
data.push(Buffer.from(createPeginV1TxData(senderRecipientInfo.rskRecipientRskAddressInfo.address), 'hex'));
Expand Down Expand Up @@ -542,7 +542,7 @@ const execute = (description, getRskHost) => {
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper);
const initialSenderAddressBalanceInSatoshis = await getBtcAddressBalanceInSatoshis(btcTxHelper, senderRecipientInfo.btcSenderAddressInfo.address);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1Multiple_OP_RETURN');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

// Act

Expand Down Expand Up @@ -626,7 +626,7 @@ const execute = (description, getRskHost) => {
const initial2wpBalances = await get2wpBalances(rskTxHelper, btcTxHelper);
const peginValueInSatoshis = minimumPeginValueInSatoshis;
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper, 'p2sh-segwit', Number(satoshisToBtc(peginValueInSatoshis + btcFeeInSatoshis)));
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed('successfulPeginV1InvalidVersion');
const peginV1RskRecipientAddress = await rskTxHelper.newAccountWithSeed(rskTxHelper.getClient().utils.randomHex(16));

const invalidPeginV1Version = '999';
const peginV1InvalidPayload = `${PEGIN_V1_RSKT_PREFIX_HEX}${invalidPeginV1Version}${removePrefix0x(peginV1RskRecipientAddress)}`;
Expand Down
Loading