Skip to content

Commit

Permalink
Updated fixtures and snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Nov 3, 2023
1 parent 0e0dc5d commit 2bd802f
Show file tree
Hide file tree
Showing 136 changed files with 400 additions and 400 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const Equivocation = {
fromAmino(object: EquivocationAmino): Equivocation {
return {
height: BigInt(object.height),
time: fromTimestamp(Timestamp.fromAmino(object.time)),
time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined,
power: BigInt(object.power),
consensusAddress: object.consensus_address
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export const PeriodicAllowance = {
period: object?.period ? Duration.fromAmino(object.period) : undefined,
periodSpendLimit: Array.isArray(object?.period_spend_limit) ? object.period_spend_limit.map((e: any) => Coin.fromAmino(e)) : [],
periodCanSpend: Array.isArray(object?.period_can_spend) ? object.period_can_spend.map((e: any) => Coin.fromAmino(e)) : [],
periodReset: fromTimestamp(Timestamp.fromAmino(object.period_reset))
periodReset: object?.period_reset ? fromTimestamp(Timestamp.fromAmino(object.period_reset)) : undefined
};
},
toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino {
Expand Down
8 changes: 4 additions & 4 deletions __fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,11 @@ export const Proposal = {
content: object?.content ? Any.fromAmino(object.content) : undefined,
status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1,
finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined,
submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)),
depositEndTime: fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)),
submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined,
depositEndTime: object?.deposit_end_time ? fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)) : undefined,
totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [],
votingStartTime: fromTimestamp(Timestamp.fromAmino(object.voting_start_time)),
votingEndTime: fromTimestamp(Timestamp.fromAmino(object.voting_end_time))
votingStartTime: object?.voting_start_time ? fromTimestamp(Timestamp.fromAmino(object.voting_start_time)) : undefined,
votingEndTime: object?.voting_end_time ? fromTimestamp(Timestamp.fromAmino(object.voting_end_time)) : undefined
};
},
toAmino(message: Proposal): ProposalAmino {
Expand Down
12 changes: 6 additions & 6 deletions __fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export const Member = {
address: object.address,
weight: object.weight,
metadata: object.metadata,
addedAt: fromTimestamp(Timestamp.fromAmino(object.added_at))
addedAt: object?.added_at ? fromTimestamp(Timestamp.fromAmino(object.added_at)) : undefined
};
},
toAmino(message: Member): MemberAmino {
Expand Down Expand Up @@ -1220,7 +1220,7 @@ export const GroupInfo = {
metadata: object.metadata,
version: BigInt(object.version),
totalWeight: object.total_weight,
createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at))
createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined
};
},
toAmino(message: GroupInfo): GroupInfoAmino {
Expand Down Expand Up @@ -1508,7 +1508,7 @@ export const GroupPolicyInfo = {
metadata: object.metadata,
version: BigInt(object.version),
decisionPolicy: object?.decision_policy ? Any.fromAmino(object.decision_policy) : undefined,
createdAt: fromTimestamp(Timestamp.fromAmino(object.created_at))
createdAt: object?.created_at ? fromTimestamp(Timestamp.fromAmino(object.created_at)) : undefined
};
},
toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino {
Expand Down Expand Up @@ -1782,13 +1782,13 @@ export const Proposal = {
address: object.address,
metadata: object.metadata,
proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [],
submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time)),
submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined,
groupVersion: BigInt(object.group_version),
groupPolicyVersion: BigInt(object.group_policy_version),
status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1,
result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1,
finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined,
votingPeriodEnd: fromTimestamp(Timestamp.fromAmino(object.voting_period_end)),
votingPeriodEnd: object?.voting_period_end ? fromTimestamp(Timestamp.fromAmino(object.voting_period_end)) : undefined,
executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1,
messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : []
};
Expand Down Expand Up @@ -2095,7 +2095,7 @@ export const Vote = {
voter: object.voter,
option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1,
metadata: object.metadata,
submitTime: fromTimestamp(Timestamp.fromAmino(object.submit_time))
submitTime: object?.submit_time ? fromTimestamp(Timestamp.fromAmino(object.submit_time)) : undefined
};
},
toAmino(message: Vote): VoteAmino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const ValidatorSigningInfo = {
address: object.address,
startHeight: BigInt(object.start_height),
indexOffset: BigInt(object.index_offset),
jailedUntil: fromTimestamp(Timestamp.fromAmino(object.jailed_until)),
jailedUntil: object?.jailed_until ? fromTimestamp(Timestamp.fromAmino(object.jailed_until)) : undefined,
tombstoned: object.tombstoned,
missedBlocksCounter: BigInt(object.missed_blocks_counter)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ export const Commission = {
fromAmino(object: CommissionAmino): Commission {
return {
commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined,
updateTime: fromTimestamp(Timestamp.fromAmino(object.update_time))
updateTime: object?.update_time ? fromTimestamp(Timestamp.fromAmino(object.update_time)) : undefined
};
},
toAmino(message: Commission): CommissionAmino {
Expand Down Expand Up @@ -1227,7 +1227,7 @@ export const Validator = {
delegatorShares: object.delegator_shares,
description: object?.description ? Description.fromAmino(object.description) : undefined,
unbondingHeight: BigInt(object.unbonding_height),
unbondingTime: fromTimestamp(Timestamp.fromAmino(object.unbonding_time)),
unbondingTime: object?.unbonding_time ? fromTimestamp(Timestamp.fromAmino(object.unbonding_time)) : undefined,
commission: object?.commission ? Commission.fromAmino(object.commission) : undefined,
minSelfDelegation: object.min_self_delegation
};
Expand Down Expand Up @@ -2168,7 +2168,7 @@ export const UnbondingDelegationEntry = {
fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry {
return {
creationHeight: BigInt(object.creation_height),
completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)),
completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined,
initialBalance: object.initial_balance,
balance: object.balance
};
Expand Down Expand Up @@ -2305,7 +2305,7 @@ export const RedelegationEntry = {
fromAmino(object: RedelegationEntryAmino): RedelegationEntry {
return {
creationHeight: BigInt(object.creation_height),
completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time)),
completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined,
initialBalance: object.initial_balance,
sharesDst: object.shares_dst
};
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ export const MsgBeginRedelegateResponse = {
},
fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse {
return {
completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time))
completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined
};
},
toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino {
Expand Down Expand Up @@ -1241,7 +1241,7 @@ export const MsgUndelegateResponse = {
},
fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse {
return {
completionTime: fromTimestamp(Timestamp.fromAmino(object.completion_time))
completionTime: object?.completion_time ? fromTimestamp(Timestamp.fromAmino(object.completion_time)) : undefined
};
},
toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export const Plan = {
fromAmino(object: PlanAmino): Plan {
return {
name: object.name,
time: fromTimestamp(Timestamp.fromAmino(object.time)),
time: object?.time ? fromTimestamp(Timestamp.fromAmino(object.time)) : undefined,
height: BigInt(object.height),
info: object.info,
upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export const Params = {
fromAmino(object: ParamsAmino): Params {
return {
enableClaims: object.enable_claims,
airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)),
airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined,
durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined,
durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined,
claimsDenom: object.claims_denom,
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/v-next/outputosmojs/evmos/epochs/v1/genesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ export const EpochInfo = {
fromAmino(object: EpochInfoAmino): EpochInfo {
return {
identifier: object.identifier,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
duration: object?.duration ? Duration.fromAmino(object.duration) : undefined,
currentEpoch: BigInt(object.current_epoch),
currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)),
currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined,
epochCountingStarted: object.epoch_counting_started,
currentEpochStartHeight: BigInt(object.current_epoch_start_height)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const Incentive = {
contract: object.contract,
allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [],
epochs: object.epochs,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
totalGas: BigInt(object.total_gas)
};
},
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputosmojs/evmos/vesting/v1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const MsgCreateClawbackVestingAccount = {
return {
fromAddress: object.from_address,
toAddress: object.to_address,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [],
vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : [],
merge: object.merge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const ClawbackVestingAccount = {
return {
baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined,
funderAddress: object.funder_address,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
lockupPeriods: Array.isArray(object?.lockup_periods) ? object.lockup_periods.map((e: any) => Period.fromAmino(e)) : [],
vestingPeriods: Array.isArray(object?.vesting_periods) ? object.vesting_periods.map((e: any) => Period.fromAmino(e)) : []
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export const ConsensusState = {
},
fromAmino(object: ConsensusStateAmino): ConsensusState {
return {
timestamp: fromTimestamp(Timestamp.fromAmino(object.timestamp)),
timestamp: object?.timestamp ? fromTimestamp(Timestamp.fromAmino(object.timestamp)) : undefined,
root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined,
nextValidatorsHash: object.next_validators_hash
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const Params = {
},
fromAmino(object: ParamsAmino): Params {
return {
airdropStartTime: fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)),
airdropStartTime: object?.airdrop_start_time ? fromTimestamp(Timestamp.fromAmino(object.airdrop_start_time)) : undefined,
durationUntilDecay: object?.duration_until_decay ? Duration.fromAmino(object.duration_until_decay) : undefined,
durationOfDecay: object?.duration_of_decay ? Duration.fromAmino(object.duration_of_decay) : undefined,
claimDenom: object.claim_denom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export const IncentiveRecordBody = {
return {
remainingAmount: object.remaining_amount,
emissionRate: object.emission_rate,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time))
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined
};
},
toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const Pool = {
tickSpacing: BigInt(object.tick_spacing),
exponentAtPriceOne: object.exponent_at_price_one,
swapFee: object.swap_fee,
lastLiquidityUpdate: fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update))
lastLiquidityUpdate: object?.last_liquidity_update ? fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)) : undefined
};
},
toAmino(message: Pool): PoolAmino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const Position = {
poolId: BigInt(object.pool_id),
lowerTick: BigInt(object.lower_tick),
upperTick: BigInt(object.upper_tick),
joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)),
joinTime: object?.join_time ? fromTimestamp(Timestamp.fromAmino(object.join_time)) : undefined,
liquidity: object.liquidity
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export const MsgCreatePositionResponse = {
positionId: BigInt(object.position_id),
amount0: object.amount0,
amount1: object.amount1,
joinTime: fromTimestamp(Timestamp.fromAmino(object.join_time)),
joinTime: object?.join_time ? fromTimestamp(Timestamp.fromAmino(object.join_time)) : undefined,
liquidityCreated: object.liquidity_created
};
},
Expand Down Expand Up @@ -1378,7 +1378,7 @@ export const MsgCreateIncentive = {
incentiveDenom: object.incentive_denom,
incentiveAmount: object.incentive_amount,
emissionRate: object.emission_rate,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined
};
},
Expand Down Expand Up @@ -1532,7 +1532,7 @@ export const MsgCreateIncentiveResponse = {
incentiveDenom: object.incentive_denom,
incentiveAmount: object.incentive_amount,
emissionRate: object.emission_rate,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const GenesisDowntimeEntry = {
fromAmino(object: GenesisDowntimeEntryAmino): GenesisDowntimeEntry {
return {
duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1,
lastDowntime: fromTimestamp(Timestamp.fromAmino(object.last_downtime))
lastDowntime: object?.last_downtime ? fromTimestamp(Timestamp.fromAmino(object.last_downtime)) : undefined
};
},
toAmino(message: GenesisDowntimeEntry): GenesisDowntimeEntryAmino {
Expand Down Expand Up @@ -220,7 +220,7 @@ export const GenesisState = {
fromAmino(object: GenesisStateAmino): GenesisState {
return {
downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromAmino(e)) : [],
lastBlockTime: fromTimestamp(Timestamp.fromAmino(object.last_block_time))
lastBlockTime: object?.last_block_time ? fromTimestamp(Timestamp.fromAmino(object.last_block_time)) : undefined
};
},
toAmino(message: GenesisState): GenesisStateAmino {
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/v-next/outputosmojs/osmosis/epochs/genesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ export const EpochInfo = {
fromAmino(object: EpochInfoAmino): EpochInfo {
return {
identifier: object.identifier,
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
duration: object?.duration ? Duration.fromAmino(object.duration) : undefined,
currentEpoch: BigInt(object.current_epoch),
currentEpochStartTime: fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)),
currentEpochStartTime: object?.current_epoch_start_time ? fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)) : undefined,
epochCountingStarted: object.epoch_counting_started,
currentEpochStartHeight: BigInt(object.current_epoch_start_height)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const SmoothWeightChangeParams = {
},
fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams {
return {
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
duration: object?.duration ? Duration.fromAmino(object.duration) : undefined,
initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [],
targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const Gauge = {
isPerpetual: object.is_perpetual,
distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined,
coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [],
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
numEpochsPaidOver: BigInt(object.num_epochs_paid_over),
filledEpochs: BigInt(object.filled_epochs),
distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : []
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputosmojs/osmosis/incentives/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const MsgCreateGauge = {
owner: object.owner,
distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined,
coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [],
startTime: fromTimestamp(Timestamp.fromAmino(object.start_time)),
startTime: object?.start_time ? fromTimestamp(Timestamp.fromAmino(object.start_time)) : undefined,
numEpochsPaidOver: BigInt(object.num_epochs_paid_over)
};
},
Expand Down
Loading

0 comments on commit 2bd802f

Please sign in to comment.