Skip to content

Commit

Permalink
Use prefixed hex
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastijankuzner committed Mar 1, 2024
1 parent c41bf03 commit 77bf521
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/api-evm/source/actions/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class CallAction implements Contracts.Api.RPC.Action {
{
additionalProperties: false,
properties: {
data: { type: "string" },
data: { $ref: "0xHex" },
from: { $ref: "address" },
to: { $ref: "address" },
},
Expand Down
7 changes: 6 additions & 1 deletion packages/crypto-validation/source/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SchemaObject } from "ajv";

export const schemas: Record<"alphanumeric" | "hex", SchemaObject> = {
export const schemas: Record<"alphanumeric" | "hex" | "prefixedHex", SchemaObject> = {
alphanumeric: {
$id: "alphanumeric",
pattern: "^[a-z0-9]+$",
Expand All @@ -11,4 +11,9 @@ export const schemas: Record<"alphanumeric" | "hex", SchemaObject> = {
pattern: "^[0123456789a-f]+$",
type: "string",
},
prefixedHex: {
$id: "0xHex",
pattern: "^0x[0-9a-f]+$",
type: "string",
},
};

0 comments on commit 77bf521

Please sign in to comment.