-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into i-843/fix/get-latest-submitted-value-for-a…
…ggregator
- Loading branch information
Showing
167 changed files
with
27,302 additions
and
366 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: "vrf contracts: test" | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "master" | ||
paths: | ||
- "contracts/**/VRFCoordinator.sol" | ||
- "contracts/**/VRFConsumerBase.sol" | ||
- "contracts/**/vrf/**" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.12" | ||
registry-url: "https://registry.npmjs.org" | ||
scope: "@bisonai" | ||
always-auth: true | ||
- run: yarn | ||
working-directory: ./contracts | ||
- run: yarn prettier-solidity-check | ||
working-directory: ./contracts | ||
- run: yarn solhint | ||
working-directory: ./contracts | ||
- run: yarn eslint | ||
working-directory: ./contracts | ||
- run: npx hardhat test test/v0.1/vrf/*.cjs | ||
working-directory: ./contracts | ||
- run: yarn compile | ||
working-directory: ./contracts | ||
- run: yarn build | ||
working-directory: ./contracts |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DATABASE_URL=postgresql://${USER}@localhost:5432/orakl?schema=public | ||
APP_PORT=3000 | ||
ENCRYPT_PASSWORD=anything |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Controller, Get, HttpException, HttpStatus, Param } from '@nestjs/common' | ||
import { L2aggregatorService } from './L2aggregator.service' | ||
import { ChainService } from '../chain/chain.service' | ||
|
||
@Controller({ | ||
path: 'l2aggregator', | ||
version: '1' | ||
}) | ||
export class L2aggregatorController { | ||
constructor( | ||
private readonly l2AggregatorService: L2aggregatorService, | ||
private readonly chainService: ChainService | ||
) {} | ||
@Get(':chain/:l1Address') | ||
async getL2Address(@Param('chain') chain: string, @Param('l1Address') l1Address: string) { | ||
// chain | ||
const chainRecord = await this.chainService.findOne({ name: chain }) | ||
if (chainRecord == null) { | ||
const msg = `Chain [${chain}] not found` | ||
throw new HttpException(msg, HttpStatus.NOT_FOUND) | ||
} | ||
return await this.l2AggregatorService.l2Address(l1Address, chainRecord.id) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Module } from '@nestjs/common' | ||
import { L2aggregatorController } from './L2aggregator.controller' | ||
import { L2aggregatorService } from './L2aggregator.service' | ||
import { ChainService } from '../chain/chain.service' | ||
import { PrismaService } from '../prisma.service' | ||
|
||
@Module({ | ||
controllers: [L2aggregatorController], | ||
providers: [L2aggregatorService, ChainService, PrismaService] | ||
}) | ||
export class L2aggregatorModule {} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Test, TestingModule } from '@nestjs/testing' | ||
import { L2aggregatorService } from './L2aggregator.service' | ||
import { PrismaService } from '../prisma.service' | ||
|
||
describe('L2aggregatorService', () => { | ||
let service: L2aggregatorService | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [L2aggregatorService, PrismaService] | ||
}).compile() | ||
|
||
service = module.get<L2aggregatorService>(L2aggregatorService) | ||
}) | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined() | ||
}) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Injectable } from '@nestjs/common' | ||
import { PrismaService } from '../prisma.service' | ||
|
||
@Injectable() | ||
export class L2aggregatorService { | ||
constructor(private readonly prismaService: PrismaService) {} | ||
async l2Address(l1Address: string, chainId: bigint) { | ||
return await this.prismaService.l2AggregatorPair.findFirst({ | ||
where: { l1AggregatorAddress: l1Address, chainId } | ||
}) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ORAKL_NETWORK_API_URL=http://127.0.0.1:3000/api/v1 | ||
ORAKL_NETWORK_DELEGATOR_URL= | ||
LISTENER_SERVICE_HOST=http://127.0.0.1 | ||
LISTENER_SERVICE_PORT=4000 | ||
WORKER_SERVICE_HOST=http://127.0.0.1 | ||
WORKER_SERVICE_PORT=5001 | ||
REPORTER_SERVICE_HOST=http://127.0.0.1 | ||
REPORTER_SERVICE_PORT=6000 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const path = require('node:path') | ||
const { loadJson, loadMigration, updateMigration } = require('../../scripts/v0.1/utils.cjs') | ||
|
||
const func = async function (hre) { | ||
const { deployments, getNamedAccounts, network } = hre | ||
const { deploy } = deployments | ||
const { deployer } = await getNamedAccounts() | ||
const migrationDirPath = `./migration/${network.name}/L2Endpoint` | ||
const migrationFilesNames = await loadMigration(migrationDirPath) | ||
for (const migration of migrationFilesNames) { | ||
const config = await loadJson(path.join(migrationDirPath, migration)) | ||
// Deploy L2Endpoint //////////////////////////////////////////////////////// | ||
if (config.deploy) { | ||
console.log('deploy') | ||
const l2EndpointDeployment = await deploy('L2Endpoint', { | ||
args: [], | ||
from: deployer, | ||
log: true | ||
}) | ||
|
||
console.log('l2EndpointDeployment:', l2EndpointDeployment) | ||
} | ||
|
||
await updateMigration(migrationDirPath, migration) | ||
} | ||
} | ||
|
||
func.id = 'deploy-l2Endpoint' | ||
func.tags = ['l2Endpoint'] | ||
|
||
module.exports = func |
Oops, something went wrong.