This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [dotenv@17.2.0] injecting env (7) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com) | |
| // Sources flattened with hardhat v2.25.0 https://hardhat.org | |
| // SPDX-License-Identifier: MIT | |
| // File @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol@v5.3.0 | |
| // Original license: SPDX_License_Identifier: MIT | |
| // OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Subgraph Size Checker - Final Version | |
| # | |
| # Finds size of a Graph Protocol subgraph by QM hash | |
| # | |
| # Usage: | |
| # ./graph-size.sh QmQcQdQZxbvSR1KpMcJQfppSuEXzh1MzsSad3Gyyc4M5Jo | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use rand::Rng; | |
| use rand::seq::SliceRandom; | |
| use std::collections::{HashSet, BTreeSet}; | |
| use std::time::Instant; | |
| use rand::distributions::{Distribution, Uniform}; | |
| /// optimized for different scenarios including huge (GB) data ranges | |
| fn generate_unique_random_numbers(begin: i64, end: i64, count: usize) -> Vec<i64> { | |
| let range_size = (end - begin + 1) as usize; | |
| if count > range_size { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { test } from "matchstick-as/assembly/index"; | |
| import { log } from "matchstick-as/assembly/log"; | |
| export function runTests(): void { | |
| test("Success", () => { | |
| log.success("Success!"); | |
| }); | |
| test("Error", () => { | |
| log.error("Error :( "); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { assert } from "matchstick-as/assembly/index"; | |
| import { ethereum } from "@graphprotocol/graph-ts"; | |
| assert.equals(ethereum.Value.fromString("hello"), ethereum.Value.fromString("hello")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { addMetadata } from "matchstick-as/assembly/index"; | |
| import { ethereum } from "@graphprotocol/graph-ts"; | |
| import { NewCustomEntity } from "../generated/MyDataSource/Example"; | |
| let base: ethereum.Event = new NewCustomEntity(); | |
| let newEntityEvent: NewCustomEntity = addMetadata(base); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { assert, createMockedFunction } from "matchstick-as/assembly/index"; | |
| import { Contract } from "../../generated/MyDataSource/Example"; | |
| import { Address, ethereum } from "@graphprotocol/graph-ts"; | |
| let contractAddress = Address.fromString("0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7"); | |
| let arg = ethereum.Value.fromString("example string arg"); | |
| createMockedFunction(contractAddress, "functionName", "functionName(string):(string)") | |
| .withArgs([arg]) | |
| .reverts(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { assert, createMockedFunction } from "matchstick-as/assembly/index"; | |
| import { Contract } from "../../generated/MyDataSource/Example"; | |
| import { Address, ethereum } from "@graphprotocol/graph-ts"; | |
| let contractAddress = Address.fromString("0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7"); | |
| let arg = ethereum.Value.fromString("example string arg"); | |
| createMockedFunction(contractAddress, "functionName", "functionName(string):(string)") | |
| .withArgs([arg]) | |
| .returns([ethereum.Value.fromString("result")]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { test, assert } from "matchstick-as/assembly/index"; | |
| import { CustomEntity } from '../../generated/schema'; | |
| import { Value } from "@graphprotocol/graph-ts"; | |
| export function runTests(): void { | |
| test("Next test", () => { | |
| let customEntity = new CustomEntity("434"); | |
| customEntity.set("name", Value.fromString("Frederick")); | |
| customEntity.save(); |
NewerOlder