Skip to content

Commit 9941476

Browse files
authored
Merge pull request #6653 from BitGo/COIN-5030-fix-ecdsa-tests
fix: skipped tests fix for ecdsa
2 parents 2a9e8a5 + 060cb25 commit 9941476

File tree

1 file changed

+32
-11
lines changed
  • modules/bitgo/test/v2/unit/internal/tssUtils

1 file changed

+32
-11
lines changed

modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,18 @@ describe('TSS Ecdsa Utils:', async function () {
770770
userGpgActual.should.startWith('-----BEGIN PGP PUBLIC KEY BLOCK-----');
771771
});
772772

773-
// TODO(COIN-5030): fix this test as disabled this during hoodi onboarding
774-
xit('signTxRequest should fail with wrong recipient', async function () {
775-
await setupSignTxRequestNocks(true, userSignShare, aShare, dShare, enterpriseData);
773+
it('signTxRequest should fail with wrong recipient', async function () {
774+
// To generate these Hex values, we used the bitgo-ui to create a transaction and then
775+
// used the `signableHex` and `serializedTxHex` values from the prebuild.
776+
const signableHex =
777+
'02f283088bb0038406f18758847f3443c683016378949726ea58be57b153791a8ff5b282d776aaf28e3c87038d7ea4c6800080c0';
778+
const serializedTxHex =
779+
'02f583088bb0038406f18758847f3443c683016378949726ea58be57b153791a8ff5b282d776aaf28e3c87038d7ea4c6800080c0808080';
780+
await setupSignTxRequestNocks(true, userSignShare, aShare, dShare, enterpriseData, {
781+
signableHex,
782+
serializedTxHex,
783+
apiVersion: 'full',
784+
});
776785
await tssUtils
777786
.signTxRequest({
778787
txRequest: txRequestId,
@@ -782,14 +791,24 @@ describe('TSS Ecdsa Utils:', async function () {
782791
backupNShare: backupKeyShare.nShares[1],
783792
}),
784793
reqId,
785-
txParams: { recipients: [{ address: '0x1234', amount: '100000000000000' }], type: 'transfer' },
794+
txParams: { recipients: [{ address: '0x1234', amount: '1000000000000000' }], type: 'transfer' },
786795
})
787796
.should.be.rejectedWith('destination address does not match with the recipient address');
788797
});
789798

790-
// TODO(COIN-5030): fix this test as disabled this during hoodi onboarding
791-
xit('signTxRequest should fail with incorrect value', async function () {
792-
await setupSignTxRequestNocks(true, userSignShare, aShare, dShare, enterpriseData);
799+
it('signTxRequest should fail with incorrect value', async function () {
800+
nock.cleanAll();
801+
// To generate these Hex values, we used the bitgo-ui to create a transaction and then
802+
// used the `signableHex` and `serializedTxHex` values from the prebuild.
803+
const signableHex =
804+
'02f283088bb0038406f18758847f3443c683016378949726ea58be57b153791a8ff5b282d776aaf28e3c87038d7ea4c6800080c0';
805+
const serializedTxHex =
806+
'02f583088bb0038406f18758847f3443c683016378949726ea58be57b153791a8ff5b282d776aaf28e3c87038d7ea4c6800080c0808080';
807+
await setupSignTxRequestNocks(true, userSignShare, aShare, dShare, enterpriseData, {
808+
signableHex,
809+
serializedTxHex,
810+
apiVersion: 'full',
811+
});
793812
await tssUtils
794813
.signTxRequest({
795814
txRequest: txRequestId,
@@ -807,12 +826,14 @@ describe('TSS Ecdsa Utils:', async function () {
807826
.should.be.rejectedWith('the transaction amount in txPrebuild does not match the value given by client');
808827
});
809828

810-
// TODO(COIN-5030): fix this test as disabled this during hoodi onboarding
811-
xit('signTxRequest should fail with incorrect value for token txn', async function () {
829+
it('signTxRequest should fail with incorrect value for token txn', async function () {
830+
nock.cleanAll();
831+
// To generate these Hex values, we used the bitgo-ui to create a transaction and then
832+
// used the `signableHex` and `serializedTxHex` values from the prebuild.
812833
const signableHex =
813-
'02f86d8242681083122c9e83122cae8301e04994ebe8b46a42f05072b723b00013ff822b2af1b5cb80b844a9059cbb0000000000000000000000002b0d6cb2f8c388757f4d7ad857fccab18290dbc900000000000000000000000000000000000000000000000000000000000186a0c0';
834+
'02f86f83088bb00283e1d7dd84768ea6898301e04b94d9327fd36c3312466efed23ff0493453ee32f55180b844a9059cbb0000000000000000000000007d7e63af583ba73ba5c927dbd028153963566bef00000000000000000000000000000000000000000000000000470de4df820000c0';
814835
const serializedTxHex =
815-
'02f8708242681083122c9e83122cae8301e04994ebe8b46a42f05072b723b00013ff822b2af1b5cb80b844a9059cbb0000000000000000000000002b0d6cb2f8c388757f4d7ad857fccab18290dbc900000000000000000000000000000000000000000000000000000000000186a0c0808080';
836+
'02f87283088bb00283e1d7dd84768ea6898301e04b94d9327fd36c3312466efed23ff0493453ee32f55180b844a9059cbb0000000000000000000000007d7e63af583ba73ba5c927dbd028153963566bef00000000000000000000000000000000000000000000000000470de4df820000c0808080';
816837
await setupSignTxRequestNocks(true, userSignShare, aShare, dShare, enterpriseData, {
817838
signableHex,
818839
serializedTxHex,

0 commit comments

Comments
 (0)