-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
214 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
*.local | ||
.DS_Store | ||
.next | ||
.attest | ||
.env | ||
.env.*local | ||
.envrc | ||
.pnpm-debug.log* | ||
bench | ||
cache | ||
coverage | ||
dist | ||
node_modules | ||
tsconfig*.tsbuildinfo | ||
bench | ||
playgrounds/performance/out | ||
# temporary type-testing cache | ||
.attest | ||
|
||
# local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.envrc | ||
|
||
# proxy packages | ||
packages/abitype/abis | ||
packages/abitype/zod | ||
packages/abitype/zod | ||
playgrounds/performance/out | ||
tsconfig*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { bench } from "@arktype/attest"; | ||
import { | ||
type AbiParameterToPrimitiveType, | ||
type AbiParametersToPrimitiveTypes, | ||
type TypedDataToPrimitiveTypes, | ||
} from "./utils.js"; | ||
|
||
bench("AbiParameterToPrimitiveType > nested", () => { | ||
const abiParameter = { | ||
name: "s", | ||
type: "tuple", | ||
components: [ | ||
{ name: "a", type: "uint8" }, | ||
{ name: "b", type: "uint8[2]" }, | ||
{ | ||
name: "c", | ||
type: "tuple[]", | ||
components: [ | ||
{ name: "x", type: "uint256" }, | ||
{ | ||
name: "y", | ||
type: "tuple", | ||
components: [{ name: "a", type: "string" }], | ||
}, | ||
], | ||
}, | ||
], | ||
} as const; | ||
return {} as AbiParameterToPrimitiveType<typeof abiParameter>; | ||
}).types([28, "instantiations"]); | ||
|
||
bench("AbiParametersToPrimitiveTypes > nested", () => { | ||
const abiParameters = [ | ||
{ | ||
name: "s", | ||
type: "tuple", | ||
components: [ | ||
{ name: "a", type: "uint8" }, | ||
{ name: "b", type: "uint8[]" }, | ||
{ | ||
name: "c", | ||
type: "tuple[]", | ||
components: [ | ||
{ name: "x", type: "uint8" }, | ||
{ name: "y", type: "uint8" }, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "t", | ||
type: "tuple", | ||
components: [ | ||
{ name: "x", type: "uint8" }, | ||
{ name: "y", type: "uint8" }, | ||
], | ||
}, | ||
{ name: "a", type: "uint8" }, | ||
{ | ||
name: "t", | ||
type: "tuple[2]", | ||
components: [ | ||
{ name: "x", type: "uint256" }, | ||
{ name: "y", type: "uint256" }, | ||
], | ||
}, | ||
] as const; | ||
return {} as AbiParametersToPrimitiveTypes<typeof abiParameters>; | ||
}).types([56, "instantiations"]); | ||
|
||
bench("TypedDataToPrimitiveTypes > recursive", () => { | ||
const types = { | ||
Foo: [{ name: "bar", type: "Bar[]" }], | ||
Bar: [{ name: "foo", type: "Foo[]" }], | ||
} as const; | ||
return {} as TypedDataToPrimitiveTypes<typeof types>; | ||
}).types([12, "instantiations"]); | ||
|
||
bench("TypedDataToPrimitiveTypes > deep", () => { | ||
const types = { | ||
Contributor: [ | ||
{ name: "name", type: "string" }, | ||
{ name: "address", type: "address" }, | ||
], | ||
Website: [ | ||
{ name: "domain", type: "string" }, | ||
{ name: "webmaster", type: "Contributor" }, | ||
], | ||
Project: [ | ||
{ name: "name", type: "string" }, | ||
{ name: "contributors", type: "Contributor[2]" }, | ||
{ name: "website", type: "Website" }, | ||
], | ||
Organization: [ | ||
{ name: "name", type: "string" }, | ||
{ name: "projects", type: "Project[]" }, | ||
{ name: "website", type: "Website" }, | ||
], | ||
} as const; | ||
return {} as TypedDataToPrimitiveTypes<typeof types>; | ||
}).types([44, "instantiations"]); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { cleanup, setup } from '@arktype/attest' | ||
|
||
export default () => { | ||
export default function () { | ||
setup() | ||
return cleanup | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
0f5d67d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
abitype – ./
abitype-wagmi-dev.vercel.app
abitype.vercel.app
abitype-git-main-wagmi-dev.vercel.app
abitype.dev