@helios-lang/effect 0.3.0 → 0.4.31
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/.vscode/settings.json +3 -0
- package/dist/Cardano/Ledger/AssetClass.js +6 -1
- package/dist/Cardano/Ledger/AssetClass.js.map +1 -1
- package/dist/Cardano/Ledger/Assets.js +85 -3
- package/dist/Cardano/Ledger/Assets.js.map +1 -1
- package/dist/Cardano/Ledger/Credential.js +1 -1
- package/dist/Cardano/Ledger/Credential.js.map +1 -1
- package/dist/Cardano/Ledger/DCert.js +2 -1
- package/dist/Cardano/Ledger/DCert.js.map +1 -1
- package/dist/Cardano/Ledger/DatumHash.js +2 -2
- package/dist/Cardano/Ledger/DatumHash.js.map +1 -1
- package/dist/Cardano/Ledger/MintingPolicy.js +2 -0
- package/dist/Cardano/Ledger/MintingPolicy.js.map +1 -1
- package/dist/Cardano/Ledger/NativeScript.js +2 -1
- package/dist/Cardano/Ledger/NativeScript.js.map +1 -1
- package/dist/Cardano/Ledger/PubKey.js +1 -1
- package/dist/Cardano/Ledger/PubKey.js.map +1 -1
- package/dist/Cardano/Ledger/PubKeyHash.js +1 -1
- package/dist/Cardano/Ledger/PubKeyHash.js.map +1 -1
- package/dist/Cardano/Ledger/Redeemer.js +1 -1
- package/dist/Cardano/Ledger/Redeemer.js.map +1 -1
- package/dist/Cardano/Ledger/Signature.js +1 -0
- package/dist/Cardano/Ledger/Signature.js.map +1 -1
- package/dist/Cardano/Ledger/Tx.js +165 -17
- package/dist/Cardano/Ledger/Tx.js.map +1 -1
- package/dist/Cardano/Ledger/TxOutput.js +12 -6
- package/dist/Cardano/Ledger/TxOutput.js.map +1 -1
- package/dist/Cardano/Ledger/TxOutputDatum.js +36 -34
- package/dist/Cardano/Ledger/TxOutputDatum.js.map +1 -1
- package/dist/Cardano/Ledger/UTxO.js +1 -1
- package/dist/Cardano/Ledger/UTxO.js.map +1 -1
- package/dist/Cardano/Ledger/UTxORef.js +1 -0
- package/dist/Cardano/Ledger/UTxORef.js.map +1 -1
- package/dist/Cardano/Ledger/ValidatorHash.js +1 -1
- package/dist/Cardano/Ledger/ValidatorHash.js.map +1 -1
- package/dist/Cardano/Network/AssetMetadata.js +11 -0
- package/dist/Cardano/Network/AssetMetadata.js.map +1 -0
- package/dist/Cardano/Network/IsMainnet.js +1 -1
- package/dist/Cardano/Network/IsMainnet.js.map +1 -1
- package/dist/Cardano/Network/Params.js +105 -1
- package/dist/Cardano/Network/Params.js.map +1 -1
- package/dist/Cardano/Network/Submit.js +15 -0
- package/dist/Cardano/Network/Submit.js.map +1 -0
- package/dist/Cardano/Network/UTxO.js +2 -2
- package/dist/Cardano/Network/UTxO.js.map +1 -1
- package/dist/Cardano/Network/UTxOsAt.js +3 -2
- package/dist/Cardano/Network/UTxOsAt.js.map +1 -1
- package/dist/Cardano/Network/errors.js +16 -3
- package/dist/Cardano/Network/errors.js.map +1 -1
- package/dist/Cardano/Network/index.js +2 -0
- package/dist/Cardano/Network/index.js.map +1 -1
- package/dist/Cardano/ScriptContext.js +264 -0
- package/dist/Cardano/ScriptContext.js.map +1 -0
- package/dist/Cardano/TxBuilder.js +88 -42
- package/dist/Cardano/TxBuilder.js.map +1 -1
- package/dist/Cardano/Uplc/Builtins.js +293 -32
- package/dist/Cardano/Uplc/Builtins.js.map +1 -1
- package/dist/Cardano/Uplc/Cek.js +6 -5
- package/dist/Cardano/Uplc/Cek.js.map +1 -1
- package/dist/Cardano/Uplc/Cost.js +257 -1
- package/dist/Cardano/Uplc/Cost.js.map +1 -1
- package/dist/Cardano/Uplc/Data.js +22 -8
- package/dist/Cardano/Uplc/Data.js.map +1 -1
- package/dist/Cardano/Uplc/Script.js +52 -10
- package/dist/Cardano/Uplc/Script.js.map +1 -1
- package/dist/Cardano/Uplc/Term.js +14 -0
- package/dist/Cardano/Uplc/Term.js.map +1 -1
- package/dist/Cardano/Uplc/index.js +2 -1
- package/dist/Cardano/Uplc/index.js.map +1 -1
- package/dist/Cardano/Wallet.js +4 -1
- package/dist/Cardano/Wallet.js.map +1 -1
- package/dist/Cardano/index.js +3 -3
- package/dist/Cardano/index.js.map +1 -1
- package/dist/Codecs/Base32.js +4 -1
- package/dist/Codecs/Base32.js.map +1 -1
- package/dist/Codecs/BigEndian.js +1 -1
- package/dist/Codecs/BigEndian.js.map +1 -1
- package/dist/Codecs/Bytes.js +1 -1
- package/dist/Codecs/Bytes.js.map +1 -1
- package/dist/Codecs/LittleEndian.js +1 -1
- package/dist/Codecs/LittleEndian.js.map +1 -1
- package/dist/Codecs/Utf8.js +1 -1
- package/dist/Codecs/Utf8.js.map +1 -1
- package/dist/Crypto/Bip32.js +5 -2
- package/dist/Crypto/Bip32.js.map +1 -1
- package/dist/Crypto/Curve.js +1 -0
- package/dist/Crypto/Curve.js.map +1 -1
- package/dist/Crypto/Ed25519.js +2 -1
- package/dist/Crypto/Ed25519.js.map +1 -1
- package/dist/Crypto/EdDSA.js +2 -1
- package/dist/Crypto/EdDSA.js.map +1 -1
- package/dist/Crypto/Sha3_256.js +1 -0
- package/dist/Crypto/Sha3_256.js.map +1 -1
- package/dist/Crypto/index.js +2 -0
- package/dist/Crypto/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/types/Cardano/Ledger/AssetClass.d.ts +6 -1
- package/types/Cardano/Ledger/AssetClass.d.ts.map +1 -1
- package/types/Cardano/Ledger/Assets.d.ts +14 -2
- package/types/Cardano/Ledger/Assets.d.ts.map +1 -1
- package/types/Cardano/Ledger/Credential.d.ts +1 -1
- package/types/Cardano/Ledger/Credential.d.ts.map +1 -1
- package/types/Cardano/Ledger/DatumHash.d.ts +2 -2
- package/types/Cardano/Ledger/DatumHash.d.ts.map +1 -1
- package/types/Cardano/Ledger/MintingPolicy.d.ts +1 -0
- package/types/Cardano/Ledger/MintingPolicy.d.ts.map +1 -1
- package/types/Cardano/Ledger/PubKey.d.ts +2 -2
- package/types/Cardano/Ledger/PubKey.d.ts.map +1 -1
- package/types/Cardano/Ledger/PubKeyHash.d.ts +2 -2
- package/types/Cardano/Ledger/PubKeyHash.d.ts.map +1 -1
- package/types/Cardano/Ledger/Redeemer.d.ts +1 -1
- package/types/Cardano/Ledger/Redeemer.d.ts.map +1 -1
- package/types/Cardano/Ledger/Signature.d.ts +1 -1
- package/types/Cardano/Ledger/Signature.d.ts.map +1 -1
- package/types/Cardano/Ledger/Tx.d.ts +19 -241
- package/types/Cardano/Ledger/Tx.d.ts.map +1 -1
- package/types/Cardano/Ledger/TxOutput.d.ts +95 -105
- package/types/Cardano/Ledger/TxOutput.d.ts.map +1 -1
- package/types/Cardano/Ledger/TxOutputDatum.d.ts +69 -68
- package/types/Cardano/Ledger/TxOutputDatum.d.ts.map +1 -1
- package/types/Cardano/Ledger/UTxO.d.ts +268 -318
- package/types/Cardano/Ledger/UTxO.d.ts.map +1 -1
- package/types/Cardano/Ledger/ValidatorHash.d.ts +2 -2
- package/types/Cardano/Ledger/ValidatorHash.d.ts.map +1 -1
- package/types/Cardano/Network/AssetMetadata.d.ts +15 -0
- package/types/Cardano/Network/AssetMetadata.d.ts.map +1 -0
- package/types/Cardano/Network/IsMainnet.d.ts +1 -1
- package/types/Cardano/Network/Params.d.ts +9 -1
- package/types/Cardano/Network/Params.d.ts.map +1 -1
- package/types/Cardano/Network/Submit.d.ts +18 -0
- package/types/Cardano/Network/Submit.d.ts.map +1 -0
- package/types/Cardano/Network/UTxO.d.ts +1 -1
- package/types/Cardano/Network/UTxO.d.ts.map +1 -1
- package/types/Cardano/Network/UTxOsAt.d.ts +2 -2
- package/types/Cardano/Network/UTxOsAt.d.ts.map +1 -1
- package/types/Cardano/Network/errors.d.ts +22 -2
- package/types/Cardano/Network/errors.d.ts.map +1 -1
- package/types/Cardano/Network/index.d.ts +2 -0
- package/types/Cardano/Network/index.d.ts.map +1 -1
- package/types/Cardano/ScriptContext.d.ts +1340 -0
- package/types/Cardano/ScriptContext.d.ts.map +1 -0
- package/types/Cardano/TxBuilder.d.ts +7 -5
- package/types/Cardano/TxBuilder.d.ts.map +1 -1
- package/types/Cardano/Uplc/Builtins.d.ts.map +1 -1
- package/types/Cardano/Uplc/Cek.d.ts.map +1 -1
- package/types/Cardano/Uplc/Cost.d.ts +1 -0
- package/types/Cardano/Uplc/Cost.d.ts.map +1 -1
- package/types/Cardano/Uplc/Data.d.ts.map +1 -1
- package/types/Cardano/Uplc/Script.d.ts +5 -3
- package/types/Cardano/Uplc/Script.d.ts.map +1 -1
- package/types/Cardano/Uplc/Term.d.ts +3 -0
- package/types/Cardano/Uplc/Term.d.ts.map +1 -1
- package/types/Cardano/Uplc/index.d.ts +2 -1
- package/types/Cardano/Uplc/index.d.ts.map +1 -1
- package/types/Cardano/Wallet.d.ts +18 -23
- package/types/Cardano/Wallet.d.ts.map +1 -1
- package/types/Cardano/index.d.ts +3 -3
- package/types/Cardano/index.d.ts.map +1 -1
- package/types/Codecs/Base32.d.ts +4 -1
- package/types/Codecs/Base32.d.ts.map +1 -1
- package/types/Crypto/Bip32.d.ts +5 -3
- package/types/Crypto/Bip32.d.ts.map +1 -1
- package/types/Crypto/EdDSA.d.ts +1 -1
- package/types/Crypto/EdDSA.d.ts.map +1 -1
- package/types/Crypto/index.d.ts +2 -0
- package/types/Crypto/index.d.ts.map +1 -1
- package/types/index.d.ts +3 -3
- package/types/index.d.ts.map +1 -1
- package/bun.lock +0 -60
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -38
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Data, Either } from "effect";
|
|
1
|
+
import { Data, Either, Encoding } from "effect";
|
|
2
2
|
import * as Bytes from "../../Codecs/Bytes.js";
|
|
3
3
|
import * as Utf8 from "../../Codecs/Utf8.js";
|
|
4
|
-
import * as Crypto from "../../Crypto";
|
|
4
|
+
import * as Crypto from "../../Crypto/index.js";
|
|
5
5
|
import * as Cost from "./Cost.js";
|
|
6
6
|
import { toString as dataToString, encode as encodeData } from "./Data.js";
|
|
7
7
|
import * as Type from "./Type.js";
|
|
@@ -39,6 +39,12 @@ export const addIntegerV1 = {
|
|
|
39
39
|
cpuModel: Cost.Linear(0, 1)(Cost.Max),
|
|
40
40
|
memModel: Cost.Linear(2, 3)(Cost.Max),
|
|
41
41
|
call: ([a, b]) => {
|
|
42
|
+
if (a === undefined) {
|
|
43
|
+
throw new Error("a is undefined in addInteger()");
|
|
44
|
+
}
|
|
45
|
+
if (b === undefined) {
|
|
46
|
+
throw new Error("b is undefined in addInteger");
|
|
47
|
+
}
|
|
42
48
|
if (a._tag != "Const") {
|
|
43
49
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
44
50
|
}
|
|
@@ -64,6 +70,12 @@ export const subtractIntegerV1 = {
|
|
|
64
70
|
cpuModel: Cost.Linear(145, 146)(Cost.Max),
|
|
65
71
|
memModel: Cost.Linear(147, 148)(Cost.Max),
|
|
66
72
|
call: ([a, b]) => {
|
|
73
|
+
if (a === undefined) {
|
|
74
|
+
throw new Error("a is undefined in subtractInteger()");
|
|
75
|
+
}
|
|
76
|
+
if (b === undefined) {
|
|
77
|
+
throw new Error("b is undefined in subtractInteger()");
|
|
78
|
+
}
|
|
67
79
|
if (a._tag != "Const") {
|
|
68
80
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
69
81
|
}
|
|
@@ -99,6 +111,12 @@ export const multiplyIntegerV1 = {
|
|
|
99
111
|
cpuModel: Cost.Linear(115, 116)(Cost.Sum),
|
|
100
112
|
memModel: Cost.Linear(117, 118)(Cost.Sum),
|
|
101
113
|
call: ([a, b]) => {
|
|
114
|
+
if (a === undefined) {
|
|
115
|
+
throw new Error("a is undefined in multiplyInteger()");
|
|
116
|
+
}
|
|
117
|
+
if (b === undefined) {
|
|
118
|
+
throw new Error("b is undefined in multiplyInteger()");
|
|
119
|
+
}
|
|
102
120
|
if (a._tag != "Const") {
|
|
103
121
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
104
122
|
}
|
|
@@ -134,6 +152,12 @@ export const divideIntegerV1 = {
|
|
|
134
152
|
cpuModel: Cost.ConstantBelowDiag(49)(Cost.Linear(50, 51)(Cost.Prod)),
|
|
135
153
|
memModel: Cost.AtLeast(53)(Cost.Diff),
|
|
136
154
|
call: ([a, b]) => {
|
|
155
|
+
if (a === undefined) {
|
|
156
|
+
throw new Error("a is undefined in divideInteger()");
|
|
157
|
+
}
|
|
158
|
+
if (b === undefined) {
|
|
159
|
+
throw new Error("b is undefined in divideInteger()");
|
|
160
|
+
}
|
|
137
161
|
if (a._tag != "Const") {
|
|
138
162
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
139
163
|
}
|
|
@@ -168,6 +192,12 @@ export const quotientIntegerV1 = {
|
|
|
168
192
|
cpuModel: Cost.ConstantBelowDiag(121)(Cost.Linear(122, 123)(Cost.Prod)),
|
|
169
193
|
memModel: Cost.AtLeast(125)(Cost.Diff),
|
|
170
194
|
call: ([a, b]) => {
|
|
195
|
+
if (a === undefined) {
|
|
196
|
+
throw new Error("a is undefined in quotientInteger()");
|
|
197
|
+
}
|
|
198
|
+
if (b === undefined) {
|
|
199
|
+
throw new Error("b is undefined in quotientInteger()");
|
|
200
|
+
}
|
|
171
201
|
if (a._tag != "Const") {
|
|
172
202
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
173
203
|
}
|
|
@@ -208,6 +238,12 @@ export const remainderIntegerV1 = {
|
|
|
208
238
|
cpuModel: Cost.ConstantBelowDiag(127)(Cost.Linear(128, 129)(Cost.Prod)),
|
|
209
239
|
memModel: Cost.AtLeast(131)(Cost.Diff),
|
|
210
240
|
call: ([a, b]) => {
|
|
241
|
+
if (a === undefined) {
|
|
242
|
+
throw new Error("a is undefined in remainderInteger()");
|
|
243
|
+
}
|
|
244
|
+
if (b === undefined) {
|
|
245
|
+
throw new Error("b is undefined in remainderInteger()");
|
|
246
|
+
}
|
|
211
247
|
if (a._tag != "Const") {
|
|
212
248
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
213
249
|
}
|
|
@@ -248,6 +284,12 @@ export const modIntegerV1 = {
|
|
|
248
284
|
cpuModel: Cost.ConstantBelowDiag(109)(Cost.Linear(110, 111)(Cost.Prod)),
|
|
249
285
|
memModel: Cost.AtLeast(113)(Cost.Diff),
|
|
250
286
|
call: ([a, b]) => {
|
|
287
|
+
if (a === undefined) {
|
|
288
|
+
throw new Error("a is undefined in modInteger()");
|
|
289
|
+
}
|
|
290
|
+
if (b === undefined) {
|
|
291
|
+
throw new Error("b is undefined in modInteger()");
|
|
292
|
+
}
|
|
251
293
|
if (a._tag != "Const") {
|
|
252
294
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
253
295
|
}
|
|
@@ -297,6 +339,12 @@ export const equalsIntegerV1 = {
|
|
|
297
339
|
cpuModel: Cost.Linear(66, 67)(Cost.Min),
|
|
298
340
|
memModel: Cost.Constant(68),
|
|
299
341
|
call: ([a, b]) => {
|
|
342
|
+
if (a === undefined) {
|
|
343
|
+
throw new Error("a is undefined in equalsInteger()");
|
|
344
|
+
}
|
|
345
|
+
if (b === undefined) {
|
|
346
|
+
throw new Error("b is undefined in equalsInteger()");
|
|
347
|
+
}
|
|
300
348
|
if (a._tag != "Const") {
|
|
301
349
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
302
350
|
}
|
|
@@ -327,6 +375,12 @@ export const lessThanIntegerV1 = {
|
|
|
327
375
|
cpuModel: Cost.Linear(94, 95)(Cost.Min),
|
|
328
376
|
memModel: Cost.Constant(96),
|
|
329
377
|
call: ([a, b]) => {
|
|
378
|
+
if (a === undefined) {
|
|
379
|
+
throw new Error("a is undefined in lessThanInteger()");
|
|
380
|
+
}
|
|
381
|
+
if (b === undefined) {
|
|
382
|
+
throw new Error("b is undefined in lessThanInteger()");
|
|
383
|
+
}
|
|
330
384
|
if (a._tag != "Const") {
|
|
331
385
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
332
386
|
}
|
|
@@ -357,6 +411,12 @@ export const lessThanEqualsIntegerV1 = {
|
|
|
357
411
|
cpuModel: Cost.Linear(91, 92)(Cost.Min),
|
|
358
412
|
memModel: Cost.Constant(93),
|
|
359
413
|
call: ([a, b]) => {
|
|
414
|
+
if (a === undefined) {
|
|
415
|
+
throw new Error("a is undefined in lessThanEqualsInteger()");
|
|
416
|
+
}
|
|
417
|
+
if (b === undefined) {
|
|
418
|
+
throw new Error("b is undefined in lessThanEqualsInteger()");
|
|
419
|
+
}
|
|
360
420
|
if (a._tag != "Const") {
|
|
361
421
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
362
422
|
}
|
|
@@ -387,6 +447,12 @@ export const appendByteStringV1 = {
|
|
|
387
447
|
cpuModel: Cost.Linear(4, 5)(Cost.Sum),
|
|
388
448
|
memModel: Cost.Linear(6, 7)(Cost.Sum),
|
|
389
449
|
call: ([a, b]) => {
|
|
450
|
+
if (a === undefined) {
|
|
451
|
+
throw new Error("a is undefined in appendByteString()");
|
|
452
|
+
}
|
|
453
|
+
if (b === undefined) {
|
|
454
|
+
throw new Error("b is undefined in appendByteString()");
|
|
455
|
+
}
|
|
390
456
|
if (a._tag != "Const") {
|
|
391
457
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
392
458
|
}
|
|
@@ -412,6 +478,12 @@ export const consByteStringV1 = {
|
|
|
412
478
|
cpuModel: Cost.Linear(39, 40)(Cost.Second),
|
|
413
479
|
memModel: Cost.Linear(41, 42)(Cost.Sum),
|
|
414
480
|
call: ([a, b]) => {
|
|
481
|
+
if (a === undefined) {
|
|
482
|
+
throw new Error("a is undefined in consByteString()");
|
|
483
|
+
}
|
|
484
|
+
if (b === undefined) {
|
|
485
|
+
throw new Error("b is undefined in consByteString()");
|
|
486
|
+
}
|
|
415
487
|
if (a._tag != "Const") {
|
|
416
488
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
417
489
|
}
|
|
@@ -437,6 +509,15 @@ export const sliceByteStringV1 = {
|
|
|
437
509
|
cpuModel: Cost.Linear(139, 140)(Cost.Third),
|
|
438
510
|
memModel: Cost.Linear(141, 142)(Cost.Third),
|
|
439
511
|
call: ([a, b, c]) => {
|
|
512
|
+
if (a === undefined) {
|
|
513
|
+
throw new Error("a is undefined in sliceByteString()");
|
|
514
|
+
}
|
|
515
|
+
if (b === undefined) {
|
|
516
|
+
throw new Error("b is undefined in sliceByteString()");
|
|
517
|
+
}
|
|
518
|
+
if (c === undefined) {
|
|
519
|
+
throw new Error("c is undefined in sliceByteString()");
|
|
520
|
+
}
|
|
440
521
|
if (a._tag != "Const") {
|
|
441
522
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
442
523
|
}
|
|
@@ -482,6 +563,9 @@ export const lengthOfByteStringV1 = {
|
|
|
482
563
|
cpuModel: Cost.Constant(83),
|
|
483
564
|
memModel: Cost.Constant(84),
|
|
484
565
|
call: ([a]) => {
|
|
566
|
+
if (a === undefined) {
|
|
567
|
+
throw new Error("a is undefined in lengthOfByteString()");
|
|
568
|
+
}
|
|
485
569
|
if (a._tag != "Const") {
|
|
486
570
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
487
571
|
}
|
|
@@ -506,6 +590,12 @@ export const indexByteStringV1 = {
|
|
|
506
590
|
cpuModel: Cost.Constant(81),
|
|
507
591
|
memModel: Cost.Constant(82),
|
|
508
592
|
call: ([a, b]) => {
|
|
593
|
+
if (a === undefined) {
|
|
594
|
+
throw new Error("a is undefined in indexByteString()");
|
|
595
|
+
}
|
|
596
|
+
if (b === undefined) {
|
|
597
|
+
throw new Error("b is undefined in indexByteString()");
|
|
598
|
+
}
|
|
509
599
|
if (a._tag != "Const") {
|
|
510
600
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
511
601
|
}
|
|
@@ -541,6 +631,12 @@ export const equalsByteStringV1 = {
|
|
|
541
631
|
cpuModel: Cost.ConstantOffDiag(59)(Cost.Linear(60, 61)(Cost.First)),
|
|
542
632
|
memModel: Cost.Constant(62),
|
|
543
633
|
call: ([a, b]) => {
|
|
634
|
+
if (a === undefined) {
|
|
635
|
+
throw new Error("a is undefined in equalsByteString()");
|
|
636
|
+
}
|
|
637
|
+
if (b === undefined) {
|
|
638
|
+
throw new Error("b is undefined in equalsByteString()");
|
|
639
|
+
}
|
|
544
640
|
if (a._tag != "Const") {
|
|
545
641
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
546
642
|
}
|
|
@@ -571,6 +667,12 @@ export const lessThanByteStringV1 = {
|
|
|
571
667
|
cpuModel: Cost.Linear(85, 86)(Cost.Min),
|
|
572
668
|
memModel: Cost.Constant(87),
|
|
573
669
|
call: ([a, b]) => {
|
|
670
|
+
if (a === undefined) {
|
|
671
|
+
throw new Error("a is undefined in lessThanByteString()");
|
|
672
|
+
}
|
|
673
|
+
if (b === undefined) {
|
|
674
|
+
throw new Error("b is undefined in lessThanByteString()");
|
|
675
|
+
}
|
|
574
676
|
if (a._tag != "Const") {
|
|
575
677
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
576
678
|
}
|
|
@@ -601,6 +703,12 @@ export const lessThanEqualsByteStringV1 = {
|
|
|
601
703
|
cpuModel: Cost.Linear(88, 89)(Cost.Min),
|
|
602
704
|
memModel: Cost.Constant(90),
|
|
603
705
|
call: ([a, b]) => {
|
|
706
|
+
if (a === undefined) {
|
|
707
|
+
throw new Error("a is undefined in lessThanEqualsByteString()");
|
|
708
|
+
}
|
|
709
|
+
if (b === undefined) {
|
|
710
|
+
throw new Error("b is undefined in lessThanEqualsByteString()");
|
|
711
|
+
}
|
|
604
712
|
if (a._tag != "Const") {
|
|
605
713
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
606
714
|
}
|
|
@@ -631,6 +739,9 @@ export const sha2_256V1 = {
|
|
|
631
739
|
cpuModel: Cost.Linear(133, 134)(Cost.First),
|
|
632
740
|
memModel: Cost.Constant(135),
|
|
633
741
|
call: ([a]) => {
|
|
742
|
+
if (a === undefined) {
|
|
743
|
+
throw new Error("a is undefined in sha2_256()");
|
|
744
|
+
}
|
|
634
745
|
if (a._tag != "Const") {
|
|
635
746
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
636
747
|
}
|
|
@@ -660,6 +771,9 @@ export const sha3_256V1 = {
|
|
|
660
771
|
cpuModel: Cost.Linear(136, 137)(Cost.First),
|
|
661
772
|
memModel: Cost.Constant(138),
|
|
662
773
|
call: ([a]) => {
|
|
774
|
+
if (a === undefined) {
|
|
775
|
+
throw new Error("a is undefined in sha3_256()");
|
|
776
|
+
}
|
|
663
777
|
if (a._tag != "Const") {
|
|
664
778
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
665
779
|
}
|
|
@@ -689,6 +803,9 @@ export const blake2b_256V1 = {
|
|
|
689
803
|
cpuModel: Cost.Linear(14, 15)(Cost.First),
|
|
690
804
|
memModel: Cost.Constant(16),
|
|
691
805
|
call: ([a]) => {
|
|
806
|
+
if (a === undefined) {
|
|
807
|
+
throw new Error("a is undefined in blake2b_256()");
|
|
808
|
+
}
|
|
692
809
|
if (a._tag != "Const") {
|
|
693
810
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
694
811
|
}
|
|
@@ -708,6 +825,15 @@ export const verifyEd25519SignatureV1 = {
|
|
|
708
825
|
cpuModel: Cost.Linear(163, 164)(Cost.Third),
|
|
709
826
|
memModel: Cost.Constant(165),
|
|
710
827
|
call: ([pk, message, signature]) => {
|
|
828
|
+
if (pk === undefined) {
|
|
829
|
+
throw new Error("pk is undefined in verifyEd25519Signature()");
|
|
830
|
+
}
|
|
831
|
+
if (message === undefined) {
|
|
832
|
+
throw new Error("message is undefined in verifyEd25519Signature()");
|
|
833
|
+
}
|
|
834
|
+
if (signature === undefined) {
|
|
835
|
+
throw new Error("signature is undefined in verifyEd25519Signature()");
|
|
836
|
+
}
|
|
711
837
|
if (pk._tag != "Const") {
|
|
712
838
|
return Either.left(new WrongArgType(0, "Const", pk._tag));
|
|
713
839
|
}
|
|
@@ -757,6 +883,12 @@ export const appendStringV1 = {
|
|
|
757
883
|
cpuModel: Cost.Linear(8, 9)(Cost.Sum),
|
|
758
884
|
memModel: Cost.Linear(10, 11)(Cost.Sum),
|
|
759
885
|
call: ([a, b]) => {
|
|
886
|
+
if (a === undefined) {
|
|
887
|
+
throw new Error("a is undefined in appendString()");
|
|
888
|
+
}
|
|
889
|
+
if (b === undefined) {
|
|
890
|
+
throw new Error("b is undefined in appendString()");
|
|
891
|
+
}
|
|
760
892
|
if (a._tag != "Const") {
|
|
761
893
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
762
894
|
}
|
|
@@ -782,6 +914,12 @@ export const equalsStringV1 = {
|
|
|
782
914
|
cpuModel: Cost.ConstantOffDiag(69)(Cost.Linear(70, 71)(Cost.First)),
|
|
783
915
|
memModel: Cost.Constant(72),
|
|
784
916
|
call: ([a, b]) => {
|
|
917
|
+
if (a === undefined) {
|
|
918
|
+
throw new Error("a is undefined in equalsString()");
|
|
919
|
+
}
|
|
920
|
+
if (b === undefined) {
|
|
921
|
+
throw new Error("b is undefined in equalsString()");
|
|
922
|
+
}
|
|
785
923
|
if (a._tag != "Const") {
|
|
786
924
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
787
925
|
}
|
|
@@ -812,6 +950,9 @@ export const encodeUtf8V1 = {
|
|
|
812
950
|
cpuModel: Cost.Linear(55, 56)(Cost.First),
|
|
813
951
|
memModel: Cost.Linear(57, 58)(Cost.First),
|
|
814
952
|
call: ([a]) => {
|
|
953
|
+
if (a === undefined) {
|
|
954
|
+
throw new Error("a is undefined in encodeUtf8()");
|
|
955
|
+
}
|
|
815
956
|
if (a._tag != "Const") {
|
|
816
957
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
817
958
|
}
|
|
@@ -836,6 +977,9 @@ export const decodeUtf8V1 = {
|
|
|
836
977
|
cpuModel: Cost.Linear(45, 46)(Cost.First),
|
|
837
978
|
memModel: Cost.Linear(47, 48)(Cost.First),
|
|
838
979
|
call: ([a]) => {
|
|
980
|
+
if (a === undefined) {
|
|
981
|
+
throw new Error("a is undefined in decodeUtf8()");
|
|
982
|
+
}
|
|
839
983
|
if (a._tag != "Const") {
|
|
840
984
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
841
985
|
}
|
|
@@ -852,6 +996,15 @@ export const ifThenElseV1 = {
|
|
|
852
996
|
cpuModel: Cost.Constant(79),
|
|
853
997
|
memModel: Cost.Constant(80),
|
|
854
998
|
call: ([cond, a, b]) => {
|
|
999
|
+
if (cond === undefined) {
|
|
1000
|
+
throw new Error("cond is undefined in ifThenElse()");
|
|
1001
|
+
}
|
|
1002
|
+
if (a === undefined) {
|
|
1003
|
+
throw new Error("a is undefined in ifThenElse()");
|
|
1004
|
+
}
|
|
1005
|
+
if (b === undefined) {
|
|
1006
|
+
throw new Error("b is undefined in ifThenElse()");
|
|
1007
|
+
}
|
|
855
1008
|
if (cond._tag != "Const") {
|
|
856
1009
|
return Either.left(new WrongArgType(0, "Const", cond._tag));
|
|
857
1010
|
}
|
|
@@ -873,6 +1026,12 @@ export const chooseUnitV1 = {
|
|
|
873
1026
|
cpuModel: Cost.Constant(37),
|
|
874
1027
|
memModel: Cost.Constant(38),
|
|
875
1028
|
call: ([a, b]) => {
|
|
1029
|
+
if (a === undefined) {
|
|
1030
|
+
throw new Error("a is undefined in chooseUnit()");
|
|
1031
|
+
}
|
|
1032
|
+
if (b === undefined) {
|
|
1033
|
+
throw new Error("b is undefined in chooseUnit()");
|
|
1034
|
+
}
|
|
876
1035
|
if (a._tag != "Const") {
|
|
877
1036
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
878
1037
|
}
|
|
@@ -889,6 +1048,12 @@ export const traceV1 = {
|
|
|
889
1048
|
cpuModel: Cost.Constant(151),
|
|
890
1049
|
memModel: Cost.Constant(152),
|
|
891
1050
|
call: ([message, after], ctx) => {
|
|
1051
|
+
if (message === undefined) {
|
|
1052
|
+
throw new Error("message is undefined in trace()");
|
|
1053
|
+
}
|
|
1054
|
+
if (after === undefined) {
|
|
1055
|
+
throw new Error("after is undefined in trace()");
|
|
1056
|
+
}
|
|
892
1057
|
if (message._tag != "Const") {
|
|
893
1058
|
return Either.left(new WrongArgType(0, "Const", message._tag));
|
|
894
1059
|
}
|
|
@@ -916,6 +1081,9 @@ export const fstPairV1 = {
|
|
|
916
1081
|
cpuModel: Cost.Constant(73),
|
|
917
1082
|
memModel: Cost.Constant(74),
|
|
918
1083
|
call: ([a]) => {
|
|
1084
|
+
if (a === undefined) {
|
|
1085
|
+
throw new Error("a is undefined in fstPair()");
|
|
1086
|
+
}
|
|
919
1087
|
if (a._tag != "Const") {
|
|
920
1088
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
921
1089
|
}
|
|
@@ -940,6 +1108,9 @@ export const sndPairV1 = {
|
|
|
940
1108
|
cpuModel: Cost.Constant(143),
|
|
941
1109
|
memModel: Cost.Constant(144),
|
|
942
1110
|
call: ([a]) => {
|
|
1111
|
+
if (a === undefined) {
|
|
1112
|
+
throw new Error("a is undefined in sndPair()");
|
|
1113
|
+
}
|
|
943
1114
|
if (a._tag != "Const") {
|
|
944
1115
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
945
1116
|
}
|
|
@@ -969,6 +1140,15 @@ export const chooseListV1 = {
|
|
|
969
1140
|
cpuModel: Cost.Constant(35),
|
|
970
1141
|
memModel: Cost.Constant(36),
|
|
971
1142
|
call: ([lst, a, b]) => {
|
|
1143
|
+
if (lst === undefined) {
|
|
1144
|
+
throw new Error("lst is undefined in chooseList()");
|
|
1145
|
+
}
|
|
1146
|
+
if (a === undefined) {
|
|
1147
|
+
throw new Error("a is undefined in chooseList()");
|
|
1148
|
+
}
|
|
1149
|
+
if (b === undefined) {
|
|
1150
|
+
throw new Error("b is undefined in chooseList()");
|
|
1151
|
+
}
|
|
972
1152
|
if (lst._tag != "Const") {
|
|
973
1153
|
return Either.left(new WrongArgType(0, "Const", lst._tag));
|
|
974
1154
|
}
|
|
@@ -987,6 +1167,12 @@ export const mkConsV1 = {
|
|
|
987
1167
|
cpuModel: Cost.Constant(101),
|
|
988
1168
|
memModel: Cost.Constant(102),
|
|
989
1169
|
call: ([item, list]) => {
|
|
1170
|
+
if (item === undefined) {
|
|
1171
|
+
throw new Error("item is undefined in mkCons()");
|
|
1172
|
+
}
|
|
1173
|
+
if (list === undefined) {
|
|
1174
|
+
throw new Error("list is undefined in mkCons()");
|
|
1175
|
+
}
|
|
990
1176
|
if (list._tag != "Const") {
|
|
991
1177
|
return Either.left(new WrongArgType(0, "Const", list._tag));
|
|
992
1178
|
}
|
|
@@ -1021,21 +1207,23 @@ export const headListV1 = {
|
|
|
1021
1207
|
nArgs: 1,
|
|
1022
1208
|
cpuModel: Cost.Constant(75),
|
|
1023
1209
|
memModel: Cost.Constant(76),
|
|
1024
|
-
call: ([
|
|
1025
|
-
if (
|
|
1026
|
-
|
|
1210
|
+
call: ([l]) => {
|
|
1211
|
+
if (l === undefined) {
|
|
1212
|
+
throw new Error("list is undefined in headList()");
|
|
1027
1213
|
}
|
|
1028
|
-
if (
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1214
|
+
if (l._tag != "Const") {
|
|
1215
|
+
return Either.left(new WrongArgType(0, "Const", l._tag));
|
|
1216
|
+
}
|
|
1217
|
+
if (!(typeof l.value == "object" && l.value != null && "items" in l.value)) {
|
|
1218
|
+
return Either.left(new WrongArgType(0, "list", Value.describeType(l.value)));
|
|
1032
1219
|
}
|
|
1033
|
-
if (
|
|
1220
|
+
if (l.value.items.length == 0) {
|
|
1034
1221
|
return Either.left(new OutOfRange(0, 0));
|
|
1035
1222
|
}
|
|
1223
|
+
const head = l.value.items[0];
|
|
1036
1224
|
return Either.right({
|
|
1037
1225
|
_tag: "Const",
|
|
1038
|
-
value:
|
|
1226
|
+
value: head
|
|
1039
1227
|
});
|
|
1040
1228
|
}
|
|
1041
1229
|
};
|
|
@@ -1050,23 +1238,24 @@ export const tailListV1 = {
|
|
|
1050
1238
|
nArgs: 1,
|
|
1051
1239
|
cpuModel: Cost.Constant(149),
|
|
1052
1240
|
memModel: Cost.Constant(150),
|
|
1053
|
-
call: ([
|
|
1054
|
-
if (
|
|
1055
|
-
|
|
1241
|
+
call: ([l]) => {
|
|
1242
|
+
if (l === undefined) {
|
|
1243
|
+
throw new Error("list is undefined in tailList()");
|
|
1056
1244
|
}
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1245
|
+
if (l._tag != "Const") {
|
|
1246
|
+
return Either.left(new WrongArgType(0, "Const", l._tag));
|
|
1247
|
+
}
|
|
1248
|
+
if (!(typeof l.value == "object" && l.value != null && "items" in l.value)) {
|
|
1249
|
+
return Either.left(new WrongArgType(0, "list", Value.describeType(l.value)));
|
|
1061
1250
|
}
|
|
1062
|
-
if (
|
|
1251
|
+
if (l.value.items.length == 0) {
|
|
1063
1252
|
return Either.left(new OutOfRange(0, 0));
|
|
1064
1253
|
}
|
|
1065
1254
|
return Either.right({
|
|
1066
1255
|
_tag: "Const",
|
|
1067
1256
|
value: {
|
|
1068
|
-
itemType:
|
|
1069
|
-
items:
|
|
1257
|
+
itemType: l.value.itemType,
|
|
1258
|
+
items: l.value.items.slice(1)
|
|
1070
1259
|
}
|
|
1071
1260
|
});
|
|
1072
1261
|
}
|
|
@@ -1087,18 +1276,19 @@ export const nullListV1 = {
|
|
|
1087
1276
|
nArgs: 1,
|
|
1088
1277
|
cpuModel: Cost.Constant(119),
|
|
1089
1278
|
memModel: Cost.Constant(120),
|
|
1090
|
-
call: ([
|
|
1091
|
-
if (
|
|
1092
|
-
|
|
1279
|
+
call: ([l]) => {
|
|
1280
|
+
if (l === undefined) {
|
|
1281
|
+
throw new Error("list is undefined in nullList()");
|
|
1093
1282
|
}
|
|
1094
|
-
if (
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1283
|
+
if (l._tag != "Const") {
|
|
1284
|
+
return Either.left(new WrongArgType(0, "Const", l._tag));
|
|
1285
|
+
}
|
|
1286
|
+
if (!(typeof l.value == "object" && l.value != null && "items" in l.value)) {
|
|
1287
|
+
return Either.left(new WrongArgType(0, "list", Value.describeType(l.value)));
|
|
1098
1288
|
}
|
|
1099
1289
|
return Either.right({
|
|
1100
1290
|
_tag: "Const",
|
|
1101
|
-
value:
|
|
1291
|
+
value: l.value.items.length == 0
|
|
1102
1292
|
});
|
|
1103
1293
|
}
|
|
1104
1294
|
};
|
|
@@ -1114,6 +1304,24 @@ export const chooseDataV1 = {
|
|
|
1114
1304
|
cpuModel: Cost.Constant(33),
|
|
1115
1305
|
memModel: Cost.Constant(34),
|
|
1116
1306
|
call: ([cond, constrCase, mapCase, listCase, intCase, bytesCase]) => {
|
|
1307
|
+
if (cond === undefined) {
|
|
1308
|
+
throw new Error("cond is undefined in chooseData()");
|
|
1309
|
+
}
|
|
1310
|
+
if (constrCase === undefined) {
|
|
1311
|
+
throw new Error("constrCase is undefined in chooseData()");
|
|
1312
|
+
}
|
|
1313
|
+
if (mapCase === undefined) {
|
|
1314
|
+
throw new Error("mapCase is undefined in chooseData()");
|
|
1315
|
+
}
|
|
1316
|
+
if (listCase === undefined) {
|
|
1317
|
+
throw new Error("listCase is undefined in chooseData()");
|
|
1318
|
+
}
|
|
1319
|
+
if (intCase === undefined) {
|
|
1320
|
+
throw new Error("intCase is undefined in chooseData()");
|
|
1321
|
+
}
|
|
1322
|
+
if (bytesCase === undefined) {
|
|
1323
|
+
throw new Error("bytesCase is undefined in chooseData()");
|
|
1324
|
+
}
|
|
1117
1325
|
if (cond._tag != "Const") {
|
|
1118
1326
|
return Either.left(new WrongArgType(0, "Const", cond._tag));
|
|
1119
1327
|
}
|
|
@@ -1150,6 +1358,12 @@ export const constrDataV1 = {
|
|
|
1150
1358
|
cpuModel: Cost.Constant(43),
|
|
1151
1359
|
memModel: Cost.Constant(44),
|
|
1152
1360
|
call: ([tag, fields]) => {
|
|
1361
|
+
if (tag === undefined) {
|
|
1362
|
+
throw new Error("tag is undefined in constrData()");
|
|
1363
|
+
}
|
|
1364
|
+
if (fields === undefined) {
|
|
1365
|
+
throw new Error("fields is undefined in constrData()");
|
|
1366
|
+
}
|
|
1153
1367
|
if (tag._tag != "Const") {
|
|
1154
1368
|
return Either.left(new WrongArgType(0, "Const", tag._tag));
|
|
1155
1369
|
}
|
|
@@ -1185,6 +1399,9 @@ export const mapDataV1 = {
|
|
|
1185
1399
|
cpuModel: Cost.Constant(99),
|
|
1186
1400
|
memModel: Cost.Constant(100),
|
|
1187
1401
|
call: ([pairs]) => {
|
|
1402
|
+
if (pairs === undefined) {
|
|
1403
|
+
throw new Error("pairs is undefined in mapData()");
|
|
1404
|
+
}
|
|
1188
1405
|
if (pairs._tag != "Const") {
|
|
1189
1406
|
return Either.left(new WrongArgType(0, "Const", pairs._tag));
|
|
1190
1407
|
}
|
|
@@ -1227,6 +1444,9 @@ export const listDataV1 = {
|
|
|
1227
1444
|
cpuModel: Cost.Constant(97),
|
|
1228
1445
|
memModel: Cost.Constant(98),
|
|
1229
1446
|
call: ([list]) => {
|
|
1447
|
+
if (list === undefined) {
|
|
1448
|
+
throw new Error("list is undefined in listData()");
|
|
1449
|
+
}
|
|
1230
1450
|
if (list._tag != "Const") {
|
|
1231
1451
|
return Either.left(new WrongArgType(0, "Const", list._tag));
|
|
1232
1452
|
}
|
|
@@ -1260,6 +1480,9 @@ export const iDataV1 = {
|
|
|
1260
1480
|
cpuModel: Cost.Constant(77),
|
|
1261
1481
|
memModel: Cost.Constant(78),
|
|
1262
1482
|
call: ([x]) => {
|
|
1483
|
+
if (x === undefined) {
|
|
1484
|
+
throw new Error("x is undefined in iData()");
|
|
1485
|
+
}
|
|
1263
1486
|
if (x._tag != "Const") {
|
|
1264
1487
|
return Either.left(new WrongArgType(0, "Const", x._tag));
|
|
1265
1488
|
}
|
|
@@ -1288,6 +1511,9 @@ export const bDataV1 = {
|
|
|
1288
1511
|
cpuModel: Cost.Constant(12),
|
|
1289
1512
|
memModel: Cost.Constant(13),
|
|
1290
1513
|
call: ([b]) => {
|
|
1514
|
+
if (b === undefined) {
|
|
1515
|
+
throw new Error("b is undefined in bData()");
|
|
1516
|
+
}
|
|
1291
1517
|
if (b._tag != "Const") {
|
|
1292
1518
|
return Either.left(new WrongArgType(0, "Const", b._tag));
|
|
1293
1519
|
}
|
|
@@ -1311,6 +1537,9 @@ export const unConstrDataV1 = {
|
|
|
1311
1537
|
cpuModel: Cost.Constant(155),
|
|
1312
1538
|
memModel: Cost.Constant(156),
|
|
1313
1539
|
call: ([data]) => {
|
|
1540
|
+
if (data === undefined) {
|
|
1541
|
+
throw new Error("data is undefined in unConstrData()");
|
|
1542
|
+
}
|
|
1314
1543
|
if (data._tag != "Const") {
|
|
1315
1544
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1316
1545
|
}
|
|
@@ -1318,7 +1547,7 @@ export const unConstrDataV1 = {
|
|
|
1318
1547
|
return Either.left(new WrongArgType(0, "data", Value.describeType(data.value)));
|
|
1319
1548
|
}
|
|
1320
1549
|
if (!("fields" in data.value.data)) {
|
|
1321
|
-
return Either.left(new WrongArgType(0, "constr data",
|
|
1550
|
+
return Either.left(new WrongArgType(0, "constr data", Object.keys(data.value.data).join("")));
|
|
1322
1551
|
}
|
|
1323
1552
|
return Either.right({
|
|
1324
1553
|
_tag: "Const",
|
|
@@ -1349,6 +1578,9 @@ export const unMapDataV1 = {
|
|
|
1349
1578
|
cpuModel: Cost.Constant(161),
|
|
1350
1579
|
memModel: Cost.Constant(162),
|
|
1351
1580
|
call: ([data]) => {
|
|
1581
|
+
if (data === undefined) {
|
|
1582
|
+
throw new Error("data is undefined in unMapData()");
|
|
1583
|
+
}
|
|
1352
1584
|
if (data._tag != "Const") {
|
|
1353
1585
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1354
1586
|
}
|
|
@@ -1387,6 +1619,9 @@ export const unListDataV1 = {
|
|
|
1387
1619
|
cpuModel: Cost.Constant(159),
|
|
1388
1620
|
memModel: Cost.Constant(160),
|
|
1389
1621
|
call: ([data]) => {
|
|
1622
|
+
if (data === undefined) {
|
|
1623
|
+
throw new Error("data is undefined in unListData()");
|
|
1624
|
+
}
|
|
1390
1625
|
if (data._tag != "Const") {
|
|
1391
1626
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1392
1627
|
}
|
|
@@ -1422,6 +1657,9 @@ export const unIDataV1 = {
|
|
|
1422
1657
|
cpuModel: Cost.Constant(157),
|
|
1423
1658
|
memModel: Cost.Constant(158),
|
|
1424
1659
|
call: ([data]) => {
|
|
1660
|
+
if (data === undefined) {
|
|
1661
|
+
throw new Error("data is undefined in unIData()");
|
|
1662
|
+
}
|
|
1425
1663
|
if (data._tag != "Const") {
|
|
1426
1664
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1427
1665
|
}
|
|
@@ -1454,6 +1692,9 @@ export const unBDataV1 = {
|
|
|
1454
1692
|
cpuModel: Cost.Constant(153),
|
|
1455
1693
|
memModel: Cost.Constant(154),
|
|
1456
1694
|
call: ([data]) => {
|
|
1695
|
+
if (data === undefined) {
|
|
1696
|
+
throw new Error("data is undefined in unBData()");
|
|
1697
|
+
}
|
|
1457
1698
|
if (data._tag != "Const") {
|
|
1458
1699
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1459
1700
|
}
|
|
@@ -1482,10 +1723,16 @@ export const unBDataV3 = {
|
|
|
1482
1723
|
export const equalsDataV1 = {
|
|
1483
1724
|
name: "equalsData",
|
|
1484
1725
|
forceCount: 0,
|
|
1485
|
-
nArgs:
|
|
1726
|
+
nArgs: 2,
|
|
1486
1727
|
cpuModel: Cost.Linear(63, 64)(Cost.Min),
|
|
1487
1728
|
memModel: Cost.Constant(65),
|
|
1488
1729
|
call: ([a, b]) => {
|
|
1730
|
+
if (a === undefined) {
|
|
1731
|
+
throw new Error("a is undefined in equalsData()");
|
|
1732
|
+
}
|
|
1733
|
+
if (b === undefined) {
|
|
1734
|
+
throw new Error("b is undefined in equalsData()");
|
|
1735
|
+
}
|
|
1489
1736
|
if (a._tag != "Const") {
|
|
1490
1737
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
1491
1738
|
}
|
|
@@ -1516,6 +1763,12 @@ export const mkPairDataV1 = {
|
|
|
1516
1763
|
cpuModel: Cost.Constant(107),
|
|
1517
1764
|
memModel: Cost.Constant(108),
|
|
1518
1765
|
call: ([a, b]) => {
|
|
1766
|
+
if (a === undefined) {
|
|
1767
|
+
throw new Error("a is undefined in mkPairData()");
|
|
1768
|
+
}
|
|
1769
|
+
if (b === undefined) {
|
|
1770
|
+
throw new Error("b is undefined in mkPairData()");
|
|
1771
|
+
}
|
|
1519
1772
|
if (a._tag != "Const") {
|
|
1520
1773
|
return Either.left(new WrongArgType(0, "Const", a._tag));
|
|
1521
1774
|
}
|
|
@@ -1549,6 +1802,9 @@ export const mkNilDataV1 = {
|
|
|
1549
1802
|
cpuModel: Cost.Constant(103),
|
|
1550
1803
|
memModel: Cost.Constant(104),
|
|
1551
1804
|
call: ([unit]) => {
|
|
1805
|
+
if (unit === undefined) {
|
|
1806
|
+
throw new Error("unit is undefined in mkNilData()");
|
|
1807
|
+
}
|
|
1552
1808
|
if (unit._tag != "Const") {
|
|
1553
1809
|
return Either.left(new WrongArgType(0, "Const", unit._tag));
|
|
1554
1810
|
}
|
|
@@ -1576,13 +1832,15 @@ export const mkNilPairDataV1 = {
|
|
|
1576
1832
|
cpuModel: Cost.Constant(105),
|
|
1577
1833
|
memModel: Cost.Constant(106),
|
|
1578
1834
|
call: ([unit]) => {
|
|
1835
|
+
if (unit === undefined) {
|
|
1836
|
+
throw new Error("unit is undefined in mkNilPairData()");
|
|
1837
|
+
}
|
|
1579
1838
|
if (unit._tag != "Const") {
|
|
1580
1839
|
return Either.left(new WrongArgType(0, "Const", unit._tag));
|
|
1581
1840
|
}
|
|
1582
1841
|
if (unit.value !== null) {
|
|
1583
1842
|
return Either.left(new WrongArgType(0, "null", Value.describeType(unit.value)));
|
|
1584
1843
|
}
|
|
1585
|
-
console.log("RETURNING", Type.DataPair);
|
|
1586
1844
|
return Either.right({
|
|
1587
1845
|
_tag: "Const",
|
|
1588
1846
|
value: {
|
|
@@ -1604,6 +1862,9 @@ export const serialiseDataV2 = {
|
|
|
1604
1862
|
cpuModel: Cost.Linear(133, 134)(Cost.First),
|
|
1605
1863
|
memModel: Cost.Linear(135, 136)(Cost.First),
|
|
1606
1864
|
call: ([data]) => {
|
|
1865
|
+
if (data === undefined) {
|
|
1866
|
+
throw new Error("data is undefined in serialiseData()");
|
|
1867
|
+
}
|
|
1607
1868
|
if (data._tag != "Const") {
|
|
1608
1869
|
return Either.left(new WrongArgType(0, "Const", data._tag));
|
|
1609
1870
|
}
|