Skip to content

Commit

Permalink
Make CreationTransaction['saltNonce'] nullable (#2054)
Browse files Browse the repository at this point in the history
Adjusts the expected value of `saltNonce` to be `string | null`.
  • Loading branch information
iamacook authored Oct 24, 2024
1 parent fc2bdec commit 85e2d8b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('CreationTransactionSchema', () => {
'masterCopy' as const,
'setupData' as const,
'dataDecoded' as const,
'saltNonce' as const,
])('should allow an optional %s', (field) => {
const creationTransaction = creationTransactionBuilder().build();
delete creationTransaction[field];
Expand Down Expand Up @@ -101,7 +102,6 @@ describe('CreationTransactionSchema', () => {
'creator' as const,
'transactionHash' as const,
'factoryAddress' as const,
'saltNonce' as const,
])('should not allow an undefined %s', (field) => {
const creationTransaction = creationTransactionBuilder().build();
delete creationTransaction[field];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export const CreationTransactionSchema = z.object({
factoryAddress: AddressSchema,
masterCopy: AddressSchema.nullish().default(null),
setupData: HexSchema.nullish().default(null),
saltNonce: z.string(),
saltNonce: z.string().nullish().default(null),
dataDecoded: DataDecodedSchema.nullish().default(null),
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export class CreationTransactionInfo extends TransactionInfo {
implementation: AddressInfo | null;
@ApiPropertyOptional({ type: AddressInfo, nullable: true })
factory: AddressInfo | null;
@ApiProperty()
saltNonce: string;
@ApiPropertyOptional({ type: String, nullable: true })
saltNonce: string | null;

constructor(
creator: AddressInfo,
transactionHash: string,
implementation: AddressInfo | null,
factory: AddressInfo | null,
saltNonce: string,
saltNonce: string | null,
) {
super(TransactionInfoType.Creation, null, null);
this.creator = creator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class CreationTransaction implements DomainCreationTransaction {
masterCopy: `0x${string}` | null;
@ApiPropertyOptional({ type: String, nullable: true })
setupData: `0x${string}` | null;
@ApiProperty()
saltNonce: string;
@ApiPropertyOptional({ type: String, nullable: true })
saltNonce: string | null;
@ApiPropertyOptional({ type: DataDecoded, nullable: true })
dataDecoded: DataDecoded | null;

Expand All @@ -27,7 +27,7 @@ export class CreationTransaction implements DomainCreationTransaction {
factoryAddress: `0x${string}`,
masterCopy: `0x${string}` | null,
setupData: `0x${string}` | null,
saltNonce: string,
saltNonce: string | null,
dataDecoded: DataDecoded | null,
) {
this.created = created;
Expand Down

0 comments on commit 85e2d8b

Please sign in to comment.