Skip to content

Commit

Permalink
PLT-6480: don't keep dev scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornkihlberg committed Jul 3, 2023
1 parent ce3abc7 commit 7f8f7ea
Showing 1 changed file with 74 additions and 74 deletions.
148 changes: 74 additions & 74 deletions prototypes/graph-view/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { createRoot } from "react-dom/client"
// import { createRoot } from "react-dom/client"
import {
ReactFlow,
Node,
Expand Down Expand Up @@ -392,81 +392,81 @@ export const MarloweGraphView = ({ contract, path }: { contract: Contract, path?
</div>
}

const contract: Contract = {
when: [
{
case: {
deposits: 500,
party: { role_token: "Party A" },
of_token: { currency_symbol: "", token_name: "" },
into_account: { role_token: "Party B" }
},
then: { if: true, then: "close", else: "close" }
},
{
case: { notify_if: false },
then: {
when: [
{
case: {
deposits: 200,
party: { role_token: "Party A" },
of_token: { currency_symbol: "", token_name: "" },
into_account: { role_token: "Party B" }
},
then: { if: true, then: { assert: true, then: "close" }, else: "close" }
},
],
timout: 2001,
timeout_continuation: "close",
nodeEvents: {
onClick(state) {
console.log(`hey ho: ${state}`)
},
}
}
},
{
case: {
for_choice:
{
choice_name: "The way",
choice_owner: { role_token: "Party C" }
},
choose_between: [
{ from: 1, to: 3 },
{ from: 5, to: 8 }
]
},
merkleized_then: "huey-dewey-louie"
},
{
case: { notify_if: true },
then: { let: "x", be: 13, then: "close" }
}
],
timout: 1985,
timeout_continuation: {
if: true,
then: {
if: false,
then: "close",
else: {
pay: 1234,
token: { currency_symbol: "", token_name: "" },
to: { party: { role_token: "Owner" } },
from_account: { role_token: "Participant" },
then: "close",
}
},
else: { let: "x", be: 13, then: { assert: true, then: "close" } },
}
}

const root = createRoot(document.getElementById("app") as HTMLElement)
// const contract: Contract = {
// when: [
// {
// case: {
// deposits: 500,
// party: { role_token: "Party A" },
// of_token: { currency_symbol: "", token_name: "" },
// into_account: { role_token: "Party B" }
// },
// then: { if: true, then: "close", else: "close" }
// },
// {
// case: { notify_if: false },
// then: {
// when: [
// {
// case: {
// deposits: 200,
// party: { role_token: "Party A" },
// of_token: { currency_symbol: "", token_name: "" },
// into_account: { role_token: "Party B" }
// },
// then: { if: true, then: { assert: true, then: "close" }, else: "close" }
// },
// ],
// timout: 2001,
// timeout_continuation: "close",
// nodeEvents: {
// onClick(state) {
// console.log(`hey ho: ${state}`)
// },
// }
// }
// },
// {
// case: {
// for_choice:
// {
// choice_name: "The way",
// choice_owner: { role_token: "Party C" }
// },
// choose_between: [
// { from: 1, to: 3 },
// { from: 5, to: 8 }
// ]
// },
// merkleized_then: "huey-dewey-louie"
// },
// {
// case: { notify_if: true },
// then: { let: "x", be: 13, then: "close" }
// }
// ],
// timout: 1985,
// timeout_continuation: {
// if: true,
// then: {
// if: false,
// then: "close",
// else: {
// pay: 1234,
// token: { currency_symbol: "", token_name: "" },
// to: { party: { role_token: "Owner" } },
// from_account: { role_token: "Participant" },
// then: "close",
// }
// },
// else: { let: "x", be: 13, then: { assert: true, then: "close" } },
// }
// }

// const root = createRoot(document.getElementById("app") as HTMLElement)

// root.render(<MarloweGraphView contract={contract} path={[]} />)
root.render(<MarloweGraphView contract={contract} path={[1, 0]} />)
// root.render(<MarloweGraphView contract={contract} path={[1, 0]} />)

// https://reactflow.dev/docs/concepts/terms-and-definitions
// https://reactflow.dev/docs/guides/custom-nodes
Expand Down

0 comments on commit 7f8f7ea

Please sign in to comment.