Skip to content

Commit

Permalink
[Backend] minor fixes (#100)
Browse files Browse the repository at this point in the history
* add address padding on tx hash

* allow smaller public keys

* improve public key regex pattern
  • Loading branch information
0xChqrles authored Jul 3, 2024
1 parent 866e29c commit 19b8db4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/src/routes/executeFromOutside.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FastifyInstance } from 'fastify'
import { type Account } from 'starknet'
import { type Account, addAddressPadding } from 'starknet'

import { Entrypoint } from '@/constants/contracts'

Expand Down Expand Up @@ -54,7 +54,7 @@ export function getExecuteFromOutsideRoute(fastify: FastifyInstance, deployer: A
}

return reply.code(200).send({
transaction_hash,
transaction_hash: addAddressPadding(transaction_hash),
})
} catch (error) {
fastify.log.error(error)
Expand Down
4 changes: 2 additions & 2 deletions backend/src/routes/verifyOtp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function verifyOtp(
properties: {
phone_number: { type: 'string', pattern: '^\\+[1-9]\\d{1,14}$' },
sent_otp: { type: 'string', pattern: '^[0-9]{6}$' },
public_key_x: { type: 'string', pattern: '^0x[0-9a-fA-F]{64}$' },
public_key_y: { type: 'string', pattern: '^0x[0-9a-fA-F]{64}$' },
public_key_x: { type: 'string', pattern: '^0x[0-9a-fA-F]+$' },
public_key_y: { type: 'string', pattern: '^0x[0-9a-fA-F]+$' },
},
},
},
Expand Down

0 comments on commit 19b8db4

Please sign in to comment.