Skip to content

Commit

Permalink
Remove contract suffix from templates
Browse files Browse the repository at this point in the history
  • Loading branch information
JonoPrest committed Jun 13, 2024
1 parent 7752a7c commit c5466fb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { ERC20Contract } = require("generated");
const { ERC20 } = require("generated");

ERC20Contract.Approval.handler(async ({ event, context }) => {
ERC20.Approval.handler(async ({ event, context }) => {
// getting the owner Account entity
const ownerAccount = await context.Account.get(event.params.owner);

Expand Down Expand Up @@ -28,7 +28,7 @@ ERC20Contract.Approval.handler(async ({ event, context }) => {
context.Approval.set(approvalObject);
});

ERC20Contract.Transfer.handler(async ({ event, context }) => {
ERC20.Transfer.handler(async ({ event, context }) => {
const senderAccount = await context.Account.get(event.params.from);

if (senderAccount === undefined) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open Types

Handlers.ERC20Contract.Approval.handler(async ({event, context}) => {
Handlers.ERC20.Approval.handler(async ({event, context}) => {
let ownerAccount = await context.account.get(event.params.owner->Ethers.ethAddressToString)

if(ownerAccount->Belt.Option.isNone)
Expand Down Expand Up @@ -30,7 +30,7 @@ Handlers.ERC20Contract.Approval.handler(async ({event, context}) => {

})

Handlers.ERC20Contract.Transfer.handler(async ({event, context}) => {
Handlers.ERC20.Transfer.handler(async ({event, context}) => {
let senderAccount = await context.account.get(event.params.from->Ethers.ethAddressToString)

switch senderAccount {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ERC20Contract, AccountEntity, ApprovalEntity } from "generated";
import { ERC20, AccountEntity, ApprovalEntity } from "generated";

ERC20Contract.Approval.handler(async ({ event, context }) => {
ERC20.Approval.handler(async ({ event, context }) => {
// getting the owner Account entity
let ownerAccount = await context.Account.get(event.params.owner.toString());

Expand Down Expand Up @@ -29,7 +29,7 @@ ERC20Contract.Approval.handler(async ({ event, context }) => {
context.Approval.set(approvalObject);
});

ERC20Contract.Transfer.handler(async ({ event, context }) => {
ERC20.Transfer.handler(async ({ event, context }) => {
let senderAccount = await context.Account.get(event.params.from.toString());

if (senderAccount === undefined) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { GreeterContract } = require("generated");
const { Greeter } = require("generated");

/**
Registers a handler that handles any values from the
NewGreeting event on the Greeter contract and index these values into
the DB.
*/
GreeterContract.NewGreeting.handler(async ({ event, context }) => {
Greeter.NewGreeting.handler(async ({ event, context }) => {
//The id for the User entity
const userId = event.params.user;
//The greeting string that was added.
Expand Down Expand Up @@ -45,7 +45,7 @@ Registers a handler that handles any values from the
ClearGreeting event on the Greeter contract and index these values into
the DB.
*/
GreeterContract.ClearGreeting.handler(async ({ event, context }) => {
Greeter.ClearGreeting.handler(async ({ event, context }) => {
//The id for the "User" entity derived from params of the ClearGreeting event
const userId = event.params.user;
//The optional user entity that may exist already at "userId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Registers a handler that handles any values from the
NewGreeting event on the Greeter contract and index these values into
the DB.
*/
Handlers.GreeterContract.NewGreeting.handler(async ({event, context}) => {
Handlers.Greeter.NewGreeting.handler(async ({event, context}) => {
//The id for the "User" entity
let userId = event.params.user->Ethers.ethAddressToString
//The greeting string that was added.
Expand Down Expand Up @@ -47,7 +47,7 @@ Registers a handler that handles any values from the
ClearGreeting event on the Greeter contract and index these values into
the DB.
*/
Handlers.GreeterContract.ClearGreeting.handler(async ({event, context}) => {
Handlers.Greeter.ClearGreeting.handler(async ({event, context}) => {
//The id for the "User" entity
let userId = event.params.user->Ethers.ethAddressToString
//The optional User entity that may exist already at "userId"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { GreeterContract, UserEntity } from "generated";
import { Greeter, UserEntity } from "generated";

/**
Registers a handler that handles any values from the
NewGreeting event on the Greeter contract and index these values into
the DB.
*/
GreeterContract.NewGreeting.handler(async ({ event, context }) => {
Greeter.NewGreeting.handler(async ({ event, context }) => {
//The id for the "User" entity
const userId = event.params.user;
//The greeting string that was added.
Expand Down Expand Up @@ -45,7 +45,7 @@ Registers a handler that handles any values from the
ClearGreeting event on the Greeter contract and index these values into
the DB.
*/
GreeterContract.ClearGreeting.handler(async ({ event, context }) => {
Greeter.ClearGreeting.handler(async ({ event, context }) => {
//The id for the "User" entity derived from params of the ClearGreeting event
const userId = event.params.user;
//The optional User entity that may exist already at "userId"
Expand Down

0 comments on commit c5466fb

Please sign in to comment.