Skip to content

Commit

Permalink
feat: make lowercase reporter, contract and sign addresses (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayram98 authored Jun 7, 2023
1 parent 45856ff commit cff5759
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions delegator/src/contract/contract.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class ContractService {
constructor(private prisma: PrismaService) {}

async create(data: ContractDto) {
data.address = data.address.toLocaleLowerCase()
return await this.prisma.contract.create({ data })
}

Expand Down
1 change: 1 addition & 0 deletions delegator/src/reporter/reporter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class ReporterService {
constructor(private prisma: PrismaService) {}

async create(reporterDto: ReporterDto) {
reporterDto.address = reporterDto.address.toLocaleLowerCase()
const data: Prisma.ReporterUncheckedCreateInput = {
address: reporterDto.address,
organizationId: reporterDto.organizationId
Expand Down
2 changes: 2 additions & 0 deletions delegator/src/sign/sign.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class SignService {

async create(data: SignDto) {
try {
data.from = data.from.toLocaleLowerCase()
data.to = data.to.toLocaleLowerCase()
const transaction = await this.prisma.transaction.create({ data })
const validatedResult = await this.validateTransaction(transaction)
const signedRawTx = await this.signTxByFeePayer(transaction)
Expand Down

0 comments on commit cff5759

Please sign in to comment.