Skip to content

Commit

Permalink
Remove redundant and fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Nov 5, 2024
1 parent 6fd68fd commit f5afe99
Show file tree
Hide file tree
Showing 41 changed files with 94 additions and 161 deletions.
4 changes: 1 addition & 3 deletions src/core/authz/msgs/MsgExecAuthorized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export class MsgExecAuthorized extends JSONSerializable<
type: 'cosmos-sdk/MsgExec',
value: {
grantee,
msgs: msgs.map((msg): Msg.Amino => {
return msg.toAmino()
}),
msgs: msgs.map((msg) => msg.toAmino()),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/gov/Deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Deposit extends JSONSerializable<
const { proposal_id, depositor, amount } = this
return Deposit_pb.fromPartial({
proposalId: proposal_id,
depositor: depositor,
depositor,
amount: amount.toProto(),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/gov/msgs/MsgSubmitProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class MsgSubmitProposal extends JSONSerializable<
return {
type: 'cosmos-sdk/v1/MsgSubmitProposal',
value: {
messages: messages.map((msg): Msg.Amino => msg.toAmino()),
messages: messages.map((msg) => msg.toAmino()),
initial_deposit: initial_deposit.toAmino(),
proposer,
metadata: metadata && metadata !== '' ? metadata : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/core/gov/proposals/Proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class Proposal extends JSONSerializable<

return {
id: id.toFixed(),
messages: messages.map((msg): Msg.Amino => msg.toAmino()),
messages: messages.map((msg) => msg.toAmino()),
status: proposalStatusToJSON(status),
final_tally_result: final_tally_result.toAmino(),
submit_time: submit_time.toISOString(),
Expand Down
2 changes: 1 addition & 1 deletion src/core/group/GroupProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class GroupProposal extends JSONSerializable<
},
voting_period_end: voting_period_end.toISOString(),
executor_result: proposalExecutorResultToJSON(executor_result),
messages: messages.map((msg): Msg.Amino => msg.toAmino()),
messages: messages.map((msg) => msg.toAmino()),
title,
summary,
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/group/msgs/MsgLeaveGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MsgLeaveGroup extends JSONSerializable<
return {
type: 'cosmos-sdk/group/MsgLeaveGroup',
value: {
address: address,
address,
group_id: group_id.toFixed(),
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/group/msgs/MsgSubmitGroupProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class MsgSubmitGroupProposal extends JSONSerializable<
group_policy_address,
proposers,
metadata,
messages: messages.map((msg): Msg.Amino => msg.toAmino()),
messages: messages.map((msg) => msg.toAmino()),
exec: execToJSON(exec),
title,
summary,
Expand Down
6 changes: 2 additions & 4 deletions src/core/ibc/applications/fee/IbcFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ export class IbcFee extends JSONSerializable<

public toAmino(): IbcFee.Amino {
const { recv_fee, ack_fee, timeout_fee } = this
const res: IbcFee.Amino = {
return {
recv_fee: recv_fee.toAmino(),
ack_fee: ack_fee.toAmino(),
timeout_fee: timeout_fee.toAmino(),
}
return res
}

public static fromData(data: IbcFee.Data): IbcFee {
Expand All @@ -62,12 +61,11 @@ export class IbcFee extends JSONSerializable<

public toData(): IbcFee.Data {
const { recv_fee, ack_fee, timeout_fee } = this
const res: IbcFee.Data = {
return {
recv_fee: recv_fee.toData(),
ack_fee: ack_fee.toData(),
timeout_fee: timeout_fee.toData(),
}
return res
}

public static fromProto(proto: IbcFee.Proto): IbcFee {
Expand Down
9 changes: 3 additions & 6 deletions src/core/ibc/applications/fee/IdentifiedPacketFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ export class IdentifiedPacketFees extends JSONSerializable<

public toAmino(): IdentifiedPacketFees.Amino {
const { packet_id, packet_fees } = this
const res: IdentifiedPacketFees.Amino = {
return {
packet_id: packet_id?.toAmino(),
packet_fees: packet_fees.map((fee) => fee.toAmino()),
}
return res
}

public static fromData(
Expand All @@ -53,11 +52,10 @@ export class IdentifiedPacketFees extends JSONSerializable<

public toData(): IdentifiedPacketFees.Data {
const { packet_id, packet_fees } = this
const res: IdentifiedPacketFees.Data = {
return {
packet_id: packet_id?.toData(),
packet_fees: packet_fees.map((fee) => fee.toData()),
}
return res
}

public static fromProto(
Expand All @@ -71,11 +69,10 @@ export class IdentifiedPacketFees extends JSONSerializable<

public toProto(): IdentifiedPacketFees.Proto {
const { packet_id, packet_fees } = this
const res: IdentifiedPacketFees.Proto = {
return {
packetId: packet_id?.toProto(),
packetFees: packet_fees.map((fee) => fee.toProto()),
}
return res
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/core/ibc/applications/fee/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ export class Metadata extends JSONSerializable<

public toAmino(): Metadata.Amino {
const { fee_version, app_version } = this
const res: Metadata.Amino = {
return {
fee_version,
app_version,
}
return res
}

public static fromData(data: Metadata.Data): Metadata {
Expand All @@ -42,11 +41,10 @@ export class Metadata extends JSONSerializable<

public toData(): Metadata.Data {
const { fee_version, app_version } = this
const res: Metadata.Data = {
return {
fee_version,
app_version,
}
return res
}

public static fromProto(proto: Metadata.Proto): Metadata {
Expand Down
8 changes: 3 additions & 5 deletions src/core/ibc/applications/fee/PacketFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ export class PacketFee extends JSONSerializable<

public toAmino(): PacketFee.Amino {
const { fee, refund_address, relayers } = this
const res: PacketFee.Amino = {
return {
fee: fee?.toAmino(),
refund_address,
relayers,
}
return res
}

public static fromData(data: PacketFee.Data): PacketFee {
Expand All @@ -54,12 +53,11 @@ export class PacketFee extends JSONSerializable<

public toData(): PacketFee.Data {
const { fee, refund_address, relayers } = this
const res: PacketFee.Data = {
return {
fee: fee?.toData(),
refund_address,
relayers,
}
return res
}

public static fromProto(proto: PacketFee.Proto): PacketFee {
Expand All @@ -75,7 +73,7 @@ export class PacketFee extends JSONSerializable<
return PacketFee_pb.fromPartial({
fee: fee?.toProto(),
refundAddress: refund_address,
relayers: relayers,
relayers,
})
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/core/ibc/applications/interchain-account/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ export class InterchainAccount extends JSONSerializable<

public toAmino(): InterchainAccount.Amino {
const { base_account, account_owner } = this
const res: InterchainAccount.Amino = {
return {
base_account: base_account?.toAmino(),
account_owner,
}
return res
}

public static fromData(data: InterchainAccount.Data): InterchainAccount {
Expand All @@ -48,11 +47,10 @@ export class InterchainAccount extends JSONSerializable<

public toData(): InterchainAccount.Data {
const { base_account, account_owner } = this
const res: InterchainAccount.Data = {
return {
base_account: base_account?.toData(),
account_owner,
}
return res
}

public static fromProto(proto: InterchainAccount.Proto): InterchainAccount {
Expand Down
14 changes: 7 additions & 7 deletions src/core/ibc/applications/interchain-account/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export class Metadata extends JSONSerializable<
encoding,
tx_type,
} = this
const res: Metadata.Amino = {

return {
version,
controller_connection_id,
host_connection_id,
address,
encoding,
tx_type,
}
return res
}

public static fromData(data: Metadata.Data): Metadata {
Expand Down Expand Up @@ -96,15 +96,15 @@ export class Metadata extends JSONSerializable<
encoding,
tx_type,
} = this
const res: Metadata.Data = {

return {
version,
controller_connection_id,
host_connection_id,
address,
encoding,
tx_type,
}
return res
}

public static fromProto(proto: Metadata.Proto): Metadata {
Expand All @@ -128,11 +128,11 @@ export class Metadata extends JSONSerializable<
tx_type,
} = this
return Metadata_pb.fromPartial({
version: version,
version,
controllerConnectionId: controller_connection_id,
hostConnectionId: host_connection_id,
address: address,
encoding: encoding,
address,
encoding,
txType: tx_type,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ export class Params extends JSONSerializable<

public toAmino(): Params.Amino {
const { controller_enabled } = this
const res: Params.Amino = {
controller_enabled: controller_enabled,
return {
controller_enabled,
}
return res
}

public static fromData(data: Params.Data): Params {
Expand All @@ -37,10 +36,9 @@ export class Params extends JSONSerializable<

public toData(): Params.Data {
const { controller_enabled } = this
const res: Params.Data = {
return {
controller_enabled,
}
return res
}

public static fromProto(proto: Params.Proto): Params {
Expand Down
10 changes: 4 additions & 6 deletions src/core/ibc/applications/interchain-account/host/Params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ export class Params extends JSONSerializable<

public toAmino(): Params.Amino {
const { host_enabled, allowed_messages } = this
const res: Params.Amino = {
host_enabled: host_enabled,
allowed_messages: allowed_messages,
return {
host_enabled,
allowed_messages,
}
return res
}

public static fromData(data: Params.Data): Params {
Expand All @@ -41,11 +40,10 @@ export class Params extends JSONSerializable<

public toData(): Params.Data {
const { host_enabled, allowed_messages } = this
const res: Params.Data = {
return {
host_enabled,
allowed_messages,
}
return res
}

public static fromProto(proto: Params.Proto): Params {
Expand Down
6 changes: 2 additions & 4 deletions src/core/ibc/applications/nft-transfer/NftClassTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ export class NftClassTrace extends JSONSerializable<

public toAmino(): NftClassTrace.Amino {
const { path, base_class_id } = this
const res: NftClassTrace.Amino = {
return {
path,
base_class_id,
}
return res
}

public static fromData(data: NftClassTrace.Data): NftClassTrace {
Expand All @@ -38,11 +37,10 @@ export class NftClassTrace extends JSONSerializable<

public toData(): NftClassTrace.Data {
const { path, base_class_id } = this
const res: NftClassTrace.Data = {
return {
path,
base_class_id,
}
return res
}

public static fromProto(proto: NftClassTrace.Proto): NftClassTrace {
Expand Down
6 changes: 2 additions & 4 deletions src/core/ibc/applications/transfer/DenomTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ export class DenomTrace extends JSONSerializable<

public toAmino(): DenomTrace.Amino {
const { path, base_denom } = this
const res: DenomTrace.Amino = {
return {
path,
base_denom,
}
return res
}

public static fromData(data: DenomTrace.Data): DenomTrace {
Expand All @@ -50,11 +49,10 @@ export class DenomTrace extends JSONSerializable<

public toData(): DenomTrace.Data {
const { path, base_denom } = this
const res: DenomTrace.Data = {
return {
path,
base_denom,
}
return res
}

public static fromProto(proto: DenomTrace.Proto): DenomTrace {
Expand Down
Loading

0 comments on commit f5afe99

Please sign in to comment.