Skip to content

Commit

Permalink
[legacy-runtime] use io-ts commonjs version
Browse files Browse the repository at this point in the history
  • Loading branch information
nhenin committed Aug 16, 2023
1 parent e070bc9 commit 884fdb4
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/legacy-adapter/src/time.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { pipe } from "fp-ts/lib/function.js";
import { format, formatISO } from "date-fns";

Expand Down
6 changes: 2 additions & 4 deletions packages/legacy-runtime/src/common/block.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@


import * as t from "io-ts";
import { identity } from 'fp-ts/lib/function.js'
import { failure, success, Type } from 'io-ts'
import {PositiveBigInt} from 'io-ts-bigint'
import * as t from "io-ts/lib/index.js";
import { failure, success, Type } from 'io-ts/lib/index.js'


export function isBigIntOrNumber(u: unknown): u is (bigint | number) {
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/metadata/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";


export type MetadatumLabel = t.TypeOf<typeof MetadatumLabel>
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/metadata/tag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { Metadata } from "./index.js";


Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/policyId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { iso, Newtype } from "newtype-ts";
import { fromNewtype } from "io-ts-types";

Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/textEnvelope.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import reporter from 'jsonbigint-io-ts-reporters'
import { Newtype } from "newtype-ts";
import { fromNewtype,option, optionFromNullable } from "io-ts-types";
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

// see : https://input-output-hk.github.io/cardano-node/cardano-api/lib/Cardano-Api-SerialiseTextEnvelope.html

Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/tx/id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

export type TxId = t.TypeOf<typeof TxId>
export const TxId = t.string // to refine
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/tx/outRef.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { iso, Newtype } from "newtype-ts";
import { fromNewtype } from "io-ts-types";

Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/common/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

export type MarloweVersion = t.TypeOf<typeof MarloweVersion>;
export const MarloweVersion = t.literal('v1')
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/details.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { optionFromNullable } from "io-ts-types";
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { Contract } from "@marlowe/language-core-v1";
import { MarloweState } from "@marlowe/language-core-v1/state";
import { ContractId } from "./id.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { AxiosInstance, ParamEncoder, ParamsSerializerOptions } from 'axios';

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import * as TE from 'fp-ts/lib/TaskEither.js'
import { pipe } from 'fp-ts/lib/function.js';
import * as E from 'fp-ts/lib/Either.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { pipe } from 'fp-ts/lib/function.js';
import * as HTTP from '../../common/http.js';
import { HexTransactionWitnessSet, transactionWitnessSetTextEnvelope } from '../../common/textEnvelope.js';
import { ContractDetails } from '../details.js';
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import {formatValidationErrors} from 'jsonbigint-io-ts-reporters'
import { DecodingError } from '../../common/codec.js';
import { ContractId, unContractId } from '../id.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MarloweVersion } from "../common/version.js";
import { TxStatus } from "./transaction/status.js";
import { ContractId } from "./id.js";
import { optionFromNullable } from "io-ts-types";
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

import { PolicyId } from "../common/policyId.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { iso, Newtype } from "newtype-ts";
import { fromNewtype } from "io-ts-types";
import { split } from "fp-ts/lib/string.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/role.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts"
import * as t from "io-ts/lib/index.js"
import { optionFromNullable } from "io-ts-types";
import { PolicyId } from "@marlowe/language-core-v1";
import { AddressBech32 } from "../common/address.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { optionFromNullable } from "io-ts-types";
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

import { ISO8601 } from "@marlowe/legacy-adapter/time";
import { BuiltinByteString, Input } from "@marlowe/language-core-v1";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { Newtype, iso } from 'newtype-ts'
import * as E from 'fp-ts/lib/Either.js'
import * as A from 'fp-ts/lib/Array.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AxiosInstance } from "axios";
import { TransactionId, unTransactionId } from "../id.js";
import { ContractId, unContractId } from "../../id.js";
import { DecodingError } from "../../../common/codec.js";
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { formatValidationErrors } from "jsonbigint-io-ts-reporters";
import { Details } from "../details.js";
import { HexTransactionWitnessSet, transactionWitnessSetTextEnvelope } from "../../../common/textEnvelope.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/transaction/header.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { optionFromNullable } from "io-ts-types";
import { BuiltinByteString } from "@marlowe/language-core-v1";

Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/transaction/id.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { iso, Newtype } from "newtype-ts";
import { fromNewtype } from "io-ts-types";
import { TxId } from "../../common/tx/id.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/transaction/status.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";

export type TxStatus = t.TypeOf<typeof TxStatus>
export const TxStatus = t.union([ t.literal('unsigned'),t.literal('submitted'),t.literal('confirmed') ])
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/withdrawal/details.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { BlockHeader } from "../../common/block.js";

import { WithdrawalId } from "./id.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Header } from '../header.js';

import { TextEnvelope } from '../../../common/textEnvelope.js';

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { formatValidationErrors } from 'jsonbigint-io-ts-reporters'
import { DecodingError } from '../../../common/codec.js';
import * as E from 'fp-ts/lib/Either.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/withdrawal/header.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { BlockHeader } from "../../common/block.js";

import { WithdrawalId } from "./id.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/contract/withdrawal/id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { iso, Newtype } from "newtype-ts";
import { fromNewtype } from "io-ts-types";
import { pipe } from "fp-ts/lib/function.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy-runtime/src/wallet/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HexTransactionWitnessSet, MarloweTxCBORHex } from '../common/textEnvelo
import { optionFromNullable } from "io-ts-types"
import { TxOutRef } from "../common/tx/outRef.js"
import { AddressBech32 } from "../common/address.js"
import * as t from "io-ts";
import * as t from "io-ts/lib/index.js";
import { pipe } from 'fp-ts/lib/function.js';
import { TokenValue } from '@marlowe/language-core-v1/semantics/contract/common/tokenValue.js';

Expand Down

0 comments on commit 884fdb4

Please sign in to comment.