@kontor/kontor-sdk 1.0.0-alpha.1 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sdk/actions/kontor/wallet/sign-reveal.js +10 -14
- package/dist/cjs/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
- package/dist/cjs/sdk/actions/public/test-mempool-accept.js +10 -0
- package/dist/cjs/sdk/actions/public/test-mempool-accept.js.map +1 -1
- package/dist/cjs/sdk/clients/decorators/public.js +2 -0
- package/dist/cjs/sdk/clients/decorators/public.js.map +1 -1
- package/dist/cjs/sdk/clients/transports/custom.js.map +1 -1
- package/dist/cjs/sdk/utils/build-rpc-request.js +1 -0
- package/dist/cjs/sdk/utils/build-rpc-request.js.map +1 -1
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/sdk/actions/kontor/wallet/sign-reveal.js +37 -23
- package/dist/esm/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
- package/dist/esm/sdk/actions/public/test-mempool-accept.js +8 -32
- package/dist/esm/sdk/actions/public/test-mempool-accept.js.map +1 -1
- package/dist/esm/sdk/clients/decorators/public.js +2 -0
- package/dist/esm/sdk/clients/decorators/public.js.map +1 -1
- package/dist/esm/sdk/clients/transports/custom.js.map +1 -1
- package/dist/esm/sdk/utils/build-rpc-request.js +1 -0
- package/dist/esm/sdk/utils/build-rpc-request.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/src/sdk/actions/kontor/public/build-compose-call.js +5 -6
- package/dist/src/sdk/actions/kontor/public/build-compose-call.js.map +1 -1
- package/dist/src/sdk/actions/kontor/public/build-compose-query.js +30 -0
- package/dist/src/sdk/actions/kontor/public/build-compose-query.js.map +1 -0
- package/dist/src/sdk/actions/kontor/public/build-instruction-query.js +45 -0
- package/dist/src/sdk/actions/kontor/public/build-instruction-query.js.map +1 -0
- package/dist/src/sdk/actions/kontor/public/build-instruction.js +13 -16
- package/dist/src/sdk/actions/kontor/public/build-instruction.js.map +1 -1
- package/dist/src/sdk/actions/kontor/public/call-compose.js +38 -0
- package/dist/src/sdk/actions/kontor/public/call-compose.js.map +1 -0
- package/dist/src/sdk/actions/kontor/public/call-proc.js +6 -2
- package/dist/src/sdk/actions/kontor/public/call-proc.js.map +1 -1
- package/dist/src/sdk/actions/kontor/public/proc-contract.js +8 -5
- package/dist/src/sdk/actions/kontor/public/proc-contract.js.map +1 -1
- package/dist/src/sdk/actions/kontor/wallet/sign-reveal.js +37 -25
- package/dist/src/sdk/actions/kontor/wallet/sign-reveal.js.map +1 -1
- package/dist/src/sdk/clients/decorators/kontor/public.js +6 -6
- package/dist/src/sdk/clients/decorators/kontor/public.js.map +1 -1
- package/dist/src/sdk/types/kontor.js +27 -1
- package/dist/src/sdk/types/kontor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/sdk/actions/kontor/wallet/sign-reveal.d.ts.map +1 -1
- package/dist/types/sdk/actions/public/test-mempool-accept.d.ts +14 -1
- package/dist/types/sdk/actions/public/test-mempool-accept.d.ts.map +1 -1
- package/dist/types/sdk/clients/decorators/public.d.ts +2 -0
- package/dist/types/sdk/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/sdk/clients/transports/custom.d.ts.map +1 -1
- package/dist/types/sdk/types/btc-rpc.d.ts +9 -1
- package/dist/types/sdk/types/btc-rpc.d.ts.map +1 -1
- package/dist/types/sdk/utils/build-rpc-request.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/sdk/actions/kontor/public/{build-compose-call.ts → build-compose-query.ts} +15 -25
- package/src/sdk/actions/kontor/public/{build-instruction.ts → build-instruction-query.ts} +35 -29
- package/src/sdk/actions/kontor/public/{call-proc.ts → call-compose.ts} +16 -19
- package/src/sdk/actions/kontor/public/proc-contract.ts +9 -6
- package/src/sdk/actions/kontor/wallet/sign-reveal.ts +49 -28
- package/src/sdk/actions/public/test-mempool-accept.ts +34 -31
- package/src/sdk/clients/decorators/kontor/public.ts +23 -23
- package/src/sdk/clients/decorators/public.ts +11 -0
- package/src/sdk/test/e2e.test.ts +193 -15
- package/src/sdk/types/btc-rpc.ts +12 -11
- package/src/sdk/types/kontor.ts +38 -0
- package/dist/src/exports/index.test.js +0 -10
- package/dist/src/exports/index.test.js.map +0 -1
- package/dist/src/sdk/accounts/hd-key-to-account.js +0 -20
- package/dist/src/sdk/accounts/hd-key-to-account.js.map +0 -1
- package/dist/src/sdk/accounts/mnemonic-to-account.js +0 -16
- package/dist/src/sdk/accounts/mnemonic-to-account.js.map +0 -1
- package/dist/src/sdk/accounts/mnemonic-to-account.test.js +0 -96
- package/dist/src/sdk/accounts/mnemonic-to-account.test.js.map +0 -1
- package/dist/src/sdk/accounts/to-local-account.js +0 -28
- package/dist/src/sdk/accounts/to-local-account.js.map +0 -1
- package/dist/src/sdk/accounts/types.js +0 -2
- package/dist/src/sdk/accounts/types.js.map +0 -1
- package/dist/src/sdk/accounts/utils/parse-account.js +0 -10
- package/dist/src/sdk/accounts/utils/parse-account.js.map +0 -1
- package/dist/src/sdk/accounts/utils/public-key-to-p2tr-payment.js +0 -14
- package/dist/src/sdk/accounts/utils/public-key-to-p2tr-payment.js.map +0 -1
- package/dist/src/sdk/accounts/utils/sign-psbt.js +0 -17
- package/dist/src/sdk/accounts/utils/sign-psbt.js.map +0 -1
- package/dist/src/sdk/actions/kontor/wallet/sign-commit.js +0 -34
- package/dist/src/sdk/actions/kontor/wallet/sign-commit.js.map +0 -1
- package/dist/src/sdk/actions/public/send-raw-transaction.js +0 -7
- package/dist/src/sdk/actions/public/send-raw-transaction.js.map +0 -1
- package/dist/src/sdk/actions/public/test-mempool-accept.js +0 -44
- package/dist/src/sdk/actions/public/test-mempool-accept.js.map +0 -1
- package/dist/src/sdk/chains/definitions/index.js +0 -2
- package/dist/src/sdk/chains/definitions/index.js.map +0 -1
- package/dist/src/sdk/chains/definitions/signet.js +0 -36
- package/dist/src/sdk/chains/definitions/signet.js.map +0 -1
- package/dist/src/sdk/clients/base/create-rpc-client.test.js +0 -145
- package/dist/src/sdk/clients/base/create-rpc-client.test.js.map +0 -1
- package/dist/src/sdk/clients/create-public-client.test.js +0 -113
- package/dist/src/sdk/clients/create-public-client.test.js.map +0 -1
- package/dist/src/sdk/clients/decorators/kontor/wallet.js +0 -13
- package/dist/src/sdk/clients/decorators/kontor/wallet.js.map +0 -1
- package/dist/src/sdk/clients/decorators/public.js +0 -7
- package/dist/src/sdk/clients/decorators/public.js.map +0 -1
- package/dist/src/sdk/clients/decorators/wallet.js +0 -9
- package/dist/src/sdk/clients/decorators/wallet.js.map +0 -1
- package/dist/src/sdk/clients/kontor/create-public-client.test.js +0 -44
- package/dist/src/sdk/clients/kontor/create-public-client.test.js.map +0 -1
- package/dist/src/sdk/clients/kontor/create-wallet-client.js +0 -14
- package/dist/src/sdk/clients/kontor/create-wallet-client.js.map +0 -1
- package/dist/src/sdk/clients/transports/create-http-transport.js +0 -25
- package/dist/src/sdk/clients/transports/create-http-transport.js.map +0 -1
- package/dist/src/sdk/clients/transports/create-rpc-transport.test.js +0 -58
- package/dist/src/sdk/clients/transports/create-rpc-transport.test.js.map +0 -1
- package/dist/src/sdk/clients/transports/custom.js +0 -14
- package/dist/src/sdk/clients/transports/custom.js.map +0 -1
- package/dist/src/sdk/clients/transports/http-rpc.js +0 -84
- package/dist/src/sdk/clients/transports/http-rpc.js.map +0 -1
- package/dist/src/sdk/clients/transports/http-rpc.test.js +0 -147
- package/dist/src/sdk/clients/transports/http-rpc.test.js.map +0 -1
- package/dist/src/sdk/clients/transports/http.js +0 -45
- package/dist/src/sdk/clients/transports/http.js.map +0 -1
- package/dist/src/sdk/contracts/wits.js +0 -26
- package/dist/src/sdk/contracts/wits.js.map +0 -1
- package/dist/src/sdk/errors/address.js +0 -13
- package/dist/src/sdk/errors/address.js.map +0 -1
- package/dist/src/sdk/errors/base.js +0 -92
- package/dist/src/sdk/errors/base.js.map +0 -1
- package/dist/src/sdk/errors/request.js +0 -100
- package/dist/src/sdk/errors/request.js.map +0 -1
- package/dist/src/sdk/errors/rpc.js +0 -30
- package/dist/src/sdk/errors/rpc.js.map +0 -1
- package/dist/src/sdk/errors/transport.js +0 -10
- package/dist/src/sdk/errors/transport.js.map +0 -1
- package/dist/src/sdk/errors/utils.js +0 -2
- package/dist/src/sdk/errors/utils.js.map +0 -1
- package/dist/src/sdk/errors/version.js +0 -2
- package/dist/src/sdk/errors/version.js.map +0 -1
- package/dist/src/sdk/errors/wit.js +0 -19
- package/dist/src/sdk/errors/wit.js.map +0 -1
- package/dist/src/sdk/test/e2e.test.js +0 -75
- package/dist/src/sdk/test/e2e.test.js.map +0 -1
- package/dist/src/sdk/types/account.js +0 -2
- package/dist/src/sdk/types/account.js.map +0 -1
- package/dist/src/sdk/types/btc-rpc.js +0 -2
- package/dist/src/sdk/types/btc-rpc.js.map +0 -1
- package/dist/src/sdk/types/contract.test-d.js +0 -35
- package/dist/src/sdk/types/contract.test-d.js.map +0 -1
- package/dist/src/sdk/types/http-schema.test-d.js +0 -133
- package/dist/src/sdk/types/http-schema.test-d.js.map +0 -1
- package/dist/src/sdk/types/misc.js +0 -2
- package/dist/src/sdk/types/misc.js.map +0 -1
- package/dist/src/sdk/types/rpc.js +0 -19
- package/dist/src/sdk/types/rpc.js.map +0 -1
- package/dist/src/sdk/types/utils.js +0 -2
- package/dist/src/sdk/types/utils.js.map +0 -1
- package/dist/src/sdk/types/wbip001.js +0 -3
- package/dist/src/sdk/types/wbip001.js.map +0 -1
- package/dist/src/sdk/utils/build-http-request.js +0 -55
- package/dist/src/sdk/utils/build-http-request.js.map +0 -1
- package/dist/src/sdk/utils/build-request.js +0 -35
- package/dist/src/sdk/utils/build-request.js.map +0 -1
- package/dist/src/sdk/utils/build-rpc-request.js +0 -84
- package/dist/src/sdk/utils/build-rpc-request.js.map +0 -1
- package/dist/src/sdk/utils/encoding/to-hex.js +0 -23
- package/dist/src/sdk/utils/encoding/to-hex.js.map +0 -1
- package/dist/src/sdk/utils/get-action.js +0 -27
- package/dist/src/sdk/utils/get-action.js.map +0 -1
- package/dist/src/sdk/utils/http.js +0 -137
- package/dist/src/sdk/utils/http.js.map +0 -1
- package/dist/src/sdk/utils/lru.js +0 -35
- package/dist/src/sdk/utils/lru.js.map +0 -1
- package/dist/src/sdk/utils/promise/create-batch-scheduler.js +0 -49
- package/dist/src/sdk/utils/promise/create-batch-scheduler.js.map +0 -1
- package/dist/src/sdk/utils/promise/with-dedupe.js +0 -14
- package/dist/src/sdk/utils/promise/with-dedupe.js.map +0 -1
- package/dist/src/sdk/utils/promise/with-resolvers.js +0 -10
- package/dist/src/sdk/utils/promise/with-resolvers.js.map +0 -1
- package/dist/src/sdk/utils/promise/with-retry.js +0 -25
- package/dist/src/sdk/utils/promise/with-retry.js.map +0 -1
- package/dist/src/sdk/utils/promise/with-timeout.js +0 -30
- package/dist/src/sdk/utils/promise/with-timeout.js.map +0 -1
- package/dist/src/sdk/utils/rpc/http.js +0 -86
- package/dist/src/sdk/utils/rpc/http.js.map +0 -1
- package/dist/src/sdk/utils/rpc/id.js +0 -13
- package/dist/src/sdk/utils/rpc/id.js.map +0 -1
- package/dist/src/sdk/utils/stringify.js +0 -5
- package/dist/src/sdk/utils/stringify.js.map +0 -1
- package/dist/src/sdk/utils/uid.js +0 -14
- package/dist/src/sdk/utils/uid.js.map +0 -1
- package/dist/src/sdk/utils/wait.js +0 -4
- package/dist/src/sdk/utils/wait.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/decimal.js +0 -165
- package/dist/src/sdk/utils/wit/codecs/decimal.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/enum.js +0 -104
- package/dist/src/sdk/utils/wit/codecs/enum.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/integer.js +0 -167
- package/dist/src/sdk/utils/wit/codecs/integer.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/list.js +0 -117
- package/dist/src/sdk/utils/wit/codecs/list.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/option.js +0 -91
- package/dist/src/sdk/utils/wit/codecs/option.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/string.js +0 -27
- package/dist/src/sdk/utils/wit/codecs/string.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/types.js +0 -45
- package/dist/src/sdk/utils/wit/codecs/types.js.map +0 -1
- package/dist/src/sdk/utils/wit/codecs/unit.js +0 -22
- package/dist/src/sdk/utils/wit/codecs/unit.js.map +0 -1
- package/dist/src/sdk/utils/wit/decode-function-result.js +0 -36
- package/dist/src/sdk/utils/wit/decode-function-result.js.map +0 -1
- package/dist/src/sdk/utils/wit/decode-wit-parameter.js +0 -286
- package/dist/src/sdk/utils/wit/decode-wit-parameter.js.map +0 -1
- package/dist/src/sdk/utils/wit/decode-wit-parameter.test.js +0 -75
- package/dist/src/sdk/utils/wit/decode-wit-parameter.test.js.map +0 -1
- package/dist/src/sdk/utils/wit/encode-function-data.js +0 -17
- package/dist/src/sdk/utils/wit/encode-function-data.js.map +0 -1
- package/dist/src/sdk/utils/wit/encode-function-data.test-d.js +0 -21
- package/dist/src/sdk/utils/wit/encode-function-data.test-d.js.map +0 -1
- package/dist/src/sdk/utils/wit/encode-function-data.test.js +0 -91
- package/dist/src/sdk/utils/wit/encode-function-data.test.js.map +0 -1
- package/dist/src/sdk/utils/wit/encode-wit-parameters.js +0 -250
- package/dist/src/sdk/utils/wit/encode-wit-parameters.js.map +0 -1
- package/dist/src/sdk/utils/wit/encode-wit-parameters.test.js +0 -62
- package/dist/src/sdk/utils/wit/encode-wit-parameters.test.js.map +0 -1
- package/dist/src/sdk/utils/wit/get-wit-item.js +0 -15
- package/dist/src/sdk/utils/wit/get-wit-item.js.map +0 -1
- package/dist/src/sdk/utils/wit/get-wit-item.test.js +0 -118
- package/dist/src/sdk/utils/wit/get-wit-item.test.js.map +0 -1
- package/dist/src/sdk/utils/wit/prepare-encode-function-data.js +0 -24
- package/dist/src/sdk/utils/wit/prepare-encode-function-data.js.map +0 -1
- package/dist/src/wit/error.js +0 -59
- package/dist/src/wit/error.js.map +0 -1
- package/dist/src/wit/narrow.js +0 -14
- package/dist/src/wit/narrow.js.map +0 -1
- package/dist/src/wit/regex.js +0 -6
- package/dist/src/wit/regex.js.map +0 -1
- package/dist/src/wit/register.js +0 -2
- package/dist/src/wit/register.js.map +0 -1
- package/dist/src/wit/type-utils.js +0 -2
- package/dist/src/wit/type-utils.js.map +0 -1
- package/dist/src/wit/utils.js +0 -2
- package/dist/src/wit/utils.js.map +0 -1
- package/dist/src/wit/utils.test-d.js +0 -16
- package/dist/src/wit/utils.test-d.js.map +0 -1
- package/dist/src/wit/version.js +0 -2
- package/dist/src/wit/version.js.map +0 -1
- package/dist/src/wit/wit-parser/core/errors/signature.js +0 -42
- package/dist/src/wit/wit-parser/core/errors/signature.js.map +0 -1
- package/dist/src/wit/wit-parser/core/errors/splitParameters.js +0 -18
- package/dist/src/wit/wit-parser/core/errors/splitParameters.js.map +0 -1
- package/dist/src/wit/wit-parser/core/errors/wit-parameter.js +0 -29
- package/dist/src/wit/wit-parser/core/errors/wit-parameter.js.map +0 -1
- package/dist/src/wit/wit-parser/core/records.js +0 -73
- package/dist/src/wit/wit-parser/core/records.js.map +0 -1
- package/dist/src/wit/wit-parser/core/records.test.js +0 -53
- package/dist/src/wit/wit-parser/core/records.test.js.map +0 -1
- package/dist/src/wit/wit-parser/core/signatures.js +0 -32
- package/dist/src/wit/wit-parser/core/signatures.js.map +0 -1
- package/dist/src/wit/wit-parser/core/signatures.test.js +0 -54
- package/dist/src/wit/wit-parser/core/signatures.test.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/records.js +0 -2
- package/dist/src/wit/wit-parser/core/types/records.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/records.test-d.js +0 -19
- package/dist/src/wit/wit-parser/core/types/records.test-d.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/signatures.js +0 -3
- package/dist/src/wit/wit-parser/core/types/signatures.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/signatures.test-d.js +0 -18
- package/dist/src/wit/wit-parser/core/types/signatures.test-d.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/utils.js +0 -2
- package/dist/src/wit/wit-parser/core/types/utils.js.map +0 -1
- package/dist/src/wit/wit-parser/core/types/utils.test-d.js +0 -138
- package/dist/src/wit/wit-parser/core/types/utils.test-d.js.map +0 -1
- package/dist/src/wit/wit-parser/core/utils.js +0 -212
- package/dist/src/wit/wit-parser/core/utils.js.map +0 -1
- package/dist/src/wit/wit-parser/core/utils.test.js +0 -302
- package/dist/src/wit/wit-parser/core/utils.test.js.map +0 -1
- package/dist/src/wit/wit-parser/parse-wit-parameter.js +0 -26
- package/dist/src/wit/wit-parser/parse-wit-parameter.js.map +0 -1
- package/dist/src/wit/wit-parser/parse-wit-parameter.test.js +0 -77
- package/dist/src/wit/wit-parser/parse-wit-parameter.test.js.map +0 -1
- package/dist/src/wit/wit-parser/parse-wit.js +0 -16
- package/dist/src/wit/wit-parser/parse-wit.js.map +0 -1
- package/dist/src/wit/wit-parser/parse-wit.test.js +0 -78
- package/dist/src/wit/wit-parser/parse-wit.test.js.map +0 -1
- package/dist/src/wit/wit.js +0 -2
- package/dist/src/wit/wit.js.map +0 -1
- package/dist/src/wit/wit.test.js +0 -6
- package/dist/src/wit/wit.test.js.map +0 -1
- package/dist/test/globalSetup.js +0 -14
- package/dist/test/globalSetup.js.map +0 -1
- package/dist/test/src/wits.js +0 -21
- package/dist/test/src/wits.js.map +0 -1
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { assertType, test } from "vitest";
|
|
2
|
-
test("ParseWitParameter", () => {
|
|
3
|
-
// everything in fib contrct
|
|
4
|
-
assertType({
|
|
5
|
-
name: "ctx",
|
|
6
|
-
type: "borrow<proc-context>",
|
|
7
|
-
});
|
|
8
|
-
assertType({
|
|
9
|
-
name: "arith-address",
|
|
10
|
-
type: "contract-address",
|
|
11
|
-
});
|
|
12
|
-
assertType({
|
|
13
|
-
name: "n",
|
|
14
|
-
type: "u64",
|
|
15
|
-
});
|
|
16
|
-
assertType({
|
|
17
|
-
type: "u64",
|
|
18
|
-
});
|
|
19
|
-
assertType({
|
|
20
|
-
name: "x",
|
|
21
|
-
type: "string",
|
|
22
|
-
});
|
|
23
|
-
assertType({
|
|
24
|
-
name: "y",
|
|
25
|
-
type: "string",
|
|
26
|
-
});
|
|
27
|
-
assertType({
|
|
28
|
-
name: "option-string",
|
|
29
|
-
type: "option<string>",
|
|
30
|
-
});
|
|
31
|
-
assertType({
|
|
32
|
-
name: "option-list-string",
|
|
33
|
-
type: "option<list<string>>",
|
|
34
|
-
});
|
|
35
|
-
assertType({
|
|
36
|
-
name: "option-list-result-string-contract-address",
|
|
37
|
-
type: "option<list<result<string, contract-address>>>",
|
|
38
|
-
});
|
|
39
|
-
assertType({
|
|
40
|
-
type: "contract-address",
|
|
41
|
-
});
|
|
42
|
-
assertType({
|
|
43
|
-
name: "ctx",
|
|
44
|
-
type: "borrow<view-context>",
|
|
45
|
-
});
|
|
46
|
-
assertType({
|
|
47
|
-
name: "arith-address",
|
|
48
|
-
type: "contract-address",
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
test("_ParseFunctionParametersAndContext", () => {
|
|
52
|
-
assertType({
|
|
53
|
-
Inputs: "arith-address: contract-address, n: u64",
|
|
54
|
-
Context: "proc",
|
|
55
|
-
});
|
|
56
|
-
assertType({
|
|
57
|
-
Inputs: "",
|
|
58
|
-
Context: "view",
|
|
59
|
-
});
|
|
60
|
-
assertType({
|
|
61
|
-
Inputs: "",
|
|
62
|
-
Context: "view",
|
|
63
|
-
});
|
|
64
|
-
assertType({
|
|
65
|
-
Inputs: "",
|
|
66
|
-
Context: "core",
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
test("SplitParameters", () => {
|
|
70
|
-
assertType(["u64"]);
|
|
71
|
-
assertType([
|
|
72
|
-
"arith-address: contract-address",
|
|
73
|
-
"n: list<u64>",
|
|
74
|
-
]);
|
|
75
|
-
});
|
|
76
|
-
test("Parse Signature", () => {
|
|
77
|
-
assertType({
|
|
78
|
-
type: "function",
|
|
79
|
-
name: "fib",
|
|
80
|
-
context: "proc",
|
|
81
|
-
inputs: [
|
|
82
|
-
{ name: "arith-address", type: "contract-address" },
|
|
83
|
-
{ name: "n", type: "list<u64>" },
|
|
84
|
-
],
|
|
85
|
-
outputs: [
|
|
86
|
-
{
|
|
87
|
-
type: "u64",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
});
|
|
91
|
-
assertType({
|
|
92
|
-
type: "function",
|
|
93
|
-
name: "fib",
|
|
94
|
-
context: "proc",
|
|
95
|
-
inputs: [
|
|
96
|
-
{ name: "arith-address", type: "contract-address" },
|
|
97
|
-
{ name: "n", type: "list<u64>" },
|
|
98
|
-
],
|
|
99
|
-
outputs: [
|
|
100
|
-
{
|
|
101
|
-
type: "contract-address",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
});
|
|
105
|
-
assertType({
|
|
106
|
-
type: "function",
|
|
107
|
-
name: "fib",
|
|
108
|
-
context: "proc",
|
|
109
|
-
inputs: [
|
|
110
|
-
{
|
|
111
|
-
name: "arith-address",
|
|
112
|
-
type: "contract-address",
|
|
113
|
-
},
|
|
114
|
-
{ name: "n", type: "list<u64>" },
|
|
115
|
-
],
|
|
116
|
-
outputs: [
|
|
117
|
-
{
|
|
118
|
-
type: "contract-address",
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
});
|
|
122
|
-
assertType({
|
|
123
|
-
type: "function",
|
|
124
|
-
name: "get-dogs",
|
|
125
|
-
context: "proc",
|
|
126
|
-
inputs: [],
|
|
127
|
-
outputs: [
|
|
128
|
-
{
|
|
129
|
-
type: "list<tuple>",
|
|
130
|
-
components: [
|
|
131
|
-
{ type: "string", name: "name" },
|
|
132
|
-
{ type: "string", name: "breed" },
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
//# sourceMappingURL=utils.test-d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.test-d.js","sourceRoot":"","sources":["../../../../../../src/wit/wit-parser/core/types/utils.test-d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA2C1C,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC7B,4BAA4B;IAC5B,UAAU,CAAiD;QACzD,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,sBAAsB;KAC7B,CAAC,CAAC;IAEH,UAAU,CAAuD;QAC/D,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IAEH,UAAU,CAA8B;QACtC,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;IAEH,UAAU,CAA2B;QACnC,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;IAEH,UAAU,CAAiC;QACzC,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,UAAU,CAAiC;QACzC,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,UAAU,CAAqD;QAC7D,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAC;IAEH,UAAU,CAAgE;QACxE,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,sBAAsB;KAC7B,CAAC,CAAC;IAEH,UAAU,CAER;QACA,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,gDAAgD;KACvD,CAAC,CAAC;IAEH,UAAU,CAAwC;QAChD,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IACH,UAAU,CAAiD;QACzD,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,sBAAsB;KAC7B,CAAC,CAAC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G,EAAE,IAAI,EAAE,WAAW,EAAE;SACjC;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;aACzB;SACF;KACF,CAAC,CAAC;IACH,UAAU,CAER;QACA,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,MAAM;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,kBAAkB;aACzB;YACD,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE;SACjC;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,kBAAkB;aACzB;SACF;KACF,CAAC,CAAC;IACH,UAAU,CAKR;QACA,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,aAAa;gBACnB,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;oBAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;iBAClC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { execTyped, isGenericRegex } from "../../regex.js";
|
|
2
|
-
import { InvalidWitParameterError, WitProtectedKeywordError, } from "./errors/wit-parameter.js";
|
|
3
|
-
import { InvalidSignatureError, UnknownSignatureError, } from "./errors/signature.js";
|
|
4
|
-
import { InvalidGenericDepthError } from "./errors/splitParameters.js";
|
|
5
|
-
import { execFunctionSignature, isFunctionSignature } from "./signatures.js";
|
|
6
|
-
//
|
|
7
|
-
// export const witParameterRegex =
|
|
8
|
-
// /^(?:(?<name>[a-z][a-z0-9-]*)\s*:\s*)?(?<type>(?:borrow|list|option|result|tuple)\s*<[\s\S]+>|[a-z][a-z0-9-]*|(?:record|variant|flags|enum)\s*\{[\s\S]*\})$/;
|
|
9
|
-
//
|
|
10
|
-
export const witParameterRegex = /^(?:(?<name>[a-z][a-z0-9-]*)\s*:\s*)?(?<type>_|(?:borrow|list|option|result|tuple)\s*<[\s\S]+>|[a-z][a-z0-9-]*|(?:record|variant|flags|enum)\s*\{[\s\S]*\})$/;
|
|
11
|
-
export function isGeneric(type) {
|
|
12
|
-
return isGenericRegex.test(type.trim());
|
|
13
|
-
}
|
|
14
|
-
export function execGeneric(type) {
|
|
15
|
-
const m = type.trim().match(isGenericRegex);
|
|
16
|
-
if (!m || !m.groups)
|
|
17
|
-
return null;
|
|
18
|
-
return m.groups;
|
|
19
|
-
}
|
|
20
|
-
export function parseWitParameter(param, options) {
|
|
21
|
-
// TODO: cache
|
|
22
|
-
// const parameterCacheKey = getParameterCacheKey(
|
|
23
|
-
// param,
|
|
24
|
-
// options?.type,
|
|
25
|
-
// options?.structs,
|
|
26
|
-
// );
|
|
27
|
-
// if (parameterCache.has(parameterCacheKey))
|
|
28
|
-
// return parameterCache.get(parameterCacheKey)!;
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
const match = execTyped(witParameterRegex, param);
|
|
32
|
-
if (!match)
|
|
33
|
-
throw new InvalidWitParameterError({ param });
|
|
34
|
-
const isGenericType = isGeneric(match.type);
|
|
35
|
-
if (match.name && isWitKeyword(match.name))
|
|
36
|
-
throw new WitProtectedKeywordError({ param, name: match.name });
|
|
37
|
-
// TODO: smell
|
|
38
|
-
const name = match.name ? { name: match.name } : {};
|
|
39
|
-
const records = options?.records ?? {};
|
|
40
|
-
let type;
|
|
41
|
-
let components = {};
|
|
42
|
-
if (isGenericType) {
|
|
43
|
-
const g = execGeneric(match.type);
|
|
44
|
-
const parts = splitParameters(g.inner);
|
|
45
|
-
const parsed = parts.map((p) => parseWitParameter(p, { records }));
|
|
46
|
-
// normalize inner types for the outer type string
|
|
47
|
-
const innerTypeSig = parsed.map((x) => x.type).join(", ");
|
|
48
|
-
switch (g.outer) {
|
|
49
|
-
case "list":
|
|
50
|
-
case "option": {
|
|
51
|
-
if (parsed.length !== 1) {
|
|
52
|
-
throw new InvalidWitParameterError({
|
|
53
|
-
param,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const t = parsed[0];
|
|
57
|
-
type = `${g.outer}<${t.type}>`;
|
|
58
|
-
// flatten record fields for list/option only
|
|
59
|
-
components = t.components ? { components: t.components } : {};
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
case "result": {
|
|
63
|
-
if (parsed.length !== 2) {
|
|
64
|
-
throw new InvalidWitParameterError({
|
|
65
|
-
param,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
const left = parsed[0];
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
const right = parsed[1];
|
|
71
|
-
type = `result<${innerTypeSig}>`;
|
|
72
|
-
components = {
|
|
73
|
-
...(left.components && { components: left.components }),
|
|
74
|
-
// components: [
|
|
75
|
-
//
|
|
76
|
-
// {
|
|
77
|
-
// name: "left",
|
|
78
|
-
// type: left.type,
|
|
79
|
-
// ...(left.components && { components: left.components }),
|
|
80
|
-
// },
|
|
81
|
-
// {
|
|
82
|
-
// name: "right",
|
|
83
|
-
// type: right.type,
|
|
84
|
-
// ...(right.components && { components: right.components }),
|
|
85
|
-
// },
|
|
86
|
-
// ],
|
|
87
|
-
};
|
|
88
|
-
// the right / error channel is always assumed to be wit built-in `error` primitive
|
|
89
|
-
// components = {
|
|
90
|
-
// components: [
|
|
91
|
-
// {
|
|
92
|
-
// name: "left",
|
|
93
|
-
// type: left.type,
|
|
94
|
-
// ...(left.components && { components: left.components }),
|
|
95
|
-
// },
|
|
96
|
-
// {
|
|
97
|
-
// name: "right",
|
|
98
|
-
// type: right.type,
|
|
99
|
-
// ...(right.components && { components: right.components }),
|
|
100
|
-
// },
|
|
101
|
-
// ],
|
|
102
|
-
// };
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
default: {
|
|
106
|
-
type = `${g.outer}<${innerTypeSig}>`;
|
|
107
|
-
components = {};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else if (match.type in records) {
|
|
112
|
-
// scalar that maps to a record in `records`
|
|
113
|
-
type = "tuple";
|
|
114
|
-
components = { components: records[match.type] };
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
type = match.type;
|
|
118
|
-
}
|
|
119
|
-
const witParameter = {
|
|
120
|
-
type: `${type}${match.array ?? ""}`,
|
|
121
|
-
...name,
|
|
122
|
-
...components,
|
|
123
|
-
};
|
|
124
|
-
// parameterCache.set(parameterCacheKey, witParameter);
|
|
125
|
-
//
|
|
126
|
-
return witParameter;
|
|
127
|
-
}
|
|
128
|
-
export const witKeywordRegex = /^(?:package|world|interface|contract|include|use|import|export|func|borrow|record|list|enum|flags|variant|option|result|tuple|bool|s8|s16|s32|s64|u8|u16|u32|u64|f32|f64|char|string)$/;
|
|
129
|
-
export function isWitKeyword(word) {
|
|
130
|
-
return witKeywordRegex.test(word);
|
|
131
|
-
}
|
|
132
|
-
// class InvalidParenthesisError extends Error { constructor(public info: { current: string; depth: number }) { super('Unbalanced <>'); } }
|
|
133
|
-
export function splitParameters(params, result = []) {
|
|
134
|
-
const s = params.trim();
|
|
135
|
-
if (s.length === 0)
|
|
136
|
-
return result;
|
|
137
|
-
let current = "";
|
|
138
|
-
let depth = 0; // nesting depth for <...>
|
|
139
|
-
for (let i = 0; i < s.length; i++) {
|
|
140
|
-
const ch = s[i];
|
|
141
|
-
if (ch === "<") {
|
|
142
|
-
depth += 1;
|
|
143
|
-
current += ch;
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
if (ch === ">") {
|
|
147
|
-
depth -= 1;
|
|
148
|
-
if (depth < 0)
|
|
149
|
-
throw new InvalidGenericDepthError({
|
|
150
|
-
current: s.slice(0, i + 1),
|
|
151
|
-
depth,
|
|
152
|
-
});
|
|
153
|
-
current += ch;
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
if (ch === "," && depth === 0) {
|
|
157
|
-
const tok = current.trim();
|
|
158
|
-
if (tok.length)
|
|
159
|
-
result.push(tok);
|
|
160
|
-
current = "";
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
current += ch;
|
|
164
|
-
}
|
|
165
|
-
if (depth !== 0)
|
|
166
|
-
throw new InvalidGenericDepthError({ current, depth });
|
|
167
|
-
const tail = current.trim();
|
|
168
|
-
if (tail.length)
|
|
169
|
-
result.push(tail);
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
export function parseSignature(signature, structs = {}) {
|
|
173
|
-
if (isFunctionSignature(signature))
|
|
174
|
-
return parseFunctionSignature(signature, structs);
|
|
175
|
-
throw new UnknownSignatureError({ signature });
|
|
176
|
-
}
|
|
177
|
-
export function parseFunctionSignature(signature, records = {}) {
|
|
178
|
-
const match = execFunctionSignature(signature);
|
|
179
|
-
if (!match)
|
|
180
|
-
throw new InvalidSignatureError({ signature, type: "func" });
|
|
181
|
-
const inputParams = splitParameters(match.parameters);
|
|
182
|
-
const inputs = [];
|
|
183
|
-
const inputLength = inputParams.length;
|
|
184
|
-
for (let i = 0; i < inputLength; i++) {
|
|
185
|
-
inputs.push(parseWitParameter(inputParams[i], {
|
|
186
|
-
records,
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
const outputs = [];
|
|
190
|
-
if (match.returns) {
|
|
191
|
-
const outputParams = splitParameters(match.returns);
|
|
192
|
-
const outputLength = outputParams.length;
|
|
193
|
-
for (let i = 0; i < outputLength; i++) {
|
|
194
|
-
outputs.push(parseWitParameter(outputParams[i], {
|
|
195
|
-
records,
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
const contextInput = inputs.shift();
|
|
200
|
-
return {
|
|
201
|
-
name: match.name,
|
|
202
|
-
type: "function",
|
|
203
|
-
context: contextInput?.type === "borrow<proc-context>"
|
|
204
|
-
? "proc"
|
|
205
|
-
: contextInput?.type === "borrow<view-context>"
|
|
206
|
-
? "view"
|
|
207
|
-
: "core",
|
|
208
|
-
inputs,
|
|
209
|
-
outputs,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/wit/wit-parser/core/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAO7E,EAAE;AACF,mCAAmC;AACnC,kKAAkK;AAClK,EAAE;AACF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,8JAA8J,CAAC;AAEjK,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,CAAC,CAAC,MAAsB,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,OAAsB;IACrE,cAAc;IACd,kDAAkD;IAClD,WAAW;IACX,mBAAmB;IACnB,sBAAsB;IACtB,KAAK;IACL,6CAA6C;IAC7C,mDAAmD;IACnD,EAAE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C,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,YAAY,EAAE,IAAI,KAAK,sBAAsB;gBAC7C,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,MAAM;QACd,MAAM;QACN,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { expect, test, describe } from "vitest";
|
|
2
|
-
import { parseWitParameter, splitParameters, parseFunctionSignature, } from "./utils.js";
|
|
3
|
-
const parseOptions = {
|
|
4
|
-
records: {
|
|
5
|
-
"contract-address": [
|
|
6
|
-
{ name: "name", type: "string" },
|
|
7
|
-
{ name: "height", type: "s64" },
|
|
8
|
-
{ name: "tx-index", type: "s64" },
|
|
9
|
-
],
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
describe("parseFunctionSignature", () => {
|
|
13
|
-
test.each([
|
|
14
|
-
{
|
|
15
|
-
input: "export fib: func(ctx: borrow<proc-context>, arith-address: contract-address, n: u64) -> u64;",
|
|
16
|
-
expected: {
|
|
17
|
-
context: "proc",
|
|
18
|
-
inputs: [
|
|
19
|
-
{
|
|
20
|
-
name: "arith-address",
|
|
21
|
-
type: "contract-address",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "n",
|
|
25
|
-
type: "u64",
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
name: "fib",
|
|
29
|
-
outputs: [
|
|
30
|
-
{
|
|
31
|
-
type: "u64",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
type: "function",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
input: "export cached-values: func(ctx: borrow<view-context>) -> list<u64>;",
|
|
39
|
-
expected: {
|
|
40
|
-
context: "view",
|
|
41
|
-
inputs: [],
|
|
42
|
-
name: "cached-values",
|
|
43
|
-
outputs: [
|
|
44
|
-
{
|
|
45
|
-
type: "list<u64>",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
type: "function",
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
])("parseFunctionSignature($input)", ({ input, expected }) => {
|
|
52
|
-
expect(parseFunctionSignature(input)).toEqual(expected);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe("parseWitParameter", () => {
|
|
56
|
-
test.each([
|
|
57
|
-
{
|
|
58
|
-
parameter: "ctx: borrow<proc-context>",
|
|
59
|
-
expected: {
|
|
60
|
-
name: "ctx",
|
|
61
|
-
type: "borrow<proc-context>",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
parameter: "arith-address: contract-address",
|
|
66
|
-
expected: {
|
|
67
|
-
name: "arith-address",
|
|
68
|
-
type: "tuple",
|
|
69
|
-
components: [
|
|
70
|
-
{ name: "name", type: "string" },
|
|
71
|
-
{ name: "height", type: "s64" },
|
|
72
|
-
{ name: "tx-index", type: "s64" },
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
parameter: "n: u64",
|
|
78
|
-
expected: {
|
|
79
|
-
name: "n",
|
|
80
|
-
type: "u64",
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
parameter: "y: string",
|
|
85
|
-
expected: {
|
|
86
|
-
name: "y",
|
|
87
|
-
type: "string",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
parameter: "list-of-strings: list<string>",
|
|
92
|
-
expected: {
|
|
93
|
-
name: "list-of-strings",
|
|
94
|
-
type: "list<string>",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
parameter: "arith-addresses: list<contract-address>",
|
|
99
|
-
expected: {
|
|
100
|
-
name: "arith-addresses",
|
|
101
|
-
type: "list<tuple>",
|
|
102
|
-
components: [
|
|
103
|
-
{ name: "name", type: "string" },
|
|
104
|
-
{ name: "height", type: "s64" },
|
|
105
|
-
{ name: "tx-index", type: "s64" },
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
parameter: "list<contract-address>",
|
|
111
|
-
expected: {
|
|
112
|
-
type: "list<tuple>",
|
|
113
|
-
components: [
|
|
114
|
-
{ name: "name", type: "string" },
|
|
115
|
-
{ name: "height", type: "s64" },
|
|
116
|
-
{ name: "tx-index", type: "s64" },
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
parameter: "option<contract-address>",
|
|
122
|
-
expected: {
|
|
123
|
-
type: "option<tuple>",
|
|
124
|
-
components: [
|
|
125
|
-
{ name: "name", type: "string" },
|
|
126
|
-
{ name: "height", type: "s64" },
|
|
127
|
-
{ name: "tx-index", type: "s64" },
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
parameter: "result<contract-address, error>",
|
|
133
|
-
expected: {
|
|
134
|
-
type: "result<tuple, error>",
|
|
135
|
-
components: [
|
|
136
|
-
{ name: "name", type: "string" },
|
|
137
|
-
{ name: "height", type: "s64" },
|
|
138
|
-
{ name: "tx-index", type: "s64" },
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
parameter: "result<list<contract-address>, error>",
|
|
144
|
-
expected: {
|
|
145
|
-
type: "result<list<tuple>, error>",
|
|
146
|
-
components: [
|
|
147
|
-
{ name: "name", type: "string" },
|
|
148
|
-
{ name: "height", type: "s64" },
|
|
149
|
-
{ name: "tx-index", type: "s64" },
|
|
150
|
-
],
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
// {
|
|
154
|
-
// parameter: "result<string, list<option<contract-address>>>",
|
|
155
|
-
// expected: {
|
|
156
|
-
// type: "result<string, list<option<tuple>>>",
|
|
157
|
-
// components: [
|
|
158
|
-
// { name: "left", type: "string" },
|
|
159
|
-
// {
|
|
160
|
-
// name: "right",
|
|
161
|
-
// type: "list<option<tuple>>",
|
|
162
|
-
// components: [
|
|
163
|
-
// { name: "name", type: "string" },
|
|
164
|
-
// { name: "height", type: "s64" },
|
|
165
|
-
// { name: "tx-index", type: "s64" },
|
|
166
|
-
// ],
|
|
167
|
-
// },
|
|
168
|
-
// ],
|
|
169
|
-
// },
|
|
170
|
-
// },
|
|
171
|
-
// {
|
|
172
|
-
// parameter: "result<string, list<result<string, contract-address>>>",
|
|
173
|
-
// expected: {
|
|
174
|
-
// type: "result<string, list<result<string, tuple>>>",
|
|
175
|
-
// components: [
|
|
176
|
-
// { name: "left", type: "string" },
|
|
177
|
-
// {
|
|
178
|
-
// name: "right",
|
|
179
|
-
// type: "list<result<string, tuple>>",
|
|
180
|
-
// components: [
|
|
181
|
-
// { name: "left", type: "string" },
|
|
182
|
-
// {
|
|
183
|
-
// name: "right",
|
|
184
|
-
// type: "tuple",
|
|
185
|
-
// components: [
|
|
186
|
-
// { name: "name", type: "string" },
|
|
187
|
-
// { name: "height", type: "s64" },
|
|
188
|
-
// { name: "tx-index", type: "s64" },
|
|
189
|
-
// ],
|
|
190
|
-
// },
|
|
191
|
-
// ],
|
|
192
|
-
// },
|
|
193
|
-
// ],
|
|
194
|
-
// },
|
|
195
|
-
// },
|
|
196
|
-
// {
|
|
197
|
-
// parameter:
|
|
198
|
-
// "result<string, list<result<string, option<contract-address>>>>",
|
|
199
|
-
// expected: {
|
|
200
|
-
// type: "result<string, list<result<string, option<tuple>>>>",
|
|
201
|
-
// components: [
|
|
202
|
-
// { name: "left", type: "string" },
|
|
203
|
-
// {
|
|
204
|
-
// name: "right",
|
|
205
|
-
// type: "list<result<string, option<tuple>>>",
|
|
206
|
-
// components: [
|
|
207
|
-
// { name: "left", type: "string" },
|
|
208
|
-
// {
|
|
209
|
-
// name: "right",
|
|
210
|
-
// type: "option<tuple>",
|
|
211
|
-
// components: [
|
|
212
|
-
// { name: "name", type: "string" },
|
|
213
|
-
// { name: "height", type: "s64" },
|
|
214
|
-
// { name: "tx-index", type: "s64" },
|
|
215
|
-
// ],
|
|
216
|
-
// },
|
|
217
|
-
// ],
|
|
218
|
-
// },
|
|
219
|
-
// ],
|
|
220
|
-
// },
|
|
221
|
-
// },
|
|
222
|
-
// {
|
|
223
|
-
// parameter: "option<list<result<string, contract-address>>>",
|
|
224
|
-
// expected: {
|
|
225
|
-
// type: "option<list<result<string, tuple>>>",
|
|
226
|
-
// components: [
|
|
227
|
-
// { type: "string", name: "left" },
|
|
228
|
-
// {
|
|
229
|
-
// name: "right",
|
|
230
|
-
// type: "tuple",
|
|
231
|
-
// components: [
|
|
232
|
-
// { type: "string", name: "name" },
|
|
233
|
-
// { name: "height", type: "s64" },
|
|
234
|
-
// { name: "tx-index", type: "s64" },
|
|
235
|
-
// ],
|
|
236
|
-
// },
|
|
237
|
-
// ],
|
|
238
|
-
// },
|
|
239
|
-
// },
|
|
240
|
-
])("parseWitParameter($parameter)", ({ parameter, expected }) => {
|
|
241
|
-
expect(parseWitParameter(parameter, parseOptions)).toEqual(expected);
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
// import { InvalidGenericSyntaxError } from "./errors";
|
|
245
|
-
describe("splitParameters (WIT generics, only < > nesting)", () => {
|
|
246
|
-
test("empty / whitespace", () => {
|
|
247
|
-
expect(splitParameters("")).toEqual([]);
|
|
248
|
-
expect(splitParameters(" ")).toEqual([]);
|
|
249
|
-
});
|
|
250
|
-
test("simple top-level commas", () => {
|
|
251
|
-
expect(splitParameters("a, b, c")).toEqual(["a", "b", "c"]);
|
|
252
|
-
expect(splitParameters(" a , b ,c ")).toEqual(["a", "b", "c"]);
|
|
253
|
-
});
|
|
254
|
-
test("does not split inside < >", () => {
|
|
255
|
-
expect(splitParameters("tuple<u64, list<string>>")).toEqual([
|
|
256
|
-
"tuple<u64, list<string>>",
|
|
257
|
-
]);
|
|
258
|
-
expect(splitParameters("result<integer, error>")).toEqual([
|
|
259
|
-
"result<integer, error>",
|
|
260
|
-
]);
|
|
261
|
-
expect(splitParameters("map<string, list<result<u64, error>>>")).toEqual([
|
|
262
|
-
"map<string, list<result<u64, error>>>",
|
|
263
|
-
]);
|
|
264
|
-
});
|
|
265
|
-
test("mixed: top-level params that contain nested generics", () => {
|
|
266
|
-
const input = "ctx: borrow<proc-context>, pair: list<result<token-pair, error>>, n: u64";
|
|
267
|
-
expect(splitParameters(input)).toEqual([
|
|
268
|
-
"ctx: borrow<proc-context>",
|
|
269
|
-
"pair: list<result<token-pair, error>>",
|
|
270
|
-
"n: u64",
|
|
271
|
-
]);
|
|
272
|
-
});
|
|
273
|
-
test("deep nesting", () => {
|
|
274
|
-
const input = "outer<mid<inner<u8, list<u16>>>>";
|
|
275
|
-
expect(splitParameters(input)).toEqual([
|
|
276
|
-
"outer<mid<inner<u8, list<u16>>>>",
|
|
277
|
-
]);
|
|
278
|
-
});
|
|
279
|
-
test("handles trailing comma by ignoring empty token", () => {
|
|
280
|
-
expect(splitParameters("a, b<z, y>,")) // trailing comma
|
|
281
|
-
.toEqual(["a", "b<z, y>"]);
|
|
282
|
-
});
|
|
283
|
-
test("ignores empty segments from duplicate commas", () => {
|
|
284
|
-
expect(splitParameters("a,,b")).toEqual(["a", "b"]);
|
|
285
|
-
expect(splitParameters(",a,b,")).toEqual(["a", "b"]);
|
|
286
|
-
});
|
|
287
|
-
test("throws on unbalanced opener", () => {
|
|
288
|
-
expect(() => splitParameters("a<b,c")).toThrow(); // e.g., InvalidGenericSyntaxError
|
|
289
|
-
});
|
|
290
|
-
test("throws on stray closer", () => {
|
|
291
|
-
expect(() => splitParameters("a,b>")).toThrow();
|
|
292
|
-
});
|
|
293
|
-
test("complex function-style params", () => {
|
|
294
|
-
const input = "ctx: borrow<proc-context>, result: result<tuple<u64, list<string>>, error>, flag: bool";
|
|
295
|
-
expect(splitParameters(input)).toEqual([
|
|
296
|
-
"ctx: borrow<proc-context>",
|
|
297
|
-
"result: result<tuple<u64, list<string>>, error>",
|
|
298
|
-
"flag: bool",
|
|
299
|
-
]);
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
//# sourceMappingURL=utils.test.js.map
|