Skip to content

Commit

Permalink
Fix more format
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Nov 5, 2024
1 parent cb9e274 commit e9b6053
Show file tree
Hide file tree
Showing 54 changed files with 283 additions and 325 deletions.
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ export default tseslint.config(
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const config = {
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
};
}

export default config;
export default config
6 changes: 3 additions & 3 deletions src/client/rest/api/SlashingAPI.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ describe('SlashingAPI', () => {
it('parameters', async () => {
await expect(slashing.parameters()).resolves.toMatchObject({
signed_blocks_window: expect.any(Number),
min_signed_per_window: expect.any(Number),
min_signed_per_window: expect.any(String),
downtime_jail_duration: expect.any(Duration),
slash_fraction_double_sign: expect.any(Number),
slash_fraction_downtime: expect.any(Number),
slash_fraction_double_sign: expect.any(String),
slash_fraction_downtime: expect.any(String),
})
})
})
6 changes: 3 additions & 3 deletions src/core/Coins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ describe('Coins', () => {
// input #4: string
const coins4 = new Coins('2uinit,1uinit')

;[coins1, coins2, coins3, coins4].forEach((cs) => {
expect(cs).toEqual(ref)
})
for (const coin of [coins1, coins2, coins3, coins4]) {
expect(coin).toEqual(ref)
}
})

