Skip to content

Commit

Permalink
Updated telescope and rebuilt protobufs to get Decimals back. (DA0-DA…
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso authored Oct 4, 2023
1 parent 64dc9af commit 1e9913a
Show file tree
Hide file tree
Showing 36 changed files with 216 additions and 455 deletions.
2 changes: 1 addition & 1 deletion packages/protobuf/codegen/binary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ts-nocheck
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@0.106.0
* This file and any referenced files were automatically generated by @cosmology/telescope@1.0.3
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or yarn proto command to regenerate this bundle.
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/protobuf/codegen/cosmos/base/v1beta1/coin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BinaryReader, BinaryWriter } from "../../../binary";
import { Decimal } from "@cosmjs/math";
/**
* Coin defines a token with a denomination and an amount.
*
Expand Down Expand Up @@ -165,7 +166,7 @@ export const DecCoin = {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
writer.uint32(18).string(Decimal.fromUserInput(message.amount, 18).atomics);
}
return writer;
},
Expand All @@ -180,7 +181,7 @@ export const DecCoin = {
message.denom = reader.string();
break;
case 2:
message.amount = reader.string();
message.amount = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { Decimal } from "@cosmjs/math";
/** Params defines the set of params for the distribution module. */
export interface Params {
communityTax: string;
Expand Down Expand Up @@ -479,13 +480,13 @@ export const Params = {
typeUrl: "/cosmos.distribution.v1beta1.Params",
encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.communityTax !== "") {
writer.uint32(10).string(message.communityTax);
writer.uint32(10).string(Decimal.fromUserInput(message.communityTax, 18).atomics);
}
if (message.baseProposerReward !== "") {
writer.uint32(18).string(message.baseProposerReward);
writer.uint32(18).string(Decimal.fromUserInput(message.baseProposerReward, 18).atomics);
}
if (message.bonusProposerReward !== "") {
writer.uint32(26).string(message.bonusProposerReward);
writer.uint32(26).string(Decimal.fromUserInput(message.bonusProposerReward, 18).atomics);
}
if (message.withdrawAddrEnabled === true) {
writer.uint32(32).bool(message.withdrawAddrEnabled);
Expand All @@ -500,13 +501,13 @@ export const Params = {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.communityTax = reader.string();
message.communityTax = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 2:
message.baseProposerReward = reader.string();
message.baseProposerReward = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 3:
message.bonusProposerReward = reader.string();
message.bonusProposerReward = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 4:
message.withdrawAddrEnabled = reader.bool();
Expand Down Expand Up @@ -881,7 +882,7 @@ export const ValidatorSlashEvent = {
writer.uint32(8).uint64(message.validatorPeriod);
}
if (message.fraction !== "") {
writer.uint32(18).string(message.fraction);
writer.uint32(18).string(Decimal.fromUserInput(message.fraction, 18).atomics);
}
return writer;
},
Expand All @@ -896,7 +897,7 @@ export const ValidatorSlashEvent = {
message.validatorPeriod = reader.uint64();
break;
case 2:
message.fraction = reader.string();
message.fraction = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down Expand Up @@ -1203,7 +1204,7 @@ export const DelegatorStartingInfo = {
writer.uint32(8).uint64(message.previousPeriod);
}
if (message.stake !== "") {
writer.uint32(18).string(message.stake);
writer.uint32(18).string(Decimal.fromUserInput(message.stake, 18).atomics);
}
if (message.height !== BigInt(0)) {
writer.uint32(24).uint64(message.height);
Expand All @@ -1221,7 +1222,7 @@ export const DelegatorStartingInfo = {
message.previousPeriod = reader.uint64();
break;
case 2:
message.stake = reader.string();
message.stake = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 3:
message.height = reader.uint64();
Expand Down
5 changes: 3 additions & 2 deletions packages/protobuf/codegen/cosmos/gov/v1beta1/gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { SetProtoRevEnabledProposal, SetProtoRevEnabledProposalProtoMsg, SetProt
import { SetSuperfluidAssetsProposal, SetSuperfluidAssetsProposalProtoMsg, SetSuperfluidAssetsProposalSDKType, RemoveSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposalProtoMsg, RemoveSuperfluidAssetsProposalSDKType, UpdateUnpoolWhiteListProposal, UpdateUnpoolWhiteListProposalProtoMsg, UpdateUnpoolWhiteListProposalSDKType } from "../../../osmosis/superfluid/v1beta1/gov";
import { UpdateFeeTokenProposal, UpdateFeeTokenProposalProtoMsg, UpdateFeeTokenProposalSDKType } from "../../../osmosis/txfees/v1beta1/gov";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { Decimal } from "@cosmjs/math";
import { isSet, toTimestamp, fromTimestamp } from "../../../helpers";
/** VoteOption enumerates the valid vote options for a given governance proposal. */
export enum VoteOption {
Expand Down Expand Up @@ -554,7 +555,7 @@ export const WeightedVoteOption = {
writer.uint32(8).int32(message.option);
}
if (message.weight !== "") {
writer.uint32(18).string(message.weight);
writer.uint32(18).string(Decimal.fromUserInput(message.weight, 18).atomics);
}
return writer;
},
Expand All @@ -569,7 +570,7 @@ export const WeightedVoteOption = {
message.option = (reader.int32() as any);
break;
case 2:
message.weight = reader.string();
message.weight = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down
25 changes: 13 additions & 12 deletions packages/protobuf/codegen/cosmos/mint/v1beta1/mint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BinaryReader, BinaryWriter } from "../../../binary";
import { Decimal } from "@cosmjs/math";
/** Minter represents the minting state. */
export interface Minter {
/** current annual inflation rate */
Expand Down Expand Up @@ -83,10 +84,10 @@ export const Minter = {
typeUrl: "/cosmos.mint.v1beta1.Minter",
encode(message: Minter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.inflation !== "") {
writer.uint32(10).string(message.inflation);
writer.uint32(10).string(Decimal.fromUserInput(message.inflation, 18).atomics);
}
if (message.annualProvisions !== "") {
writer.uint32(18).string(message.annualProvisions);
writer.uint32(18).string(Decimal.fromUserInput(message.annualProvisions, 18).atomics);
}
return writer;
},
Expand All @@ -98,10 +99,10 @@ export const Minter = {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.inflation = reader.string();
message.inflation = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 2:
message.annualProvisions = reader.string();
message.annualProvisions = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down Expand Up @@ -167,16 +168,16 @@ export const Params = {
writer.uint32(10).string(message.mintDenom);
}
if (message.inflationRateChange !== "") {
writer.uint32(18).string(message.inflationRateChange);
writer.uint32(18).string(Decimal.fromUserInput(message.inflationRateChange, 18).atomics);
}
if (message.inflationMax !== "") {
writer.uint32(26).string(message.inflationMax);
writer.uint32(26).string(Decimal.fromUserInput(message.inflationMax, 18).atomics);
}
if (message.inflationMin !== "") {
writer.uint32(34).string(message.inflationMin);
writer.uint32(34).string(Decimal.fromUserInput(message.inflationMin, 18).atomics);
}
if (message.goalBonded !== "") {
writer.uint32(42).string(message.goalBonded);
writer.uint32(42).string(Decimal.fromUserInput(message.goalBonded, 18).atomics);
}
if (message.blocksPerYear !== BigInt(0)) {
writer.uint32(48).uint64(message.blocksPerYear);
Expand All @@ -194,16 +195,16 @@ export const Params = {
message.mintDenom = reader.string();
break;
case 2:
message.inflationRateChange = reader.string();
message.inflationRateChange = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 3:
message.inflationMax = reader.string();
message.inflationMax = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 4:
message.inflationMin = reader.string();
message.inflationMin = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 5:
message.goalBonded = reader.string();
message.goalBonded = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 6:
message.blocksPerYear = reader.uint64();
Expand Down
29 changes: 15 additions & 14 deletions packages/protobuf/codegen/cosmos/staking/v1beta1/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Duration, DurationAmino, DurationSDKType } from "../../../google/protob
import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin";
import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType } from "../../../tendermint/abci/types";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { Decimal } from "@cosmjs/math";
import { toTimestamp, fromTimestamp, isSet } from "../../../helpers";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
/** BondStatus is the status of a validator. */
Expand Down Expand Up @@ -1029,13 +1030,13 @@ export const CommissionRates = {
typeUrl: "/cosmos.staking.v1beta1.CommissionRates",
encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.rate !== "") {
writer.uint32(10).string(message.rate);
writer.uint32(10).string(Decimal.fromUserInput(message.rate, 18).atomics);
}
if (message.maxRate !== "") {
writer.uint32(18).string(message.maxRate);
writer.uint32(18).string(Decimal.fromUserInput(message.maxRate, 18).atomics);
}
if (message.maxChangeRate !== "") {
writer.uint32(26).string(message.maxChangeRate);
writer.uint32(26).string(Decimal.fromUserInput(message.maxChangeRate, 18).atomics);
}
return writer;
},
Expand All @@ -1047,13 +1048,13 @@ export const CommissionRates = {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.rate = reader.string();
message.rate = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 2:
message.maxRate = reader.string();
message.maxRate = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 3:
message.maxChangeRate = reader.string();
message.maxChangeRate = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down Expand Up @@ -1325,7 +1326,7 @@ export const Validator = {
writer.uint32(42).string(message.tokens);
}
if (message.delegatorShares !== "") {
writer.uint32(50).string(message.delegatorShares);
writer.uint32(50).string(Decimal.fromUserInput(message.delegatorShares, 18).atomics);
}
if (message.description !== undefined) {
Description.encode(message.description, writer.uint32(58).fork()).ldelim();
Expand Down Expand Up @@ -1375,7 +1376,7 @@ export const Validator = {
message.tokens = reader.string();
break;
case 6:
message.delegatorShares = reader.string();
message.delegatorShares = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 7:
message.description = Description.decode(reader, reader.uint32());
Expand Down Expand Up @@ -1883,7 +1884,7 @@ export const Delegation = {
writer.uint32(18).string(message.validatorAddress);
}
if (message.shares !== "") {
writer.uint32(26).string(message.shares);
writer.uint32(26).string(Decimal.fromUserInput(message.shares, 18).atomics);
}
return writer;
},
Expand All @@ -1901,7 +1902,7 @@ export const Delegation = {
message.validatorAddress = reader.string();
break;
case 3:
message.shares = reader.string();
message.shares = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down Expand Up @@ -2184,7 +2185,7 @@ export const RedelegationEntry = {
writer.uint32(26).string(message.initialBalance);
}
if (message.sharesDst !== "") {
writer.uint32(34).string(message.sharesDst);
writer.uint32(34).string(Decimal.fromUserInput(message.sharesDst, 18).atomics);
}
if (message.unbondingId !== BigInt(0)) {
writer.uint32(40).uint64(message.unbondingId);
Expand All @@ -2211,7 +2212,7 @@ export const RedelegationEntry = {
message.initialBalance = reader.string();
break;
case 4:
message.sharesDst = reader.string();
message.sharesDst = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 5:
message.unbondingId = reader.uint64();
Expand Down Expand Up @@ -2408,7 +2409,7 @@ export const Params = {
writer.uint32(42).string(message.bondDenom);
}
if (message.minCommissionRate !== "") {
writer.uint32(50).string(message.minCommissionRate);
writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics);
}
return writer;
},
Expand All @@ -2435,7 +2436,7 @@ export const Params = {
message.bondDenom = reader.string();
break;
case 6:
message.minCommissionRate = reader.string();
message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString();
break;
default:
reader.skipType(tag & 7);
Expand Down
5 changes: 3 additions & 2 deletions packages/protobuf/codegen/cosmos/staking/v1beta1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin";
import { Timestamp } from "../../../google/protobuf/timestamp";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
import { Decimal } from "@cosmjs/math";
import { toTimestamp, fromTimestamp } from "../../../helpers";
/** MsgCreateValidator defines a SDK message for creating a new validator. */
export interface MsgCreateValidator {
Expand Down Expand Up @@ -651,7 +652,7 @@ export const MsgEditValidator = {
writer.uint32(18).string(message.validatorAddress);
}
if (message.commissionRate !== "") {
writer.uint32(26).string(message.commissionRate);
writer.uint32(26).string(Decimal.fromUserInput(message.commissionRate, 18).atomics);
}
if (message.minSelfDelegation !== "") {
writer.uint32(34).string(message.minSelfDelegation);
Expand All @@ -672,7 +673,7 @@ export const MsgEditValidator = {
message.validatorAddress = reader.string();
break;
case 3:
message.commissionRate = reader.string();
message.commissionRate = Decimal.fromAtomics(reader.string(), 18).toString();
break;
case 4:
message.minSelfDelegation = reader.string();
Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/codegen/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@0.106.0
* This file and any referenced files were automatically generated by @cosmology/telescope@1.0.3
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or yarn proto command to regenerate this bundle.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/codegen/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@0.106.0
* This file and any referenced files were automatically generated by @cosmology/telescope@1.0.3
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or yarn proto command to regenerate this bundle.
*/
Expand Down
Loading

0 comments on commit 1e9913a

Please sign in to comment.