Skip to content

Commit

Permalink
Merge branch 'master' into blast_sepolia_testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashar2shahid committed Jan 18, 2024
2 parents e984b80 + 8afaf34 commit a6d1183
Show file tree
Hide file tree
Showing 173 changed files with 30,332 additions and 3,347 deletions.
6 changes: 6 additions & 0 deletions .changeset/breezy-timers-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@api3/airnode-node': minor
'@api3/airnode-protocol': minor
---

BREAKING CHANGE: Remove chainNames and networks from references.json and instead use api3/chains
5 changes: 0 additions & 5 deletions .changeset/curly-mails-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eighty-items-fail.md

This file was deleted.

File renamed without changes.
5 changes: 5 additions & 0 deletions .changeset/healthy-jeans-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-deployer': minor
---

Increase OEV gateway memory limit
File renamed without changes.
5 changes: 5 additions & 0 deletions .changeset/large-glasses-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-protocol': minor
---

deploy protocol contracts on lightlink-goerli-testnet
5 changes: 5 additions & 0 deletions .changeset/many-wombats-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-examples': patch
---

Use api3/chains instead of airnode-protocol for chain names
6 changes: 6 additions & 0 deletions .changeset/mighty-parents-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@api3/airnode-examples': minor
'@api3/airnode-node': minor
---

Support OIS processing v2
8 changes: 8 additions & 0 deletions .changeset/orange-dingos-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@api3/airnode-validator': minor
'@api3/airnode-protocol': minor
'@api3/airnode-adapter': minor
'@api3/airnode-node': minor
---

Bump axios and @api3 deps
7 changes: 0 additions & 7 deletions .changeset/serious-bobcats-begin.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/silver-cobras-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-protocol': minor
---

Remove boba-avalanche as it has been shut down
2 changes: 0 additions & 2 deletions .changeset/silver-horses-live.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/soft-sloths-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@api3/airnode-deployer': minor
'@api3/airnode-node': minor
---

BREAKING CHANGE: the OEV gateway interface has changed in the following ways: `api3ServerV1` has replaced `dapiServerAddress` and `templateId` has replaced `endpointId` and `encodedParameters`.
5 changes: 5 additions & 0 deletions .changeset/spotty-mice-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/airnode-node': patch
---

New Airnode version changeset initialization
5 changes: 1 addition & 4 deletions .github/workflows/protocol-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
paths:
- 'packages/airnode-protocol/**'
- '!packages/airnode-protocol/package.json'
types: [opened, synchronize, reopened]

env:
Expand All @@ -16,8 +17,6 @@ jobs:
pre-build:
name: Prepare build environment
runs-on: ubuntu-latest
# Don't run twice for a push within an internal PR
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone airnode
uses: actions/checkout@v3
Expand All @@ -39,8 +38,6 @@ jobs:
build:
name: Build Protocol
runs-on: ubuntu-latest
# Don't run twice for a push within an internal PR
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: pre-build
steps:
- uses: actions/cache@v3
Expand Down
4 changes: 3 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"func-visibility": ["warn", { "ignoreConstructors": true }],
"not-rely-on-time": "off",
"no-empty-blocks": "off",
"no-global-import": "off"
"no-global-import": "off",
"custom-errors": "off",
"immutable-vars-naming": "off"
}
}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV appDir="/app" \
CI="true"

RUN apk add --update --no-cache git rsync docker $([ $(arch) == "aarch64" ] && echo "python3 make g++") && \
yarn global add npm && \
yarn global add npm@^9.8.1 && \
# Download both solidity compilers as per: https://github.com/nomiclabs/hardhat/issues/1280#issuecomment-949822371
mkdir -p /root/.cache/hardhat-nodejs/compilers-v2/wasm && \
wget -O /root/.cache/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.9+commit.e5eed63a.js https://solc-bin.ethereum.org/wasm/soljson-v0.8.9+commit.e5eed63a.js && \
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { runCommand } from './utils';

const OWNER = 'api3dao';
const REPOSITORY = 'airnode';
const TEAM = 'airnode';
const TEAM = 'airnode-releasers';

