Skip to content

Commit

Permalink
chore(types): cleanup unused types and classes
Browse files Browse the repository at this point in the history
The SDK abstracts warp completely, so we can remove all types/references/deps that are now unused.
  • Loading branch information
dtfiedler committed May 31, 2024
1 parent 0227f39 commit 9b6257c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 266 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"prom-client": "^14.0.1",
"swagger-ui-express": "^5.0.0",
"wait": "^0.4.2",
"warp-contracts": "1.4.33",
"warp-contracts-lmdb": "^1.1.10",
"winston": "^3.7.2",
"yaml": "^2.3.1",
"yargs": "^17.7.2"
Expand Down
55 changes: 0 additions & 55 deletions src/observers/contract-observers-source.ts

This file was deleted.

28 changes: 5 additions & 23 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@ import {
TurboFactory,
defaultTurboConfiguration,
} from '@ardrive/turbo-sdk/node';
import { ArweaveSigner } from 'arbundles/node';
import { ArweaveSigner, JWKInterface } from 'arbundles/node';
import Arweave from 'arweave';
import { default as NodeCache } from 'node-cache';
import * as fs from 'node:fs';
import { LmdbCache } from 'warp-contracts-lmdb';
import {
JWKInterface,
LogLevel,
LoggerFactory,
WarpFactory,
defaultCacheOptions,
} from 'warp-contracts/mjs';

import { ChainSource, MAX_FORK_DEPTH } from './arweave.js';
import * as config from './config.js';
Expand Down Expand Up @@ -252,17 +244,7 @@ if (turboReportSink !== undefined) {
});
}

// Set our warp log level
LoggerFactory.INST.logLevel(config.WARP_LOG_LEVEL as LogLevel);
export const warp = WarpFactory.forMainnet(
{
...defaultCacheOptions,
},
true,
arweave,
).useStateCache(new LmdbCache(defaultCacheOptions));

export const warpReportSink =
export const contractReportSink =
networkContract !== undefined && networkContract instanceof ArIOWritable
? new ContractReportSink({
log,
Expand All @@ -275,12 +257,12 @@ if (!config.SUBMIT_CONTRACT_INTERACTIONS) {
log.info(
'SUBMIT_CONTRACT_INTERACTIONS is false - contract interactions will not be saved',
);
} else if (warpReportSink === undefined) {
} else if (contractReportSink === undefined) {
log.info('Wallet not configured - contract interactions will not be saved');
} else {
stores.push({
name: 'WarpReportSink',
sink: warpReportSink,
name: 'ContractReportSink',
sink: contractReportSink,
});
}

Expand Down
35 changes: 0 additions & 35 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {
InteractionResult,
WriteInteractionOptions,
WriteInteractionResponse,
} from 'warp-contracts/mjs';

//
// Arweave
Expand Down Expand Up @@ -73,14 +68,6 @@ export interface GatewayHostsSource {
getHosts(): Promise<GatewayHost[]>;
}

//
// Observers
//

export interface ObserversSource {
getObservers(opts?: { [key: string]: any }): Promise<string[]>;
}

//
// Observer report
//
Expand Down Expand Up @@ -159,25 +146,3 @@ export interface ReportStore {
getReport(epochStartHeight: number): Promise<ObserverReport | null>;
latestReport(): Promise<ObserverReport | null>;
}

//
// Contract
//

export interface ObservationInteraction {
function: string;
observerReportTxId: string;
failedGateways: string[];
}

export interface ObserverContract {
readInteraction(
functionName: string,
input?: object,
): Promise<InteractionResult<unknown, unknown>>;

writeInteraction(
interaction: ObservationInteraction,
options?: WriteInteractionOptions,
): Promise<WriteInteractionResponse>;
}
151 changes: 0 additions & 151 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -723,66 +723,6 @@
resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796"
integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==

"@lmdb/lmdb-darwin-arm64@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.7.11.tgz#b717e72f023d4215d14e4c57433c711a53c782cf"
integrity sha512-r6+vYq2vKzE+vgj/rNVRMwAevq0+ZR9IeMFIqcSga+wMtMdXQ27KqQ7uS99/yXASg29bos7yHP3yk4x6Iio0lw==

"@lmdb/lmdb-darwin-x64@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-2.7.11.tgz#b42898b0742b4a82b8224b742b2d174c449cd170"
integrity sha512-jhj1aB4K8ycRL1HOQT5OtzlqOq70jxUQEWRN9Gqh3TIDN30dxXtiHi6EWF516tzw6v2+3QqhDMJh8O6DtTGG8Q==

"@lmdb/lmdb-linux-arm64@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-2.7.11.tgz#a8dc8e386d27006cfccbf2a8598290b63d03a9ec"
integrity sha512-7xGEfPPbmVJWcY2Nzqo11B9Nfxs+BAsiiaY/OcT4aaTDdykKeCjvKMQJA3KXCtZ1AtiC9ljyGLi+BfUwdulY5A==

"@lmdb/lmdb-linux-arm@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-2.7.11.tgz#2103f48af28336efccaac008fe882dfce33e4ac5"
integrity sha512-dHfLFVSrw/v5X5lkwp0Vl7+NFpEeEYKfMG2DpdFJnnG1RgHQZngZxCaBagFoaJGykRpd2DYF1AeuXBFrAUAXfw==

"@lmdb/lmdb-linux-x64@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-2.7.11.tgz#d21ac368022a662610540f2ba8bb6ff0b96a9940"
integrity sha512-vUKI3JrREMQsXX8q0Eq5zX2FlYCKWMmLiCyyJNfZK0Uyf14RBg9VtB3ObQ41b4swYh2EWaltasWVe93Y8+KDng==

"@lmdb/lmdb-win32-x64@2.7.11":
version "2.7.11"
resolved "https://registry.yarnpkg.com/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-2.7.11.tgz#af2cb4ae6d3a92ecdeb1503b73079417525476d2"
integrity sha512-BJwkHlSUgtB+Ei52Ai32M1AOMerSlzyIGA/KC4dAGL+GGwVMdwG8HGCOA2TxP3KjhbgDPMYkv7bt/NmOmRIFng==

"@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz#44d752c1a2dc113f15f781b7cc4f53a307e3fa38"
integrity sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==

"@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.2.tgz#f954f34355712212a8e06c465bc06c40852c6bb3"
integrity sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==

"@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.2.tgz#45c63037f045c2b15c44f80f0393fa24f9655367"
integrity sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==

"@msgpackr-extract/msgpackr-extract-linux-arm@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.2.tgz#35707efeafe6d22b3f373caf9e8775e8920d1399"
integrity sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==

"@msgpackr-extract/msgpackr-extract-linux-x64@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.2.tgz#091b1218b66c341f532611477ef89e83f25fae4f"
integrity sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==

"@msgpackr-extract/msgpackr-extract-win32-x64@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz#0f164b726869f71da3c594171df5ebc1c4b0a407"
integrity sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==

"@noble/ed25519@^1.6.1":
version "1.7.3"
resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123"
Expand Down Expand Up @@ -3677,24 +3617,6 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

lmdb@2.7.11:
version "2.7.11"
resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.7.11.tgz#a24b6d36b5c7ed9889cc2d9e103fdd3f5e144d7e"
integrity sha512-x9bD4hVp7PFLUoELL8RglbNXhAMt5CYhkmss+CEau9KlNoilsTzNi9QDsPZb3KMpOGZXG6jmXhW3bBxE2XVztw==
dependencies:
msgpackr "1.8.5"
node-addon-api "^4.3.0"
node-gyp-build-optional-packages "5.0.6"
ordered-binary "^1.4.0"
weak-lru-cache "^1.2.2"
optionalDependencies:
"@lmdb/lmdb-darwin-arm64" "2.7.11"
"@lmdb/lmdb-darwin-x64" "2.7.11"
"@lmdb/lmdb-linux-arm" "2.7.11"
"@lmdb/lmdb-linux-arm64" "2.7.11"
"@lmdb/lmdb-linux-x64" "2.7.11"
"@lmdb/lmdb-win32-x64" "2.7.11"

locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
Expand Down Expand Up @@ -4039,27 +3961,6 @@ ms@2.1.3, ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

msgpackr-extract@^3.0.1:
version "3.0.2"
resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz#e05ec1bb4453ddf020551bcd5daaf0092a2c279d"
integrity sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==
dependencies:
node-gyp-build-optional-packages "5.0.7"
optionalDependencies:
"@msgpackr-extract/msgpackr-extract-darwin-arm64" "3.0.2"
"@msgpackr-extract/msgpackr-extract-darwin-x64" "3.0.2"
"@msgpackr-extract/msgpackr-extract-linux-arm" "3.0.2"
"@msgpackr-extract/msgpackr-extract-linux-arm64" "3.0.2"
"@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.2"
"@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.2"

msgpackr@1.8.5:
version "1.8.5"
resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.8.5.tgz#8cadfb935357680648f33699d0e833c9179dbfeb"
integrity sha512-mpPs3qqTug6ahbblkThoUY2DQdNXcm4IapwOS3Vm/87vmpzLVelvp9h3It1y9l1VPpiFLV11vfOXnmeEwiIXwg==
optionalDependencies:
msgpackr-extract "^3.0.1"

multer@^1.4.5-lts.1:
version "1.4.5-lts.1"
resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.5-lts.1.tgz#803e24ad1984f58edffbc79f56e305aec5cfd1ac"
Expand Down Expand Up @@ -4180,11 +4081,6 @@ node-addon-api@^2.0.0:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==

node-addon-api@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f"
integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==

node-addon-api@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762"
Expand All @@ -4204,16 +4100,6 @@ node-fetch@^2.6.12:
dependencies:
whatwg-url "^5.0.0"

node-gyp-build-optional-packages@5.0.6:
version "5.0.6"
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.6.tgz#2949f5cc7dace3ac470fa2ff1a37456907120a1d"
integrity sha512-2ZJErHG4du9G3/8IWl/l9Bp5BBFy63rno5GVmjQijvTuUZKsl6g8RB4KH/x3NLcV5ZBb4GsXmAuTYr6dRml3Gw==

node-gyp-build-optional-packages@5.0.7:
version "5.0.7"
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz#5d2632bbde0ab2f6e22f1bbac2199b07244ae0b3"
integrity sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==

node-gyp-build@^4.2.0, node-gyp-build@^4.3.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e"
Expand Down Expand Up @@ -4364,11 +4250,6 @@ optionator@^0.9.3:
prelude-ls "^1.2.1"
type-check "^0.4.0"

ordered-binary@^1.4.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/ordered-binary/-/ordered-binary-1.5.1.tgz#94ccbf14181711081ee23931db0dc3f58aaa0df6"
integrity sha512-5VyHfHY3cd0iza71JepYG50My+YUbrFtGoUz2ooEydPyPM7Aai/JW098juLr+RG6+rDJuzNNTsEQu2DZa1A41A==

os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
Expand Down Expand Up @@ -5474,33 +5355,6 @@ warp-arbundles@^1.0.4:
buffer "^6.0.3"
warp-isomorphic "^1.0.7"

warp-contracts-lmdb@^1.1.10:
version "1.1.10"
resolved "https://registry.yarnpkg.com/warp-contracts-lmdb/-/warp-contracts-lmdb-1.1.10.tgz#f81f85c36bc7c5afdfa7aab897187051acf7479f"
integrity sha512-Ak6/FAtzImpBtXppOwxq2SYUbn0ekLH2O2EoKU2jVicuTPEz/vVaZRd3uYiUg2sJCid9iCzoDXM6XPUc8/AsUA==
dependencies:
lmdb "2.7.11"

warp-contracts@1.4.33:
version "1.4.33"
resolved "https://registry.yarnpkg.com/warp-contracts/-/warp-contracts-1.4.33.tgz#06091eddd92cba75b6ded6c9a97e4d574fe00127"
integrity sha512-MYmjhfgvzYSD8OCxt2ZGyHfn90aHBzdjB3JmtkThYpzs0OFhIO+CAFue67v+gbIAP9TPBrMu4S8l9lL0dRXl2g==
dependencies:
archiver "^5.3.0"
arweave "1.13.7"
async-mutex "^0.4.0"
bignumber.js "9.1.1"
events "3.3.0"
fast-copy "^3.0.0"
level "^8.0.0"
memory-level "^1.0.0"
safe-stable-stringify "2.4.1"
stream-buffers "^3.0.2"
unzipit "^1.4.0"
warp-arbundles "^1.0.4"
warp-isomorphic "^1.0.7"
warp-wasm-metering "1.0.1"

warp-contracts@1.4.45:
version "1.4.45"
resolved "https://registry.yarnpkg.com/warp-contracts/-/warp-contracts-1.4.45.tgz#918ede8cdc272bb6c0e9d9334a31107071b8b894"
Expand Down Expand Up @@ -5554,11 +5408,6 @@ warp-wasm-metering@1.0.1:
leb128 "^0.0.4"
warp-wasm-json-toolkit "1.0.2"

weak-lru-cache@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz#fdbb6741f36bae9540d12f480ce8254060dccd19"
integrity sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
Expand Down

0 comments on commit 9b6257c

Please sign in to comment.