it('fromString', () => {
Expand Down
46 changes: 23 additions & 23 deletions src/core/bank/msgs/MsgMultiSend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,19 @@ export namespace MsgMultiSend {

/**
* @param address address
* @param coinsInput coins-compatible input
* @param coins_input coins-compatible input
*/
constructor(
public address: AccAddress,
coinsInput: Coins.Input
coins_input: Coins.Input
) {
super()
this.coins = new Coins(coinsInput)
this.coins = new Coins(coins_input)
}

public static fromAmino(data: Input.Amino): Input {
const { address, coins } = data
return new Input(address, Coins.fromAmino(coins))
}

public toAmino(): Input.Amino {
Expand All @@ -176,9 +181,9 @@ export namespace MsgMultiSend {
}
}

public static fromAmino(data: Input.Amino): Input {
public static fromData(data: Input.Data): Input {
const { address, coins } = data
return new Input(address, Coins.fromAmino(coins))
return new Input(address, Coins.fromData(coins))
}

public toData(): Input.Data {
Expand All @@ -189,9 +194,8 @@ export namespace MsgMultiSend {
}
}

public static fromData(data: Input.Data): Input {
const { address, coins } = data
return new Input(address, Coins.fromData(coins))
public static fromProto(proto: Input.Proto): Input {
return new Input(proto.address, Coins.fromProto(proto.coins))
}

public toProto(): Input.Proto {
Expand All @@ -201,10 +205,6 @@ export namespace MsgMultiSend {
coins: coins.toProto(),
})
}

public static fromProto(proto: Input.Proto): Input {
return new Input(proto.address, Coins.fromProto(proto.coins))
}
}

export class Output extends JSONSerializable<
Expand All @@ -223,10 +223,15 @@ export namespace MsgMultiSend {
*/
constructor(
public address: AccAddress,
coinsInput: Coins.Input
coins_input: Coins.Input
) {
super()
this.coins = new Coins(coinsInput)
this.coins = new Coins(coins_input)
}

public static fromAmino(data: Output.Amino): Output {
const { address, coins } = data
return new Output(address, Coins.fromAmino(coins))
}

public toAmino(): Output.Amino {
Expand All @@ -237,9 +242,9 @@ export namespace MsgMultiSend {
}
}

public static fromAmino(data: Output.Amino): Output {
public static fromData(data: Output.Data): Output {
const { address, coins } = data
return new Output(address, Coins.fromAmino(coins))
return new Output(address, Coins.fromData(coins))
}

public toData(): Output.Data {
Expand All @@ -250,9 +255,8 @@ export namespace MsgMultiSend {
}
}

public static fromData(data: Output.Data): Output {
const { address, coins } = data
return new Output(address, Coins.fromData(coins))
public static fromProto(proto: Output.Proto): Output {
return new Output(proto.address, Coins.fromProto(proto.coins))
}

public toProto(): Output.Proto {
Expand All @@ -262,10 +266,6 @@ export namespace MsgMultiSend {
coins: coins.toProto(),
})
}

public static fromProto(proto: Output.Proto): Output {
return new Output(proto.address, Coins.fromProto(proto.coins))
}
}

export namespace Input {
Expand Down
1 change: 0 additions & 1 deletion src/core/celestia/Blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class Blob extends JSONSerializable<any, Blob.Data, Blob.Proto> {
}

public static fromAmino(_: any): Blob {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/celestia/BlobTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class BlobTx extends JSONSerializable<any, BlobTx.Data, BlobTx.Proto> {
}

public static fromAmino(_: any): BlobTx {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/celestia/msgs/MsgPayForBlobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class MsgPayForBlobs extends JSONSerializable<
}

public static fromAmino(_: any): MsgPayForBlobs {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/applications/fee/msgs/MsgPayPacketFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MsgPayPacketFee extends JSONSerializable<
}

public static fromAmino(_: any): MsgPayPacketFee {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/applications/fee/msgs/MsgPayPacketFeeAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class MsgPayPacketFeeAsync extends JSONSerializable<
}

public static fromAmino(_: any): any {
_
throw new Error('Amino not supported')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class MsgRegisterCounterpartyPayee extends JSONSerializable<
}

public static fromAmino(_: any): MsgRegisterCounterpartyPayee {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/applications/fee/msgs/MsgRegisterPayee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class MsgRegisterPayee extends JSONSerializable<
}

public static fromAmino(_: any): MsgRegisterPayee {
_
throw new Error('Amino not supported')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class TransferAuthorization extends JSONSerializable<
}

public static fromAmino(_: any): TransferAuthorization {
_
throw new Error('Amino not supported')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class MsgUpdateIbcTransferParams extends JSONSerializable<
}

public static fromAmino(_: any): MsgUpdateIbcTransferParams {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelCloseConfirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MsgChannelCloseConfirm extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelCloseConfirm {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelCloseInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class MsgChannelCloseInit extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelCloseInit {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelOpenAck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class MsgChannelOpenAck extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelOpenAck {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelOpenConfirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MsgChannelOpenConfirm extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelOpenConfirm {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelOpenInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class MsgChannelOpenInit extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelOpenInit {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgChannelOpenTry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class MsgChannelOpenTry extends JSONSerializable<
}

public static fromAmino(_: any): MsgChannelOpenTry {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgRecvAcknowledgement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MsgAcknowledgement extends JSONSerializable<
}

public static fromAmino(_: any): MsgAcknowledgement {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgRecvPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class MsgRecvPacket extends JSONSerializable<
}

public static fromAmino(_: any): MsgRecvPacket {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MsgTimeout extends JSONSerializable<
}

public static fromAmino(_: any): MsgTimeout {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/channel/msgs/MsgTimeoutClose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class MsgTimeoutOnClose extends JSONSerializable<
}

public static fromAmino(_: any): MsgTimeoutOnClose {
_
throw new Error('Amino not supported')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class MsgUpdateIbcChannelParams extends JSONSerializable<
}

public static fromAmino(_: any): MsgUpdateIbcChannelParams {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgCreateClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class MsgCreateClient extends JSONSerializable<
}

public static fromAmino(_: any): MsgCreateClient {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgIBCSoftwareUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class MsgIBCSoftwareUpgrade extends JSONSerializable<
}

public static fromAmino(_: any): MsgIBCSoftwareUpgrade {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgRecoverClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class MsgRecoverClient extends JSONSerializable<
}

public static fromAmino(_: any): MsgRecoverClient {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgSubmitMisbehaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class MsgSubmitMisbehaviour extends JSONSerializable<
}

public static fromAmino(_: any): MsgSubmitMisbehaviour {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgUpdateClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class MsgUpdateClient extends JSONSerializable<
}

public static fromAmino(_: any): MsgUpdateClient {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgUpdateIbcClientParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class MsgUpdateIbcClientParams extends JSONSerializable<
}

public static fromAmino(_: any): MsgUpdateIbcClientParams {
_
throw new Error('Amino not supported')
}

Expand Down
1 change: 0 additions & 1 deletion src/core/ibc/core/client/msgs/MsgUpgradeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class MsgUpgradeClient extends JSONSerializable<
}

public static fromAmino(_: any): MsgUpgradeClient {
_
throw new Error('Amino not supported')
}

Expand Down
2 changes: 0 additions & 2 deletions src/core/ibc/core/client/msgs/tendermint/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class Proof extends JSONSerializable<any, Proof.Data, Proof.Proto> {
}

public static fromAmino(_: any): Proof {
_
throw new Error('Amino not supported')
}

Expand Down Expand Up @@ -92,7 +91,6 @@ export class PublicKey extends JSONSerializable<
}

public static fromAmino(_: any): PublicKey {
_
throw new Error('Amino not supported')
}

Expand Down
Loading

0 comments on commit e9b6053

Please sign in to comment.