Skip to content
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
8 changes: 0 additions & 8 deletions eslint-suppressions.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff 🧹

Original file line number Diff line number Diff line change
Expand Up @@ -1330,14 +1330,6 @@
"count": 2
}
},
"packages/tron-wallet-snap/snap.config.ts": {
"import-x/no-nodejs-modules": {
"count": 1
},
"no-restricted-globals": {
"count": 20
}
},
"packages/tron-wallet-snap/src/caching/StateCache.ts": {
"no-restricted-syntax": {
"count": 1
Expand Down
5 changes: 5 additions & 0 deletions packages/tron-wallet-snap/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# - production before submitting a PR
ENVIRONMENT=local

# Log Level
# Possible Options: error, warn, info, debug, trace, silent
# Default: info
LOG_LEVEL=silent

RPC_URL_LIST_MAINNET=https://api.trongrid.io
RPC_URL_LIST_NILE_TESTNET=https://nile.trongrid.io
RPC_URL_LIST_SHASTA_TESTNET=https://api.shasta.trongrid.io/jsonrpc
Expand Down
2 changes: 2 additions & 0 deletions packages/tron-wallet-snap/snap.config.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must not forget to add this to the CI... And we must also not forget that this will introduce shasum shenanigans due to local VS CI mismatch 🐒

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all good as we already have this in CI, because bitcoin uses this approach

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import-x/no-nodejs-modules, no-restricted-globals -- Snap configuration executes in Node.js. */
import type { SnapConfig } from '@metamask/snaps-cli';
import { config as dotenv } from 'dotenv';
import { resolve } from 'path';
Expand All @@ -11,6 +12,7 @@ const config: SnapConfig = {
},
environment: {
ENVIRONMENT: process.env.ENVIRONMENT ?? '',
LOG_LEVEL: process.env.LOG_LEVEL ?? '',
// RPC
RPC_URL_LIST_MAINNET: process.env.RPC_URL_LIST_MAINNET ?? '',
RPC_URL_LIST_NILE_TESTNET: process.env.RPC_URL_LIST_NILE_TESTNET ?? '',
Expand Down
2 changes: 1 addition & 1 deletion packages/tron-wallet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/internal-snaps.git"
},
"source": {
"shasum": "tjWVt/iPBoSqDOS1uPATvu4MiZ4mkgwuEEZlMNDAwHc=",
"shasum": "MbqwOXbHFI83/qWOj9zDSXJizgEt5oQ+QnpHq0g/sls=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/tron-wallet-snap/src/caching/InMemoryCache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Logger } from '@metamask/snap-networks-utils/logger';
import { assert } from '@metamask/utils';

import type { ILogger } from '../utils/logger';
import type { Serializable } from '../utils/serialization/types';
import type { ICache } from './ICache';
import type { CacheEntry } from './types';
Expand All @@ -14,9 +14,9 @@ import type { CacheEntry } from './types';
export class InMemoryCache implements ICache<Serializable> {
readonly #cache: Map<string, CacheEntry> = new Map();

public readonly logger: ILogger;
public readonly logger: Logger;

constructor(logger: ILogger) {
constructor(logger: Logger) {
this.logger = logger;
}

Expand Down
Loading