Skip to content

Instantly share code, notes, and snippets.

@axiomatic-aardvark
Last active August 20, 2021 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axiomatic-aardvark/43232e718579d526a39caa418b87485d to your computer and use it in GitHub Desktop.
Save axiomatic-aardvark/43232e718579d526a39caa418b87485d to your computer and use it in GitHub Desktop.
import { newMockEvent } from "matchstick-as/assembly/index";
import { ethereum, Address } from "@graphprotocol/graph-ts";
import { NewCustomEntity } from "../generated/MyDataSource/Example";
let newEntityEvent = newMockEvent(new NewCustomEntity()) as NewCustomEntity;
// Read
let logType = newEntityEvent.logType;
// Write
let UPDATED_ADDRESS = "0xB16081F360e3847006dB660bae1c6d1b2e17eC2A";
newEntityEvent.address = Address.fromString(UPDATED_ADDRESS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment