Skip to content

Commit

Permalink
improve: remove uma logger dep (#702)
Browse files Browse the repository at this point in the history
Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris authored Aug 15, 2024
1 parent 6a2377a commit 13c06fb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1,652 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk",
"author": "UMA Team",
"version": "3.1.23",
"version": "3.1.24",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down Expand Up @@ -105,7 +105,6 @@
"@eth-optimism/sdk": "^3.3.1",
"@pinata/sdk": "^2.1.0",
"@types/mocha": "^10.0.1",
"@uma/logger": "^1.3.0",
"@uma/sdk": "^0.34.1",
"arweave": "^1.14.4",
"async": "^3.2.5",
Expand Down
7 changes: 4 additions & 3 deletions src/providers/rateLimitedProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { QueueObject, queue } from "async";
import { ethers } from "ethers";
import { RateLimitTask } from "./utils";
import { getOriginFromURL } from "../utils/NetworkUtils";
import { Logger } from "winston";
import { Logger as umaLogger } from "@uma/logger";
import winston, { Logger } from "winston";

// This provider is a very small addition to the StaticJsonRpcProvider that ensures that no more than `maxConcurrency`
// requests are ever in flight. It uses the async/queue library to manage this.
Expand All @@ -20,7 +19,9 @@ export class RateLimitedProvider extends ethers.providers.StaticJsonRpcProvider
constructor(
maxConcurrency: number,
readonly pctRpcCallsLogged: number,
readonly logger: Logger = umaLogger,
readonly logger: Logger = winston.createLogger({
transports: [new winston.transports.Console()],
}),
...cacheConstructorParams: ConstructorParameters<typeof ethers.providers.StaticJsonRpcProvider>
) {
super(...cacheConstructorParams);
Expand Down
4 changes: 2 additions & 2 deletions src/providers/retryProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { delay, isDefined, isPromiseFulfilled, isPromiseRejected } from "../util
import { getOriginFromURL } from "../utils/NetworkUtils";
import { CacheProvider } from "./cachedProvider";
import { compareRpcResults, createSendErrorWithMessage, formatProviderError } from "./utils";
import { AugmentedLogger } from "@uma/logger";
import { PROVIDER_CACHE_TTL } from "./constants";
import { Logger } from "winston";

export class RetryProvider extends ethers.providers.StaticJsonRpcProvider {
readonly providers: ethers.providers.StaticJsonRpcProvider[];
Expand All @@ -22,7 +22,7 @@ export class RetryProvider extends ethers.providers.StaticJsonRpcProvider {
standardTtlBlockDistance?: number,
noTtlBlockDistance?: number,
providerCacheTtl = PROVIDER_CACHE_TTL,
logger?: AugmentedLogger
logger?: Logger
) {
// Initialize the super just with the chainId, which stops it from trying to immediately send out a .send before
// this derived class is initialized.
Expand Down
Loading

0 comments on commit 13c06fb

Please sign in to comment.