Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback for “Vesting” #70

Open
avilsmeier opened this issue Jul 12, 2024 · 0 comments
Open

Feedback for “Vesting” #70

avilsmeier opened this issue Jul 12, 2024 · 0 comments

Comments

@avilsmeier
Copy link

Hey guys, getting this error when running vesting-unlock.ts

deno run --allow-net --allow-read --allow-env .\vesting-unlock.ts
error: Uncaught (in promise) Error: Could not type cast to string/bytes.
throw new Error("Could not type cast to string/bytes.");

at castFrom (https://deno.land/x/[email protected]/src/plutus/data.ts:286:15)
at https://deno.land/x/[email protected]/src/plutus/data.ts:345:26
at Array.forEach (<anonymous>)
at castFrom (https://deno.land/x/[email protected]/src/plutus/data.ts:338:51)
at Object.from (https://deno.land/x/[email protected]/src/plutus/data.ts:188:18)
at file:///C:/Users/alfre/Documents/AIKEN/hello-world/vesting-unlock.ts:58:22
at Array.filter (<anonymous>)
at file:///C:/Users/alfre/Documents/AIKEN/hello-world/vesting-unlock.ts:57:27
at eventLoopTick (ext:core/01_core.js:168:7)

Lines 57 and 58 are the first 2 of these:

const utxos = scriptUtxos.filter((utxo) => {
let datum = Data.from(
utxo.datum,
Datum,
);

return datum.beneficiary === beneficiaryPublicKeyHash &&
  datum.lock_until <= currentTime;

});

Not sure if/how to set the correct type :D

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant