-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix link deletion logic in delete_thing, fix thing_to_record logic an…
…d get_latest_thing logic, add tests
- Loading branch information
Showing
8 changed files
with
443 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,6 @@ | ||
import { | ||
ActionHash, | ||
AppBundleSource, | ||
fakeActionHash, | ||
fakeAgentPubKey, | ||
fakeDnaHash, | ||
fakeEntryHash, | ||
hashFrom32AndType, | ||
NewEntryAction, | ||
Record, | ||
} from "@holochain/client"; | ||
import { CallableCell } from "@holochain/tryorama"; | ||
import { CallableCell, Player } from "@holochain/tryorama"; | ||
|
||
export async function sampleThing(cell: CallableCell, partialThing = {}) { | ||
return { | ||
...{ | ||
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | ||
}, | ||
...partialThing, | ||
}; | ||
} | ||
|
||
export async function createThing(cell: CallableCell, thing = undefined): Promise<Record> { | ||
return cell.callZome({ | ||
zome_name: "generic_zome", | ||
fn_name: "create_thing", | ||
payload: thing || await sampleThing(cell), | ||
}); | ||
export function getCellByRoleName(player: Player, roleName: string): CallableCell { | ||
const cells = player.cells; | ||
return cells.find((cell) => cell.name === roleName); | ||
} |
Oops, something went wrong.