Skip to content

Commit

Permalink
Undefined -> null
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Dec 30, 2024
1 parent 9a68808 commit bf7c9c6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ describe('Get by id - Transactions Controller (Unit)', () => {
},
txHash: moduleTransaction.transactionHash,
safeAppInfo: null,
note: null,
});
});
});
Expand Down Expand Up @@ -371,6 +372,7 @@ describe('Get by id - Transactions Controller (Unit)', () => {
detailedExecutionInfo: null,
txHash: transfer.transactionHash,
safeAppInfo: null,
note: null,
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ export class TransactionDetails {
@ApiPropertyOptional({ type: SafeAppInfo, nullable: true })
safeAppInfo!: SafeAppInfo | null;
@ApiPropertyOptional({ type: String, nullable: true })
note?: string;
note!: string | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('ModuleTransactionDetails mapper (Unit)', () => {
txHash: transaction.transactionHash,
detailedExecutionInfo: new ModuleExecutionDetails(addressInfo),
safeAppInfo: null,
note: null,
});
});

Expand Down Expand Up @@ -127,6 +128,7 @@ describe('ModuleTransactionDetails mapper (Unit)', () => {
txHash: transaction.transactionHash,
detailedExecutionInfo: new ModuleExecutionDetails(addressInfo),
safeAppInfo: null,
note: null,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class ModuleTransactionDetailsMapper {
txHash: transaction.transactionHash,
detailedExecutionInfo: new ModuleExecutionDetails(moduleAddress),
safeAppInfo: null,
note: null,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Multisig Transaction note mapper (Unit)', () => {

const note = mapper.mapTxNote(transaction);

expect(note).toBeUndefined();
expect(note).toBeNull();
});

it('should return undefined if `origin` does not contain a note', () => {
Expand All @@ -36,7 +36,7 @@ describe('Multisig Transaction note mapper (Unit)', () => {

const note = mapper.mapTxNote(transaction);

expect(note).toBeUndefined();
expect(note).toBeNull();
});

it('should return undefined if `origin` is null', () => {
Expand All @@ -46,6 +46,6 @@ describe('Multisig Transaction note mapper (Unit)', () => {

const note = mapper.mapTxNote(transaction);

expect(note).toBeUndefined();
expect(note).toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MultisigTransaction } from '@/domain/safe/entities/multisig-transaction

@Injectable()
export class MultisigTransactionNoteMapper {
mapTxNote(transaction: MultisigTransaction): string | undefined {
mapTxNote(transaction: MultisigTransaction): string | null {
if (transaction.origin) {
try {
const origin = JSON.parse(transaction.origin);
Expand All @@ -15,5 +15,6 @@ export class MultisigTransactionNoteMapper {
// Ignore, no note
}
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('TransferDetails mapper (Unit)', () => {
detailedExecutionInfo: null,
txHash: transfer.transactionHash,
safeAppInfo: null,
note: null,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class TransferDetailsMapper {
detailedExecutionInfo: null,
txHash: transfer.transactionHash,
safeAppInfo: null,
note: null,
};
}
}

0 comments on commit bf7c9c6

Please sign in to comment.