Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure route CreationTransaction correctly implements that of domain #1874

Merged
merged 1 commit into from
Aug 29, 2024
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
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { DataDecodedParameter as DomainDataDecodedParameter } from '@/domain/data-decoder/entities/data-decoded.entity';
import { ApiProperty } from '@nestjs/swagger';

export class DataDecodedParameter {
export class DataDecodedParameter implements DomainDataDecodedParameter {
@ApiProperty()
name: string;
@ApiProperty()
type: string;
@ApiProperty()
value: unknown;
value: Required<unknown>;
@ApiProperty()
valueDecoded?: Record<string, unknown> | Record<string, unknown>[] | null;
valueDecoded: Record<string, unknown> | Record<string, unknown>[] | null;

constructor(
name: string,
type: string,
value: unknown,
value: Required<unknown>,
valueDecoded: Record<string, unknown> | Record<string, unknown>[] | null,
) {
this.name = name;
Expand Down
3 changes: 2 additions & 1 deletion src/routes/data-decode/entities/data-decoded.entity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { DataDecodedParameter } from '@/routes/data-decode/entities/data-decoded-parameter.entity';
import { DataDecoded as DomainDataDecoded } from '@/domain/data-decoder/entities/data-decoded.entity';

export class DataDecoded {
export class DataDecoded implements DomainDataDecoded {
@ApiProperty()
method: string;
@ApiPropertyOptional({ type: [DataDecodedParameter], nullable: true })
Expand Down
23 changes: 12 additions & 11 deletions src/routes/transactions/entities/creation-transaction.entity.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import { CreationTransaction as DomainCreationTransaction } from '@/domain/safe/entities/creation-transaction.entity';
import { DataDecoded } from '@/routes/data-decode/entities/data-decoded.entity';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreationTransaction {
export class CreationTransaction implements DomainCreationTransaction {
@ApiProperty()
created: Date;
@ApiProperty()
creator: string;
creator: `0x${string}`;
@ApiProperty()
transactionHash: string;
transactionHash: `0x${string}`;
@ApiProperty()
factoryAddress: string;
factoryAddress: `0x${string}`;
@ApiPropertyOptional({ type: String, nullable: true })
masterCopy: string | null;
masterCopy: `0x${string}` | null;
@ApiPropertyOptional({ type: String, nullable: true })
setupData: string | null;
setupData: `0x${string}` | null;
@ApiPropertyOptional({ type: DataDecoded, nullable: true })
dataDecoded: DataDecoded | null;

constructor(
created: Date,
creator: string,
transactionHash: string,
factoryAddress: string,
masterCopy: string | null,
setupData: string | null,
creator: `0x${string}`,
transactionHash: `0x${string}`,
factoryAddress: `0x${string}`,
masterCopy: `0x${string}` | null,
setupData: `0x${string}` | null,
dataDecoded: DataDecoded | null,
) {
this.created = created;
Expand Down
Loading