Commit 99021e29 authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2316 from ethereum-optimism/sc/remove-dtl-client

maint(dtl): remove unused L1DataTransportClient
parents c4120a2f 075f4b66
---
'@eth-optimism/data-transport-layer': patch
---
Removes the unused L1DataTransportClient and its dependencies
...@@ -47,24 +47,20 @@ ...@@ -47,24 +47,20 @@
"axios": "^0.21.1", "axios": "^0.21.1",
"bcfg": "^0.1.6", "bcfg": "^0.1.6",
"bfj": "^7.0.2", "bfj": "^7.0.2",
"browser-or-node": "^1.3.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"ethers": "^5.5.4", "ethers": "^5.5.4",
"express": "^4.17.1", "express": "^4.17.1",
"express-prom-bundle": "^6.3.6", "express-prom-bundle": "^6.3.6",
"level": "^6.0.1", "level": "^6.0.1",
"levelup": "^4.4.0", "levelup": "^4.4.0"
"node-fetch": "^2.6.1"
}, },
"devDependencies": { "devDependencies": {
"@types/browser-or-node": "^1.3.0",
"@types/chai": "^4.2.18", "@types/chai": "^4.2.18",
"@types/chai-as-promised": "^7.1.4", "@types/chai-as-promised": "^7.1.4",
"@types/cors": "^2.8.9", "@types/cors": "^2.8.9",
"@types/levelup": "^4.3.0", "@types/levelup": "^4.3.0",
"@types/mocha": "^8.2.2", "@types/mocha": "^8.2.2",
"@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
......
// Only load if not in browser.
import { isNode } from 'browser-or-node'
// eslint-disable-next-line no-var
declare var window: any
const fetch = isNode ? require('node-fetch') : window.fetch
import {
EnqueueResponse,
StateRootBatchResponse,
StateRootResponse,
SyncingResponse,
TransactionBatchResponse,
TransactionResponse,
} from '../types'
export class L1DataTransportClient {
constructor(private url: string) {}
public async syncing(): Promise<SyncingResponse> {
return this._get(`/eth/syncing`)
}
public async getEnqueueByIndex(index: number): Promise<EnqueueResponse> {
return this._get(`/enqueue/index/${index}`)
}
public async getLatestEnqueue(): Promise<EnqueueResponse> {
return this._get(`/enqueue/latest`)
}
public async getTransactionByIndex(
index: number
): Promise<TransactionResponse> {
return this._get(`/transaction/index/${index}`)
}
public async getLatestTransacton(): Promise<TransactionResponse> {
return this._get(`/transaction/latest`)
}
public async getTransactionBatchByIndex(
index: number
): Promise<TransactionBatchResponse> {
return this._get(`/batch/transaction/index/${index}`)
}
public async getLatestTransactionBatch(): Promise<TransactionBatchResponse> {
return this._get(`/batch/transaction/latest`)
}
public async getStateRootByIndex(index: number): Promise<StateRootResponse> {
return this._get(`/stateroot/index/${index}`)
}
public async getLatestStateRoot(): Promise<StateRootResponse> {
return this._get(`/stateroot/latest`)
}
public async getStateRootBatchByIndex(
index: number
): Promise<StateRootBatchResponse> {
return this._get(`/batch/stateroot/index/${index}`)
}
public async getLatestStateRootBatch(): Promise<StateRootBatchResponse> {
return this._get(`/batch/stateroot/latest`)
}
private async _get<TResponse>(endpoint: string): Promise<TResponse> {
return (await fetch(`${this.url}${endpoint}`)).json()
}
}
export * from './client/client'
export * from './types' export * from './types'
...@@ -3035,11 +3035,6 @@ ...@@ -3035,11 +3035,6 @@
"@types/connect" "*" "@types/connect" "*"
"@types/node" "*" "@types/node" "*"
"@types/browser-or-node@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@types/browser-or-node/-/browser-or-node-1.3.0.tgz#896ec59bcb8109fc858d8e68d3c056c176a19622"
integrity sha512-MVetr65IR7RdJbUxVHsaPFaXAO8fi89zv1g8L/mHygh1Q7xnnK02XZLwfMh57FOpTO6gtnagoPMQ/UOFfctXRQ==
"@types/chai-as-promised@^7.1.4": "@types/chai-as-promised@^7.1.4":
version "7.1.4" version "7.1.4"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.4.tgz#caf64e76fb056b8c8ced4b761ed499272b737601" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.4.tgz#caf64e76fb056b8c8ced4b761ed499272b737601"
...@@ -3168,14 +3163,6 @@ ...@@ -3168,14 +3163,6 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323"
integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw== integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==
"@types/node-fetch@^2.5.10":
version "2.5.12"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66"
integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==
dependencies:
"@types/node" "*"
form-data "^3.0.0"
"@types/node-fetch@^2.5.5": "@types/node-fetch@^2.5.5":
version "2.5.10" version "2.5.10"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132"
...@@ -4825,11 +4812,6 @@ brorand@^1.0.1, brorand@^1.1.0: ...@@ -4825,11 +4812,6 @@ brorand@^1.0.1, brorand@^1.1.0:
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=
browser-or-node@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/browser-or-node/-/browser-or-node-1.3.0.tgz#f2a4e8568f60263050a6714b2cc236bb976647a7"
integrity sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==
browser-stdout@1.3.1: browser-stdout@1.3.1:
version "1.3.1" version "1.3.1"
resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment