Skip to content

Commit 30c4502

Browse files
authored
Merge pull request #6894 from BitGo/SC-2858
fix: failing vechain tests
2 parents 7147059 + 6af94ac commit 30c4502

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

modules/sdk-coin-vet/src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const VET_BLOCK_ID_LENGTH = 64;
44

55
export const TRANSFER_TOKEN_METHOD_ID = '0xa9059cbb';
66
export const STAKING_METHOD_ID = '0xa694fc3a';
7-
export const EXIT_DELEGATION_METHOD_ID = '0x32b7006d';
7+
export const EXIT_DELEGATION_METHOD_ID = '0x3fb7a871';
88
export const BURN_NFT_METHOD_ID = '0x42966c68';
99
export const TRANSFER_NFT_METHOD_ID = '0x23b872dd';
1010

modules/sdk-coin-vet/src/lib/transaction/burnNftTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class BurnNftTransaction extends Transaction {
116116
}
117117

118118
// Set sender address
119-
if (signedTx.origin) {
119+
if (signedTx.signature && signedTx.origin) {
120120
this.sender = signedTx.origin.toString().toLowerCase();
121121
}
122122

modules/sdk-coin-vet/src/lib/transaction/exitDelegation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class ExitDelegationTransaction extends Transaction {
116116
}
117117

118118
// Set sender address
119-
if (signedTx.origin) {
119+
if (signedTx.signature && signedTx.origin) {
120120
this.sender = signedTx.origin.toString().toLowerCase();
121121
}
122122

modules/sdk-coin-vet/src/lib/transactionBuilder/exitDelegationBuilder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export class ExitDelegationBuilder extends TransactionBuilder {
120120
/** @inheritdoc */
121121
protected async buildImplementation(): Promise<Transaction> {
122122
this.transaction.type = this.transactionType;
123+
// Set the transaction data before building
124+
this.exitDelegationTransaction.transactionData = this.getExitDelegationData();
123125
await this.exitDelegationTransaction.build();
124126
return this.transaction;
125127
}

modules/sdk-coin-vet/test/transactionBuilder/burnNftBuilder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ describe('Vet Burn NFT Transaction', () => {
9292
const txBuilder = factory.getBurnNftBuilder();
9393

9494
// Should throw error when building without required fields
95-
await should(txBuilder.build()).be.rejectedWith('transaction not defined');
96-
97-
txBuilder.sender(testData.addresses.validAddresses[0]);
9895
await should(txBuilder.build()).be.rejectedWith('NFT contract address is required');
9996

97+
txBuilder.sender(testData.addresses.validAddresses[0]);
10098
txBuilder.nftContract();
10199
await should(txBuilder.build()).be.rejectedWith('Token ID is required');
102100

modules/sdk-coin-vet/test/transactionBuilder/exitDelegationBuilder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ describe('Vet Exit Delegation Transaction', () => {
9797
const txBuilder = factory.getExitDelegationBuilder();
9898

9999
// Should throw error when building without required fields
100-
await should(txBuilder.build()).be.rejectedWith('transaction not defined');
101-
102-
txBuilder.sender(testData.addresses.validAddresses[0]);
103100
await should(txBuilder.build()).be.rejectedWith('Delegation contract address is required');
104101

102+
txBuilder.sender(testData.addresses.validAddresses[0]);
105103
txBuilder.delegationContract();
106104
await should(txBuilder.build()).be.rejectedWith('Token ID is required');
107105

0 commit comments

Comments
 (0)