import { newMockEvent } from "matchstick-as" import { ethereum, Address, BigInt } from "@graphprotocol/graph-ts" import { Approval, OwnershipTransferred, PlayerRegistered, RaidPerformed, Transfer, UnitAdded } from "../generated/RaidGeld/RaidGeld" export function createApprovalEvent( owner: Address, spender: Address, value: BigInt ): Approval { let approvalEvent = changetype(newMockEvent()) approvalEvent.parameters = new Array() approvalEvent.parameters.push( new ethereum.EventParam("owner", ethereum.Value.fromAddress(owner)) ) approvalEvent.parameters.push( new ethereum.EventParam("spender", ethereum.Value.fromAddress(spender)) ) approvalEvent.parameters.push( new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)) ) return approvalEvent } export function createOwnershipTransferredEvent( previousOwner: Address, newOwner: Address ): OwnershipTransferred { let ownershipTransferredEvent = changetype( newMockEvent() ) ownershipTransferredEvent.parameters = new Array() ownershipTransferredEvent.parameters.push( new ethereum.EventParam( "previousOwner", ethereum.Value.fromAddress(previousOwner) ) ) ownershipTransferredEvent.parameters.push( new ethereum.EventParam("newOwner", ethereum.Value.fromAddress(newOwner)) ) return ownershipTransferredEvent } export function createPlayerRegisteredEvent( player: Address, initialGeld: BigInt ): PlayerRegistered { let playerRegisteredEvent = changetype(newMockEvent()) playerRegisteredEvent.parameters = new Array() playerRegisteredEvent.parameters.push( new ethereum.EventParam("player", ethereum.Value.fromAddress(player)) ) playerRegisteredEvent.parameters.push( new ethereum.EventParam( "initialGeld", ethereum.Value.fromUnsignedBigInt(initialGeld) ) ) return playerRegisteredEvent } export function createRaidPerformedEvent( player: Address, totalMinted: BigInt, geldBalance: BigInt ): RaidPerformed { let raidPerformedEvent = changetype(newMockEvent()) raidPerformedEvent.parameters = new Array() raidPerformedEvent.parameters.push( new ethereum.EventParam("player", ethereum.Value.fromAddress(player)) ) raidPerformedEvent.parameters.push( new ethereum.EventParam( "totalMinted", ethereum.Value.fromUnsignedBigInt(totalMinted) ) ) raidPerformedEvent.parameters.push( new ethereum.EventParam( "geldBalance", ethereum.Value.fromUnsignedBigInt(geldBalance) ) ) return raidPerformedEvent } export function createTransferEvent( from: Address, to: Address, value: BigInt ): Transfer { let transferEvent = changetype(newMockEvent()) transferEvent.parameters = new Array() transferEvent.parameters.push( new ethereum.EventParam("from", ethereum.Value.fromAddress(from)) ) transferEvent.parameters.push( new ethereum.EventParam("to", ethereum.Value.fromAddress(to)) ) transferEvent.parameters.push( new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)) ) return transferEvent } export function createUnitAddedEvent( player: Address, unitType: i32, nUnits: i32, cost: BigInt, geldBalance: BigInt, molochDenierLevel: i32, apprenticeLevel: i32, anointedLevel: i32, championLevel: i32 ): UnitAdded { let unitAddedEvent = changetype(newMockEvent()) unitAddedEvent.parameters = new Array() unitAddedEvent.parameters.push( new ethereum.EventParam("player", ethereum.Value.fromAddress(player)) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "unitType", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(unitType)) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "nUnits", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(nUnits)) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam("cost", ethereum.Value.fromUnsignedBigInt(cost)) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "geldBalance", ethereum.Value.fromUnsignedBigInt(geldBalance) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "molochDenierLevel", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(molochDenierLevel)) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "apprenticeLevel", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(apprenticeLevel)) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "anointedLevel", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(anointedLevel)) ) ) unitAddedEvent.parameters.push( new ethereum.EventParam( "championLevel", ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(championLevel)) ) ) return unitAddedEvent }