Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xdc zero support #29

Merged
merged 28 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ PARENTCHAIN_URL=https://devnetstats.apothem.network/devnet

CHECKPOINT_CONTRACT=0x16da2C7caf46D0d7270d68e590A992A90DfcF7ee

SUBNET_ZERO_CONTRACT=0x0000000

PARENTNET_ZERO_CONTRACT=0x0000000

PARENTCHAIN_WALLET_PK=0x123

ZERO_WALLET_PK=0x123

SLACK_WEBHOOK=https://hooks.slack.com/services/blablabla
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dist/**/*
# Logging files
*.log
*.pyc

package-lock.json

18,162 changes: 0 additions & 18,162 deletions package-lock.json

This file was deleted.

145 changes: 74 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,77 @@
{
"name": "xdc-relayer",
"version": "1.8.0",
"main": "dist/server.js",
"scripts": {
"start:dev": "nodemon --ignore tests/ --watch src -e ts,tsx --exec ts-node src/server.ts",
"build-ts": "tsc",
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
"serve": "node dist/server.js",
"build": "npm run build-ts",
"start": "npm run serve",
"test": "jest",
"test:coverage": "jest --collect-coverage",
"test:watch": "jest --watch",
"postinstall": "patch-package"
},
"engines": {
"node": "18.x.x",
"npm": "8.x.x"
},
"author": "Hashlabs",
"license": "GNU",
"homepage": "https://github.com/XinFinOrg/XDC-Relayer#readme",
"repository": "https://github.com/XinFinOrg/XDC-Relayer",
"devDependencies": {
"@types/bunyan": "^1.8.8",
"@types/cron": "^1.7.2",
"@types/jest": "^29.4.0",
"@types/koa": "2.13.1",
"@types/koa__cors": "^3.0.2",
"@types/koa__router": "^8.0.4",
"@types/koa-bodyparser": "^4.3.0",
"@types/koa-helmet": "^6.0.2",
"@types/node": "^18.14.1",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"eslint": "^7.23.0",
"jest": "^29.4.3",
"nodemon": "^2.0.20",
"prompt": "^1.3.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"dependencies": {
"@ethereumjs/block": "^4.1.0",
"@ethereumjs/rlp": "^4.0.0",
"@koa/cors": "^3.1.0",
"@koa/router": "^10.0.0",
"agentkeepalive": "^4.3.0",
"axios": "^1.3.4",
"bunyan": "^1.8.15",
"cron": "^1.8.2",
"dotenv": "^8.2.0",
"koa": "^2.13.1",
"koa-bodyparser": "^4.3.0",
"koa-helmet": "^6.1.0",
"node-cache": "^5.1.2",
"patch-package": "^6.5.1",
"pg": "^8.5.1",
"web3": "^1.8.2"
},
"jest": {
"roots": [
"<rootDir>"
],
"testMatch": [
"**/tests/**/*.+(ts|tsx|js)"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
}
"name": "xdc-relayer",
"version": "1.8.0",
"main": "dist/server.js",
"scripts": {
"start:dev": "nodemon --ignore tests/ --watch src -e ts,tsx --exec ts-node src/server.ts",
"build-ts": "tsc",
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
"serve": "node dist/server.js",
"build": "npm run build-ts",
"start": "npm run serve",
"test": "jest",
"test:coverage": "jest --collect-coverage",
"test:watch": "jest --watch",
"postinstall": "patch-package"
},
"engines": {
"node": "20.x.x",
"npm": "9.x.x"
},
"author": "Hashlabs",
"license": "GNU",
"homepage": "https://github.com/XinFinOrg/XDC-Relayer#readme",
"repository": "https://github.com/XinFinOrg/XDC-Relayer",
"devDependencies": {
"@types/bunyan": "^1.8.8",
"@types/cron": "^1.7.2",
"@types/jest": "^29.4.0",
"@types/koa": "2.13.1",
"@types/koa__cors": "^3.0.2",
"@types/koa__router": "^8.0.4",
"@types/koa-bodyparser": "^4.3.0",
"@types/koa-helmet": "^6.0.2",
"@types/node": "^18.14.1",
"@types/node-fetch": "^2.6.9",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"eslint": "^7.23.0",
"jest": "^29.4.3",
"nodemon": "^3.0.1",
"prompt": "^1.3.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"dependencies": {
"@ethereumjs/block": "^4.1.0",
"@ethereumjs/rlp": "^4.0.0",
"@koa/cors": "^3.1.0",
"@koa/router": "^10.0.0",
"agentkeepalive": "^4.3.0",
"axios": "^1.3.4",
"bunyan": "^1.8.15",
"cron": "^1.8.2",
"dotenv": "^8.2.0",
"koa": "^2.13.1",
"koa-bodyparser": "^4.3.0",
"koa-helmet": "^6.1.0",
"node-cache": "^5.1.2",
"node-fetch": "2",
"patch-package": "^6.5.1",
"pg": "^8.5.1",
"viem": "^1.18.9",
"web3": "^1.8.2"
},
"jest": {
"roots": [
"<rootDir>"
],
"testMatch": [
"**/tests/**/*.+(ts|tsx|js)"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
}
}
}
20 changes: 10 additions & 10 deletions patches/web3-utils+1.8.2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ index f33a432..2f1f190 100644
*/
-var _flattenTypes = function (includeTuple, puts) {
+var _flattenTypes = function(includeTuple, puts) {
// console.log("entered _flattenTypes. inputs/outputs: " + puts)
// console.info("entered _flattenTypes. inputs/outputs: " + puts)
var types = [];
- puts.forEach(function (param) {
+ puts.forEach(function(param) {
Expand All @@ -55,23 +55,23 @@ index f33a432..2f1f190 100644
throw new Error('components found but type is not tuple; report on GitHub');
@@ -112,17 +112,14 @@ var _flattenTypes = function (includeTuple, puts) {
if (Array.isArray(result) && includeTuple) {
// console.log("include tuple word, and its an array. joining...: " + result.types)
// console.info("include tuple word, and its an array. joining...: " + result.types)
types.push('tuple(' + result.join(',') + ')' + suffix);
- }
- else if (!includeTuple) {
+ } else if (!includeTuple) {
// console.log("don't include tuple, but its an array. joining...: " + result)
// console.info("don't include tuple, but its an array. joining...: " + result)
types.push('(' + result.join(',') + ')' + suffix);
- }
- else {
+ } else {
// console.log("its a single type within a tuple: " + result.types)
// console.info("its a single type within a tuple: " + result.types)
types.push('(' + result + ')');
}
- }
- else {
+ } else {
// console.log("its a type and not directly in a tuple: " + param.type)
// console.info("its a type and not directly in a tuple: " + param.type)
types.push(param.type);
}
@@ -135,7 +132,7 @@ var _flattenTypes = function (includeTuple, puts) {
Expand Down Expand Up @@ -315,26 +315,26 @@ index c3b2ded..93a5857 100644
-var _flattenTypes = function(includeTuple, puts)
-{
+var _flattenTypes = function(includeTuple, puts) {
// console.log("entered _flattenTypes. inputs/outputs: " + puts)
// console.info("entered _flattenTypes. inputs/outputs: " + puts)
var types = [];

@@ -124,15 +123,13 @@ var _flattenTypes = function(includeTuple, puts)
if (arrayBracket >= 0) { suffix = param.type.substring(arrayBracket); }
var result = _flattenTypes(includeTuple, param.components);
// console.log("result should have things: " + result)
// console.info("result should have things: " + result)
- if(Array.isArray(result) && includeTuple) {
+ if (Array.isArray(result) && includeTuple) {
// console.log("include tuple word, and its an array. joining...: " + result.types)
// console.info("include tuple word, and its an array. joining...: " + result.types)
types.push('tuple(' + result.join(',') + ')' + suffix);
- }
- else if(!includeTuple) {
+ } else if (!includeTuple) {
// console.log("don't include tuple, but its an array. joining...: " + result)
// console.info("don't include tuple, but its an array. joining...: " + result)
types.push('(' + result.join(',') + ')' + suffix);
- }
- else {
+ } else {
// console.log("its a single type within a tuple: " + result.types)
// console.info("its a single type within a tuple: " + result.types)
types.push('(' + result + ')');
}
@@ -143,8 +140,7 @@ var _flattenTypes = function(includeTuple, puts)
Expand Down
Loading
Loading