fla-fees-subgraph/tests/fla-utils.ts

52 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2022-10-27 07:14:21 +00:00
import { newMockEvent } from "matchstick-as"
import { ethereum, Address } from "@graphprotocol/graph-ts"
import { AdminChanged, BeaconUpgraded, Upgraded } from "../generated/FLA/FLA"
export function createAdminChangedEvent(
previousAdmin: Address,
newAdmin: Address
): AdminChanged {
let adminChangedEvent = changetype<AdminChanged>(newMockEvent())
adminChangedEvent.parameters = new Array()
adminChangedEvent.parameters.push(
new ethereum.EventParam(
"previousAdmin",
ethereum.Value.fromAddress(previousAdmin)
)
)
adminChangedEvent.parameters.push(
new ethereum.EventParam("newAdmin", ethereum.Value.fromAddress(newAdmin))
)
return adminChangedEvent
}
export function createBeaconUpgradedEvent(beacon: Address): BeaconUpgraded {
let beaconUpgradedEvent = changetype<BeaconUpgraded>(newMockEvent())
beaconUpgradedEvent.parameters = new Array()
beaconUpgradedEvent.parameters.push(
new ethereum.EventParam("beacon", ethereum.Value.fromAddress(beacon))
)
return beaconUpgradedEvent
}
export function createUpgradedEvent(implementation: Address): Upgraded {
let upgradedEvent = changetype<Upgraded>(newMockEvent())
upgradedEvent.parameters = new Array()
upgradedEvent.parameters.push(
new ethereum.EventParam(
"implementation",
ethereum.Value.fromAddress(implementation)
)
)
return upgradedEvent
}