Skip to content

Commit

Permalink
Stop using underscore dangle
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Sep 18, 2023
1 parent 465669c commit 4f9982b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = {
"never"
],

"no-underscore-dangle": "warn",
"no-use-before-define": "warn",
"no-warning-comments": "warn",
"prefer-destructuring": "warn",
Expand Down
16 changes: 8 additions & 8 deletions src/submitters/auto-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export class AutoSubmitter extends Submitter {
ethers.utils.getAddress(MARIONETTE_ADDRESS)) {
console.log("Marionette owner is detected");

const imaInstance = await AutoSubmitter._getImaInstance();
const mainnetChainId = AutoSubmitter._getMainnetChainId();
const safeAddress = AutoSubmitter._getSafeAddress();
const schainHash = AutoSubmitter._getSchainHash();
const imaInstance = await AutoSubmitter.getImaInstance();
const mainnetChainId = AutoSubmitter.getMainnetChainId();
const safeAddress = AutoSubmitter.getSafeAddress();
const schainHash = AutoSubmitter.getSchainHash();

/*
* TODO: after marionette has multiSend functionality
Expand Down Expand Up @@ -104,7 +104,7 @@ export class AutoSubmitter extends Submitter {
return new SafeSubmitter(owner);
}

private static async _getImaInstance () {
private static async getImaInstance () {
if (!process.env.IMA) {
console.log(chalk.red("Set target IMA alias" +
" to IMA environment variable"));
Expand All @@ -116,7 +116,7 @@ export class AutoSubmitter extends Submitter {
return await ima.getInstance(process.env.IMA);
}

private static _getSafeAddress () {
private static getSafeAddress () {
if (!process.env.SAFE_ADDRESS) {
console.log(chalk.red("Set Gnosis Safe owner address" +
" to SAFE_ADDRESS environment variable"));
Expand All @@ -125,7 +125,7 @@ export class AutoSubmitter extends Submitter {
return process.env.SAFE_ADDRESS;
}

private static _getSchainHash () {
private static getSchainHash () {
// Query Context to get schain hash
if (process.env.SCHAIN_HASH) {
return process.env.SCHAIN_HASH;
Expand All @@ -143,7 +143,7 @@ export class AutoSubmitter extends Submitter {
throw Error("Schain is not set");
}

private static _getMainnetChainId () {
private static getMainnetChainId () {
if (process.env.MAINNET_CHAIN_ID) {
return Number.parseInt(process.env.MAINNET_CHAIN_ID);
}
Expand Down
2 changes: 1 addition & 1 deletion src/submitters/eoa-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class EoaSubmitter extends Submitter {
name = "EOA Submitter";

async submit (transactions: UnsignedTransaction[]) {
EoaSubmitter._atomicityWarning();
EoaSubmitter.atomicityWarning();
const [deployer] = await ethers.getSigners();
const nonce = await deployer.getTransactionCount();
console.log(`Send transaction via ${this.name}`);
Expand Down
2 changes: 1 addition & 1 deletion src/submitters/safe-ima-legacy-marionette-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class SafeImaLegacyMarionetteSubmitter extends SafeToImaSubmitter {
async submit (transactions: UnsignedTransaction[]): Promise<void> {
const singleTransaction = 1;
if (transactions.length > singleTransaction) {
SafeImaLegacyMarionetteSubmitter._atomicityWarning();
SafeImaLegacyMarionetteSubmitter.atomicityWarning();
}
const zeroValue = 0;
const transactionsToMarionette =
Expand Down
14 changes: 7 additions & 7 deletions src/submitters/safe-to-ima-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SafeToImaSubmitter extends SafeSubmitter {

targetSchainHash: BytesLike;

private _messageProxyForMainnet: Contract | undefined;
private messageProxyForMainnet: Contract | undefined;

constructor (
safeAddress: string,
Expand All @@ -30,9 +30,9 @@ export class SafeToImaSubmitter extends SafeSubmitter {
async submit (transactions: UnsignedTransaction[]): Promise<void> {
const singleTransaction = 1;
if (transactions.length > singleTransaction) {
SafeToImaSubmitter._atomicityWarning();
SafeToImaSubmitter.atomicityWarning();
}
const messageProxyForMainnet = await this._getMessageProxyForMainnet();
const messageProxyForMainnet = await this.getMessageProxyForMainnet();
const transactionsToIma = transactions.map((transaction) => ({
"to": messageProxyForMainnet.address,
"data": messageProxyForMainnet.interface.encodeFunctionData(
Expand All @@ -47,11 +47,11 @@ export class SafeToImaSubmitter extends SafeSubmitter {
await super.submit(transactionsToIma);
}

private async _getMessageProxyForMainnet () {
if (typeof this._messageProxyForMainnet === "undefined") {
this._messageProxyForMainnet =
private async getMessageProxyForMainnet () {
if (typeof this.messageProxyForMainnet === "undefined") {
this.messageProxyForMainnet =
await this.imaInstance.getContract("MessageProxyForMainnet");
}
return this._messageProxyForMainnet;
return this.messageProxyForMainnet;
}
}
2 changes: 1 addition & 1 deletion src/submitters/submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export abstract class Submitter {

// Protected

protected static _atomicityWarning () {
protected static atomicityWarning () {
if (process.env.ALLOW_NOT_ATOMIC_UPGRADE) {
console.log(chalk.yellow("Not atomic upgrade is performing"));
} else {
Expand Down

0 comments on commit 4f9982b

Please sign in to comment.