From 94876f65f30299d11fcfe1093d33d7014dfd64c6 Mon Sep 17 00:00:00 2001 From: veeso Date: Wed, 8 Nov 2023 18:30:08 +0100 Subject: [PATCH] feat: tests are running --- Cargo.lock | 200 ------------------ Cargo.toml | 2 - integration-tests/package.json | 3 +- integration-tests/tests/actor.js | 4 +- integration-tests/tests/sell_contract.test.js | 2 +- integration-tests/yarn.lock | 5 + scripts/deploy_functions.sh | 2 +- scripts/dfx-test.sh | 4 +- src/declarations/sell_contract/index.d.ts | 50 +++++ src/declarations/sell_contract/index.js | 43 ++++ .../sell_contract/sell_contract.did.d.ts | 49 +++++ .../sell_contract/sell_contract.did.js | 70 ++++++ src/sell_contract/Cargo.toml | 1 - src/sell_contract/src/app.rs | 5 +- 14 files changed, 228 insertions(+), 212 deletions(-) create mode 100644 src/declarations/sell_contract/index.d.ts create mode 100644 src/declarations/sell_contract/index.js create mode 100644 src/declarations/sell_contract/sell_contract.did.d.ts create mode 100644 src/declarations/sell_contract/sell_contract.did.js diff --git a/Cargo.lock b/Cargo.lock index f1eab7d..d5b9455 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anyhow" version = "1.0.75" @@ -78,12 +63,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - [[package]] name = "byteorder" version = "1.5.0" @@ -144,20 +123,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -168,12 +133,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - [[package]] name = "cpufeatures" version = "0.2.11" @@ -283,29 +242,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "iana-time-zone" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "ic-cdk" version = "0.11.3" @@ -364,15 +300,6 @@ dependencies = [ "either", ] -[[package]] -name = "js-sys" -version = "0.3.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -391,12 +318,6 @@ version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - [[package]] name = "memchr" version = "2.6.4" @@ -537,7 +458,6 @@ version = "0.1.0" dependencies = [ "async-trait", "candid", - "chrono", "did", "dip721", "ic-cdk", @@ -710,60 +630,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wasm-bindgen" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" - [[package]] name = "winapi" version = "0.3.9" @@ -795,72 +661,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "winnow" version = "0.5.19" diff --git a/Cargo.toml b/Cargo.toml index 04cfa53..8643195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,10 @@ version = "0.1.0" [workspace.dependencies] async-trait = "0.1" candid = "0.9" -chrono = "0.4" ic-cdk = "0.11" ic-cdk-macros = "0.8" ic-stable-structures = "0.6" itertools = "0.11" -log = "0.4" num-bigint = "0.4" serde = { version = "1", features = ["derive"] } thiserror = "1.0" diff --git a/integration-tests/package.json b/integration-tests/package.json index bcb204a..cbd5791 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -7,7 +7,7 @@ "license": "MIT", "private": true, "scripts": { - "test": "vitest" + "test": "vitest run" }, "devDependencies": { "isomorphic-fetch": "^3.0.0", @@ -15,6 +15,7 @@ }, "dependencies": { "@dfinity/agent": "^0.19.3", + "@dfinity/candid": "^0.19.3", "@dfinity/principal": "^0.19.3" } } diff --git a/integration-tests/tests/actor.js b/integration-tests/tests/actor.js index 4bd8b99..0c08fba 100644 --- a/integration-tests/tests/actor.js +++ b/integration-tests/tests/actor.js @@ -13,6 +13,6 @@ const createActor = async (canisterId, options) => { }); }; -export const sellContract = await createActor(canisterIds.sell_contract, { - agentOptions: { host: "http://localhost:8000", fetch }, +export const sellContract = await createActor(canisterIds.sell_contract.local, { + agentOptions: { host: "http://localhost:4943", fetch }, }); diff --git a/integration-tests/tests/sell_contract.test.js b/integration-tests/tests/sell_contract.test.js index 8242d43..f32a545 100644 --- a/integration-tests/tests/sell_contract.test.js +++ b/integration-tests/tests/sell_contract.test.js @@ -1,7 +1,7 @@ import { expect, test } from "vitest"; import { Principal } from "@dfinity/principal"; -import { sellContract } from "./actor.js"; +import { sellContract } from "./actor"; test("should be able to update fly canister principal", async () => { const principal = Principal.fromText("rrkah-fqaaa-aaaaa-aaaaq-cai"); diff --git a/integration-tests/yarn.lock b/integration-tests/yarn.lock index b7bdf87..ddf6dd4 100644 --- a/integration-tests/yarn.lock +++ b/integration-tests/yarn.lock @@ -12,6 +12,11 @@ borc "^2.1.1" simple-cbor "^0.4.1" +"@dfinity/candid@^0.19.3": + version "0.19.3" + resolved "https://registry.yarnpkg.com/@dfinity/candid/-/candid-0.19.3.tgz#edc3491572d293824b821ce3a4fc50f5b4714f4d" + integrity sha512-yXfbLSWTeRd4G0bLLxYoDqpXH3Jim0P+1PPZOoktXNC1X1hB+ea3yrZebX75t4GVoQK7123F7mxWHiPjuV2tQQ== + "@dfinity/principal@^0.19.3": version "0.19.3" resolved "https://registry.yarnpkg.com/@dfinity/principal/-/principal-0.19.3.tgz#428cfca3d2d2de9e1433b3b33498fd595fb441d8" diff --git a/scripts/deploy_functions.sh b/scripts/deploy_functions.sh index 46d4bd4..55e8936 100644 --- a/scripts/deploy_functions.sh +++ b/scripts/deploy_functions.sh @@ -18,6 +18,6 @@ deploy_sell_contract() { custodians = vec { principal \"$ADMIN_PRINCIPAL\" }; })" - dfx canister install --mode=$INSTALL_MODE --yes --network="$NETWORK" --argument="$sell_contract_init_args" sell_contract + dfx deploy --mode=$INSTALL_MODE --yes --network="$NETWORK" --argument="$sell_contract_init_args" sell_contract } diff --git a/scripts/dfx-test.sh b/scripts/dfx-test.sh index f5a465b..ffe943b 100755 --- a/scripts/dfx-test.sh +++ b/scripts/dfx-test.sh @@ -14,9 +14,11 @@ source ./deploy_functions.sh dfx stop dfx start --background +cd ../ + deploy_sell_contract "reinstall" "local" "$SELL_CONTRACT_PRINCIPAL" "$FLY_PRINCIPAL" "$MARKETPLACE_PRINCIPAL" "$ADMIN_PRINCIPAL" -cd ../integration-tests/ +cd ./integration-tests/ yarn && yarn test RES=$? diff --git a/src/declarations/sell_contract/index.d.ts b/src/declarations/sell_contract/index.d.ts new file mode 100644 index 0000000..caea9a0 --- /dev/null +++ b/src/declarations/sell_contract/index.d.ts @@ -0,0 +1,50 @@ +import type { + ActorSubclass, + HttpAgentOptions, + ActorConfig, + Agent, +} from "@dfinity/agent"; +import type { Principal } from "@dfinity/principal"; +import type { IDL } from "@dfinity/candid"; + +import { _SERVICE } from './sell_contract.did'; + +export declare const idlFactory: IDL.InterfaceFactory; +export declare const canisterId: string; + +export declare interface CreateActorOptions { + /** + * @see {@link Agent} + */ + agent?: Agent; + /** + * @see {@link HttpAgentOptions} + */ + agentOptions?: HttpAgentOptions; + /** + * @see {@link ActorConfig} + */ + actorOptions?: ActorConfig; +} + +/** + * Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister. + * @constructs {@link ActorSubClass} + * @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to + * @param {CreateActorOptions} options - see {@link CreateActorOptions} + * @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions + * @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent + * @see {@link HttpAgentOptions} + * @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor + * @see {@link ActorConfig} + */ +export declare const createActor: ( + canisterId: string | Principal, + options?: CreateActorOptions +) => ActorSubclass<_SERVICE>; + +/** + * Intialized Actor using default settings, ready to talk to a canister using its candid interface + * @constructs {@link ActorSubClass} + */ +export declare const sell_contract: ActorSubclass<_SERVICE>; diff --git a/src/declarations/sell_contract/index.js b/src/declarations/sell_contract/index.js new file mode 100644 index 0000000..b3a5b04 --- /dev/null +++ b/src/declarations/sell_contract/index.js @@ -0,0 +1,43 @@ +import { Actor, HttpAgent } from "@dfinity/agent"; + +// Imports and re-exports candid interface +import { idlFactory } from "./sell_contract.did.js"; +export { idlFactory } from "./sell_contract.did.js"; + +/* CANISTER_ID is replaced by webpack based on node environment + * Note: canister environment variable will be standardized as + * process.env.CANISTER_ID_ + * beginning in dfx 0.15.0 + */ +export const canisterId = + process.env.CANISTER_ID_SELL_CONTRACT || + process.env.SELL_CONTRACT_CANISTER_ID; + +export const createActor = (canisterId, options = {}) => { + const agent = options.agent || new HttpAgent({ ...options.agentOptions }); + + if (options.agent && options.agentOptions) { + console.warn( + "Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent." + ); + } + + // Fetch root key for certificate validation during development + if (process.env.DFX_NETWORK !== "ic") { + agent.fetchRootKey().catch((err) => { + console.warn( + "Unable to fetch root key. Check to ensure that your local replica is running" + ); + console.error(err); + }); + } + + // Creates an actor with using the candid interface and the HttpAgent + return Actor.createActor(idlFactory, { + agent, + canisterId, + ...options.actorOptions, + }); +}; + +export const sell_contract = createActor(canisterId); diff --git a/src/declarations/sell_contract/sell_contract.did.d.ts b/src/declarations/sell_contract/sell_contract.did.d.ts new file mode 100644 index 0000000..5e06d12 --- /dev/null +++ b/src/declarations/sell_contract/sell_contract.did.d.ts @@ -0,0 +1,49 @@ +import type { Principal } from '@dfinity/principal'; +import type { ActorMethod } from '@dfinity/agent'; + +export interface BuildingData { 'city' : string } +export type ConfigurationError = { 'CustodialsCantBeEmpty' : null } | + { 'AnonymousCustodial' : null }; +export interface Contract { + 'id' : bigint, + 'value' : bigint, + 'building' : BuildingData, + 'seller' : Principal, + 'expiration' : string, + 'tokens' : Array, + 'buyers' : Array, + 'mfly_reward' : bigint, +} +export type FlyError = { 'StorageError' : null }; +export type Result = { 'Ok' : null } | + { 'Err' : SellContractError }; +export type SellContractError = { 'Fly' : FlyError } | + { 'Configuration' : ConfigurationError } | + { 'Unauthorized' : null } | + { 'Token' : TokenError } | + { 'StorageError' : null }; +export interface SellContractInitData { + 'fly_canister' : Principal, + 'custodians' : Array, + 'marketplace_canister' : Principal, +} +export type TokenError = { 'ContractValueIsNotMultipleOfInstallments' : null } | + { 'TokenAlreadyExists' : bigint } | + { 'TokensMismatch' : null } | + { 'ContractAlreadyExists' : bigint } | + { 'TokenDoesNotBelongToContract' : bigint } | + { 'TokenNotFound' : bigint } | + { 'ContractHasNoTokens' : null } | + { 'TokenIsBurned' : bigint } | + { 'InvalidExpirationDate' : null } | + { 'BadMintTokenOwner' : bigint }; +export interface _SERVICE { + 'admin_register_contract' : ActorMethod< + [bigint, Principal, Array, string, bigint, bigint, BuildingData], + Result + >, + 'admin_set_fly_canister' : ActorMethod<[Principal], undefined>, + 'admin_set_marketplace_canister' : ActorMethod<[Principal], undefined>, + 'get_contract' : ActorMethod<[bigint], [] | [Contract]>, + 'get_contracts' : ActorMethod<[], Array>, +} diff --git a/src/declarations/sell_contract/sell_contract.did.js b/src/declarations/sell_contract/sell_contract.did.js new file mode 100644 index 0000000..1dd498b --- /dev/null +++ b/src/declarations/sell_contract/sell_contract.did.js @@ -0,0 +1,70 @@ +export const idlFactory = ({ IDL }) => { + const SellContractInitData = IDL.Record({ + 'fly_canister' : IDL.Principal, + 'custodians' : IDL.Vec(IDL.Principal), + 'marketplace_canister' : IDL.Principal, + }); + const BuildingData = IDL.Record({ 'city' : IDL.Text }); + const FlyError = IDL.Variant({ 'StorageError' : IDL.Null }); + const ConfigurationError = IDL.Variant({ + 'CustodialsCantBeEmpty' : IDL.Null, + 'AnonymousCustodial' : IDL.Null, + }); + const TokenError = IDL.Variant({ + 'ContractValueIsNotMultipleOfInstallments' : IDL.Null, + 'TokenAlreadyExists' : IDL.Nat, + 'TokensMismatch' : IDL.Null, + 'ContractAlreadyExists' : IDL.Nat, + 'TokenDoesNotBelongToContract' : IDL.Nat, + 'TokenNotFound' : IDL.Nat, + 'ContractHasNoTokens' : IDL.Null, + 'TokenIsBurned' : IDL.Nat, + 'InvalidExpirationDate' : IDL.Null, + 'BadMintTokenOwner' : IDL.Nat, + }); + const SellContractError = IDL.Variant({ + 'Fly' : FlyError, + 'Configuration' : ConfigurationError, + 'Unauthorized' : IDL.Null, + 'Token' : TokenError, + 'StorageError' : IDL.Null, + }); + const Result = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : SellContractError }); + const Contract = IDL.Record({ + 'id' : IDL.Nat, + 'value' : IDL.Nat64, + 'building' : BuildingData, + 'seller' : IDL.Principal, + 'expiration' : IDL.Text, + 'tokens' : IDL.Vec(IDL.Nat), + 'buyers' : IDL.Vec(IDL.Principal), + 'mfly_reward' : IDL.Nat64, + }); + return IDL.Service({ + 'admin_register_contract' : IDL.Func( + [ + IDL.Nat, + IDL.Principal, + IDL.Vec(IDL.Principal), + IDL.Text, + IDL.Nat64, + IDL.Nat64, + BuildingData, + ], + [Result], + [], + ), + 'admin_set_fly_canister' : IDL.Func([IDL.Principal], [], []), + 'admin_set_marketplace_canister' : IDL.Func([IDL.Principal], [], []), + 'get_contract' : IDL.Func([IDL.Nat], [IDL.Opt(Contract)], ['query']), + 'get_contracts' : IDL.Func([], [IDL.Vec(IDL.Nat)], ['query']), + }); +}; +export const init = ({ IDL }) => { + const SellContractInitData = IDL.Record({ + 'fly_canister' : IDL.Principal, + 'custodians' : IDL.Vec(IDL.Principal), + 'marketplace_canister' : IDL.Principal, + }); + return [SellContractInitData]; +}; diff --git a/src/sell_contract/Cargo.toml b/src/sell_contract/Cargo.toml index 047455a..8cf9737 100644 --- a/src/sell_contract/Cargo.toml +++ b/src/sell_contract/Cargo.toml @@ -20,7 +20,6 @@ did = [] [dependencies] async-trait = { workspace = true } candid = { workspace = true } -chrono = { workspace = true } did = { path = "../did" } dip721 = { path = "../dip721" } ic-cdk = { workspace = true } diff --git a/src/sell_contract/src/app.rs b/src/sell_contract/src/app.rs index 758d36d..b612c71 100644 --- a/src/sell_contract/src/app.rs +++ b/src/sell_contract/src/app.rs @@ -8,7 +8,6 @@ mod storage; use async_trait::async_trait; use candid::{Nat, Principal}; -use chrono::NaiveDate; use configuration::Configuration; use did::sell_contract::{ BuildingData, Contract, SellContractError, SellContractInitData, SellContractResult, Token, @@ -120,8 +119,8 @@ impl SellContract { } // check if expiration is YYYY-MM-DD - NaiveDate::parse_from_str(expiration, "%Y-%m-%d") - .map_err(|_| SellContractError::Token(TokenError::InvalidExpirationDate))?; + // TODO: parse datetime + todo!("parse date"); Ok(()) }