const initializeOctokit = () => {
const githubToken = process.env.GITHUB_TOKEN;
Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"test:protocol:verify-local": "cd packages/airnode-protocol && yarn run test:verify-local",
"test:node": "(cd packages/airnode-node && yarn run test)",
"test:node:watch": "cd packages/airnode-node && yarn run test:watch",
"test:release": "ts-node scripts/test-release.ts",
"test:utilities": "(cd packages/airnode-utilities && yarn run test)",
"test:validator": "(cd packages/airnode-validator && yarn run test)",
"update-ois-version": "ts-node scripts/update-ois-version.ts"
Expand All @@ -107,28 +108,28 @@
"@api3/promise-utils": "^0.4.0",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@octokit/core": "^5.0.0",
"@types/libsodium-wrappers": "^0.7.10",
"@types/node": "^18.16.19",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@vercel/ncc": "^0.36.1",
"axios": "^1.4.0",
"@octokit/core": "^5.0.1",
"@types/libsodium-wrappers": "^0.7.12",
"@types/node": "^18.18.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vercel/ncc": "^0.38.1",
"axios": "^1.6.0",
"comment-json": "^4.2.3",
"eslint": "^8.44.0",
"eslint": "^8.52.0",
"eslint-plugin-functional": "^5.0.8",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"fast-glob": "^3.3.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
"fast-glob": "^3.3.1",
"husky": "^8.0.3",
"lerna": "^7.1.1",
"libsodium-wrappers": "^0.7.11",
"prettier": "^2.8.8",
"lerna": "^7.4.1",
"libsodium-wrappers": "^0.7.13",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"rimraf": "^5.0.1",
"solhint": "^3.4.1",
"rimraf": "^5.0.5",
"solhint": "^3.6.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"yargs": "^17.7.2"
}
}
2 changes: 2 additions & 0 deletions packages/airnode-abi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @api3/airnode-abi

## 0.13.0

## 0.12.0

## 0.11.0
Expand Down
10 changes: 5 additions & 5 deletions packages/airnode-abi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@api3/airnode-abi",
"license": "MIT",
"version": "0.12.0",
"version": "0.13.0",
"private": false,
"main": "dist/index",
"types": "dist/index",
Expand All @@ -21,9 +21,9 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@types/lodash": "^4.14.195",
"jest": "^29.6.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"@types/lodash": "^4.14.200",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
}
}
12 changes: 12 additions & 0 deletions packages/airnode-adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @api3/airnode-adapter

## 0.13.0

### Minor Changes

- [#1888](https://github.com/api3dao/airnode/pull/1888) [`1da62631`](https://github.com/api3dao/airnode/commit/1da62631905cf4b49266f248c8c385b5106d4c4d) Thanks [@dcroote](https://github.com/dcroote)! - Bump OIS to v2.2.0 and make operationParameter optional within endpoint parameters

### Patch Changes

- [#1893](https://github.com/api3dao/airnode/pull/1893) [`cefc5e4a`](https://github.com/api3dao/airnode/commit/cefc5e4abcc0f10a9b0b84b9bf55af2f34ffe1bd) Thanks [@dcroote](https://github.com/dcroote)! - Bump ois to v2.2.1

- [#1825](https://github.com/api3dao/airnode/pull/1825) [`b447fcc5`](https://github.com/api3dao/airnode/commit/b447fcc5d82f63c9393e2ef5651cedf66809a4a3) Thanks [@renovate](https://github.com/apps/renovate)! - Apply prettier v3 formatting

## 0.12.0

### Minor Changes
Expand Down
22 changes: 11 additions & 11 deletions packages/airnode-adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@api3/airnode-adapter",
"license": "MIT",
"version": "0.12.0",
"version": "0.13.0",
"private": false,
"main": "dist/index",
"types": "dist/index",
Expand All @@ -19,25 +19,25 @@
"test:watch": "yarn test:ts --watch"
},
"dependencies": {
"@api3/ois": "2.1.0",
"@api3/ois": "2.3.1",
"@api3/promise-utils": "^0.4.0",
"axios": "^1.4.0",
"bignumber.js": "^9.1.1",
"axios": "^1.6.2",
"bignumber.js": "^9.1.2",
"ethers": "^5.7.2",
"lodash": "^4.17.21"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"@types/chai": "^4.3.5",
"@types/lodash": "^4.14.195",
"@types/mocha": "^10.0.1",
"chai": "^4.3.7",
"@types/chai": "^4.3.9",
"@types/lodash": "^4.14.200",
"@types/mocha": "^10.0.3",
"chai": "^4.3.10",
"ethereum-waffle": "^4.0.10",
"hardhat": "^2.14.1",
"jest": "^29.6.0",
"rimraf": "^5.0.1",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
}
}
27 changes: 27 additions & 0 deletions packages/airnode-adapter/src/request-building/parameters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,33 @@ describe('fixed parameters', () => {
headers: {},
});
});

