|
1 | | -import { arweave, box, json, Bytes, JSONValue, TypedMap } from "@graphprotocol/graph-ts"; |
| 1 | +import { |
| 2 | + arweave, |
| 3 | + box, |
| 4 | + json, |
| 5 | + Bytes, |
| 6 | + JSONValue, |
| 7 | + TypedMap, |
| 8 | +} from "@graphprotocol/graph-ts"; |
2 | 9 | import { Trigger } from "../generated/Contract/Contract"; |
3 | 10 |
|
4 | 11 | export function handleTrigger(event: Trigger): void { |
5 | | - let data = json.fromBytes(arweave.transactionData("W2czhcswOAe4TgL4Q8kHHqoZ1jbFBntUCrtamYX_rOU") as Bytes) |
6 | | - assert(data.toArray()[0].toString() == "Weather data for Dallas") |
| 12 | + let data = json.fromBytes( |
| 13 | + arweave.transactionData( |
| 14 | + "W2czhcswOAe4TgL4Q8kHHqoZ1jbFBntUCrtamYX_rOU" |
| 15 | + ) as Bytes |
| 16 | + ); |
| 17 | + assert(data.toArray()[0].toString() == "Weather data for Dallas"); |
7 | 18 |
|
8 | | - let no_data = arweave.transactionData("W2czhcswOAe4TgL4Q8kHHqoZ1jbFBntUCrtamYX_ZZZ") |
9 | | - assert(no_data === null) |
| 19 | + let no_data = arweave.transactionData( |
| 20 | + "W2czhcswOAe4TgL4Q8kHHqoZ1jbFBntUCrtamYX_ZZZ" |
| 21 | + ); |
| 22 | + assert(no_data === null); |
10 | 23 |
|
11 | | - let moo_master = box.getProfile("0xc8d807011058fcc0FB717dcd549b9ced09b53404") as TypedMap<string, JSONValue> |
12 | | - assert(moo_master.get("name").toString() == "Moo Master") |
| 24 | + let moo_master = box.profile( |
| 25 | + "0xc8d807011058fcc0FB717dcd549b9ced09b53404" |
| 26 | + ) as TypedMap<string, JSONValue>; |
| 27 | + assert(moo_master.get("name").toString() == "Moo Master"); |
13 | 28 |
|
14 | | - let monkey_spirit = box.getProfile("did:3:bafyreia7db37k7epoc4qaifound6hk7swpwfkhudvdug4bgccjw6dh77ue") as TypedMap<string, JSONValue> |
15 | | - assert(monkey_spirit.get("emoji").toString() == "🐵") |
| 29 | + let monkey_spirit = box.profile( |
| 30 | + "did:3:bafyreia7db37k7epoc4qaifound6hk7swpwfkhudvdug4bgccjw6dh77ue" |
| 31 | + ) as TypedMap<string, JSONValue>; |
| 32 | + assert(monkey_spirit.get("emoji").toString() == "🐵"); |
16 | 33 |
|
17 | | - let nothing = box.getProfile("0xc33307011058fcc0FB717dcd549b9ced09b53333") |
18 | | - assert(nothing === null) |
| 34 | + let nothing = box.profile("0xc33307011058fcc0FB717dcd549b9ced09b53333"); |
| 35 | + assert(nothing === null); |
19 | 36 | } |
0 commit comments