Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion modules/sdk-coin-vet/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const VET_BLOCK_ID_LENGTH = 64;

export const TRANSFER_TOKEN_METHOD_ID = '0xa9059cbb';
export const STAKING_METHOD_ID = '0xa694fc3a';
export const EXIT_DELEGATION_METHOD_ID = '0x32b7006d';
export const EXIT_DELEGATION_METHOD_ID = '0x3fb7a871';
export const BURN_NFT_METHOD_ID = '0x42966c68';
export const TRANSFER_NFT_METHOD_ID = '0x23b872dd';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class BurnNftTransaction extends Transaction {
}

// Set sender address
if (signedTx.origin) {
if (signedTx.signature && signedTx.origin) {
this.sender = signedTx.origin.toString().toLowerCase();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class ExitDelegationTransaction extends Transaction {
}

// Set sender address
if (signedTx.origin) {
if (signedTx.signature && signedTx.origin) {
this.sender = signedTx.origin.toString().toLowerCase();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export class ExitDelegationBuilder extends TransactionBuilder {
/** @inheritdoc */
protected async buildImplementation(): Promise<Transaction> {
this.transaction.type = this.transactionType;
// Set the transaction data before building
this.exitDelegationTransaction.transactionData = this.getExitDelegationData();
await this.exitDelegationTransaction.build();
return this.transaction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ describe('Vet Burn NFT Transaction', () => {
const txBuilder = factory.getBurnNftBuilder();

// Should throw error when building without required fields
await should(txBuilder.build()).be.rejectedWith('transaction not defined');

txBuilder.sender(testData.addresses.validAddresses[0]);
await should(txBuilder.build()).be.rejectedWith('NFT contract address is required');

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ describe('Vet Exit Delegation Transaction', () => {
const txBuilder = factory.getExitDelegationBuilder();

// Should throw error when building without required fields
await should(txBuilder.build()).be.rejectedWith('transaction not defined');

txBuilder.sender(testData.addresses.validAddresses[0]);
await should(txBuilder.build()).be.rejectedWith('Delegation contract address is required');

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

Expand Down