it('ignores parameters without operationParameter', () => {
const ois = fixtures.buildOIS();
ois.apiSpecifications.paths['/convert'].get!.parameters.push({ in: 'query', name: 'noOperationParameter' });
const options = fixtures.buildCacheRequestOptions({
ois,
parameters: { f: 'ETH', amount: '1', no_op: 'myValue' },
});
options.endpoint.parameters.push({
name: 'no_op',
// operationParameter is absent
});
options.operation.parameters.push({ name: 'noOperationParameter', in: 'query' });
const res = parameters.buildParameters(options);
expect(res).toEqual({
paths: {},
query: {
// Expectedly absent:
// noOperationParameter: 'myValue',
access_key: 'super-secret-key',
amount: '1',
from: 'ETH',
to: 'USD',
},
headers: {},
});
});
});

describe('user parameters', () => {
Expand Down
13 changes: 8 additions & 5 deletions packages/airnode-adapter/src/request-building/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as authentication from './authentication';
import * as cookies from './cookies';
import { BuilderParameters, CachedBuildRequestOptions, RequestParameters } from '../types';

function initalParameters(): BuilderParameters {
function initialParameters(): BuilderParameters {
return {
paths: {},
query: {},
Expand Down Expand Up @@ -49,7 +49,7 @@ function buildFixedParameters(options: CachedBuildRequestOptions): BuilderParame
}

return appendParameter(acc, target, name, parameter.value);
}, initalParameters());
}, initialParameters());
}

function buildUserParameters(options: CachedBuildRequestOptions): BuilderParameters {
Expand All @@ -66,16 +66,19 @@ function buildUserParameters(options: CachedBuildRequestOptions): BuilderParamet

// Double check that the parameter exists in the API specification
const apiParameter = operation.parameters.find(
(p) => p.name === parameter.operationParameter.name && p.in === parameter.operationParameter.in
(p) =>
parameter.operationParameter &&
p.name === parameter.operationParameter.name &&
p.in === parameter.operationParameter.in
);
if (!apiParameter) {
if (!apiParameter || !parameter.operationParameter) {
return acc;
}

const { name, in: target } = parameter.operationParameter;

return appendParameter(acc, target, name, parameters[key]);
}, initalParameters());
}, initialParameters());
}

export function buildParameters(options: CachedBuildRequestOptions): RequestParameters {
Expand Down
12 changes: 7 additions & 5 deletions packages/airnode-adapter/src/response-processing/extraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ export function splitReservedParameters(parameters: ResponseReservedParameters):
});

const reservedParameters: ResponseReservedParameters[] = range(typesLength).map((i) =>
splitParams.reduce((acc, param) => {
if (!param.splitResult) return acc;

return { ...acc, [param.name]: param.splitResult[i] };
}, {} as any as ResponseReservedParameters)
splitParams.reduce(
(acc, param) => {
if (!param.splitResult) return acc;
return { ...acc, [param.name]: param.splitResult[i] };
},
{} as any as ResponseReservedParameters
)
);

return reservedParameters;
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-adapter/test/fixtures/ois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OIS } from '@api3/ois';

export function buildOIS(overrides?: Partial<OIS>): OIS {
return {
oisFormat: '2.1.0',
oisFormat: '2.3.1',
version: '1.2.3',
title: 'Currency Converter API',
apiSpecifications: {
Expand Down
Loading

0 comments on commit a6d1183

Please sign in to comment.