Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
anondev2323 committed Oct 17, 2023
1 parent da1f8eb commit f21bccc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 29 deletions.
4 changes: 1 addition & 3 deletions core/definitions/src/testing/mocks/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export class MockTokenBridge<P extends PlatformName> implements TokenBridge<P> {
): Promise<boolean> {
throw new Error("Method not implemented.");
}
createAttestation(
address: AnyAddress,
): AsyncGenerator<UnsignedTransaction> {
createAttestation(address: AnyAddress): AsyncGenerator<UnsignedTransaction> {
throw new Error("Method not implemented.");
}
submitAttestation(
Expand Down
8 changes: 7 additions & 1 deletion platforms/cosmwasm/src/protocols/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ export class CosmwasmIbcBridge implements IbcBridge<"Cosmwasm"> {
const timeout = millisToNano(Date.now() + IBC_TIMEOUT_MILLIS);
const memo = JSON.stringify(payload);

const ibcDenom = token === 'native' ? CosmwasmPlatform.getNativeDenom(this.chain) : Gateway.deriveIbcDenom(this.chain, new CosmwasmAddress(token).toString());
const ibcDenom =
token === "native"
? CosmwasmPlatform.getNativeDenom(this.chain)
: Gateway.deriveIbcDenom(
this.chain,
new CosmwasmAddress(token).toString(),
);
const ibcToken = coin(amount.toString(), ibcDenom.toString());

const ibcMessage: MsgTransferEncodeObject = {
Expand Down
11 changes: 4 additions & 7 deletions platforms/evm/src/protocols/automaticCircleBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import {

import { evmNetworkChainToEvmChainId } from '../constants';

import {
AnyEvmAddress,
EvmChainName,
addChainId,
addFrom,
} from '../types';
import { AnyEvmAddress, EvmChainName, addChainId, addFrom } from '../types';
import { EvmUnsignedTransaction } from '../unsignedTransaction';
import { CircleRelayer } from '../ethers-contracts';
import { Provider, TransactionRequest } from 'ethers';
Expand Down Expand Up @@ -65,7 +60,9 @@ export class EvmAutomaticCircleBridge implements AutomaticCircleBridge<'Evm'> {
.toUint8Array();
const nativeTokenGas = nativeGas ? nativeGas : 0n;

const tokenAddr = new EvmAddress(token.address.toUniversalAddress()).toString();
const tokenAddr = new EvmAddress(
token.address.toUniversalAddress(),
).toString();

const tokenContract = EvmContracts.getTokenImplementation(
this.provider,
Expand Down
11 changes: 4 additions & 7 deletions platforms/evm/src/protocols/automaticTokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ import {
import { Provider, TransactionRequest } from 'ethers';

import { evmNetworkChainToEvmChainId } from '../constants';
import {
AnyEvmAddress,
EvmChainName,
addChainId,
addFrom,
} from '../types';
import { AnyEvmAddress, EvmChainName, addChainId, addFrom } from '../types';
import { EvmUnsignedTransaction } from '../unsignedTransaction';
import { TokenBridgeRelayer } from '../ethers-contracts';
import { EvmContracts } from '../contracts';
Expand Down Expand Up @@ -131,7 +126,9 @@ export class EvmAutomaticTokenBridge implements AutomaticTokenBridge<'Evm'> {
: token;

const destChainId = toChainId(recipient.chain);
const destTokenAddress = new EvmAddress(tokenId.address.toString()).toString();
const destTokenAddress = new EvmAddress(
tokenId.address.toString(),
).toString();

const tokenContract = EvmContracts.getTokenImplementation(
this.provider,
Expand Down
4 changes: 3 additions & 1 deletion platforms/evm/src/protocols/circleBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export class EvmCircleBridge implements CircleBridge<'Evm'> {
const recipientAddress = recipient.address
.toUniversalAddress()
.toUint8Array();
const tokenAddr = new EvmAddress(token.address as UniversalOrEvm).toString();
const tokenAddr = new EvmAddress(
token.address as UniversalOrEvm,
).toString();

const tokenContract = EvmContracts.getTokenImplementation(
this.provider,
Expand Down
4 changes: 3 additions & 1 deletion platforms/evm/src/protocols/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export class EvmTokenBridge implements TokenBridge<'Evm'> {
}

async isWrappedAsset(token: AnyEvmAddress): Promise<boolean> {
return await this.tokenBridge.isWrappedAsset(new EvmAddress(token).toString());
return await this.tokenBridge.isWrappedAsset(
new EvmAddress(token).toString(),
);
}

async getOriginalAsset(token: AnyEvmAddress): Promise<TokenId> {
Expand Down
7 changes: 1 addition & 6 deletions platforms/evm/src/protocols/wormholeCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import {
} from '../constants';
import { EvmUnsignedTransaction } from '../unsignedTransaction';
import { EvmContracts } from '../contracts';
import {
AnyEvmAddress,
EvmChainName,
addChainId,
addFrom,
} from '../types';
import { AnyEvmAddress, EvmChainName, addChainId, addFrom } from '../types';
import { EvmPlatform } from '../platform';
import { EvmAddress } from '../address';

Expand Down
6 changes: 3 additions & 3 deletions platforms/solana/src/protocols/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class SolanaTokenBridge implements TokenBridge<'Solana'> {
if (!(await this.isWrappedAsset(token)))
throw ErrNotWrapped(token.toString());

const tokenAddr = new SolanaAddress(token).toUint8Array()
const tokenAddr = new SolanaAddress(token).toUint8Array();
const mint = new PublicKey(tokenAddr);

try {
Expand Down Expand Up @@ -170,7 +170,7 @@ export class SolanaTokenBridge implements TokenBridge<'Solana'> {
token: AnySolanaAddress,
payer?: AnySolanaAddress,
): AsyncGenerator<SolanaUnsignedTransaction> {
if (!payer) throw new Error("Payer required to create attestation");
if (!payer) throw new Error('Payer required to create attestation');
const senderAddress = new SolanaAddress(payer).unwrap();
// TODO:
const nonce = 0; // createNonce().readUInt32LE(0);
Expand Down Expand Up @@ -204,7 +204,7 @@ export class SolanaTokenBridge implements TokenBridge<'Solana'> {
vaa: VAA<'AttestMeta'>,
payer?: AnySolanaAddress,
): AsyncGenerator<SolanaUnsignedTransaction> {
if (!payer) throw new Error("Payer required to create attestation");
if (!payer) throw new Error('Payer required to create attestation');
const senderAddress = new SolanaAddress(payer).unwrap();

const transaction = new Transaction().add(
Expand Down

0 comments on commit f21bccc

Please sign in to comment.