From 8ee82a33c770ad60ec3203257682a4af0550144f Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Tue, 27 Jun 2023 23:06:47 +0800 Subject: [PATCH 1/3] fix compile errors and regen code --- .../akash/base/v1beta1/endpoint.ts | 6 +- .../akash/base/v1beta2/endpoint.ts | 6 +- .../outputosmojs/akash/cert/v1beta2/cert.ts | 6 +- .../akash/deployment/v1beta1/deployment.ts | 6 +- .../akash/deployment/v1beta1/group.ts | 6 +- .../akash/deployment/v1beta2/deployment.ts | 6 +- .../akash/deployment/v1beta2/group.ts | 6 +- .../akash/escrow/v1beta1/types.ts | 12 +- .../akash/escrow/v1beta2/types.ts | 12 +- .../outputosmojs/akash/market/v1beta2/bid.ts | 6 +- .../akash/market/v1beta2/lease.ts | 6 +- .../akash/market/v1beta2/order.ts | 6 +- __fixtures__/v-next/outputosmojs/binary.ts | 4 +- .../v-next/outputosmojs/confio/proofs.ts | 36 ++-- .../v-next/outputosmojs/cosmos/gov/v1/gov.ts | 12 +- .../outputosmojs/cosmos/gov/v1/query.ts | 6 +- .../v-next/outputosmojs/cosmos/gov/v1/tx.ts | 6 +- .../outputosmojs/cosmos/gov/v1beta1/gov.ts | 18 +- .../outputosmojs/cosmos/gov/v1beta1/query.ts | 6 +- .../outputosmojs/cosmos/gov/v1beta1/tx.ts | 6 +- .../outputosmojs/cosmos/group/v1/events.ts | 6 +- .../v-next/outputosmojs/cosmos/group/v1/tx.ts | 18 +- .../outputosmojs/cosmos/group/v1/types.ts | 24 +-- .../outputosmojs/cosmos/ics23/v1/proofs.ts | 36 ++-- .../cosmos/orm/v1alpha1/schema.ts | 6 +- .../cosmos/staking/v1beta1/authz.ts | 6 +- .../cosmos/staking/v1beta1/staking.ts | 6 +- .../cosmos/tx/signing/v1beta1/signing.ts | 6 +- .../outputosmojs/cosmos/tx/v1beta1/service.ts | 12 +- .../outputosmojs/cosmos/tx/v1beta1/tx.ts | 12 +- .../outputosmojs/cosmwasm/wasm/v1/types.ts | 24 +-- .../outputosmojs/evmos/claims/v1/claims.ts | 6 +- .../outputosmojs/evmos/erc20/v1/erc20.ts | 6 +- .../v-next/outputosmojs/google/api/backend.ts | 6 +- .../outputosmojs/google/api/config_change.ts | 6 +- .../outputosmojs/google/api/consumer.ts | 6 +- .../v1alpha1/conformance_service.ts | 6 +- .../v-next/outputosmojs/google/api/label.ts | 6 +- .../v-next/outputosmojs/google/api/metric.ts | 24 +-- .../google/api/monitored_resource.ts | 6 +- .../outputosmojs/google/api/resource.ts | 6 +- .../api/servicecontrol/v1/check_error.ts | 6 +- .../google/api/servicecontrol/v1/log_entry.ts | 6 +- .../google/api/servicecontrol/v1/operation.ts | 6 +- .../api/servicecontrol/v1/quota_controller.ts | 12 +- .../servicecontrol/v1/service_controller.ts | 6 +- .../api/servicemanagement/v1/resources.ts | 24 +-- .../servicemanagement/v1/servicemanager.ts | 6 +- .../google/api/serviceusage/v1/resources.ts | 6 +- .../api/serviceusage/v1/serviceusage.ts | 6 +- .../api/serviceusage/v1beta1/resources.ts | 6 +- .../api/serviceusage/v1beta1/serviceusage.ts | 24 +-- .../google/logging/v2/log_entry.ts | 6 +- .../outputosmojs/google/logging/v2/logging.ts | 6 +- .../google/logging/v2/logging_config.ts | 18 +- .../google/logging/v2/logging_metrics.ts | 6 +- .../outputosmojs/google/protobuf/api.ts | 12 +- .../google/protobuf/descriptor.ts | 36 ++-- .../outputosmojs/google/protobuf/type.ts | 24 +-- .../interchain_accounts/v1/packet.ts | 6 +- .../ibc/applications/transfer/v1/tx.amino.ts | 4 +- .../ibc/core/channel/v1/channel.ts | 24 +-- .../ibc/core/channel/v1/tx.amino.ts | 48 ++--- .../ibc/core/connection/v1/connection.ts | 12 +- .../ibc/core/connection/v1/tx.amino.ts | 20 +- .../outputosmojs/ibc/core/port/v1/query.ts | 6 +- .../solomachine/v1/solomachine.ts | 12 +- .../solomachine/v2/solomachine.ts | 12 +- .../osmosis/claim/v1beta1/query.ts | 6 +- .../downtime-detector/v1beta1/genesis.ts | 6 +- .../downtime-detector/v1beta1/query.ts | 6 +- .../outputosmojs/osmosis/lockup/lock.ts | 6 +- .../poolmanager/v1beta1/module_route.ts | 6 +- .../outputosmojs/osmosis/superfluid/query.ts | 6 +- .../osmosis/superfluid/superfluid.ts | 6 +- .../outputosmojs/tendermint/abci/types.ts | 24 +-- .../outputosmojs/tendermint/types/types.ts | 18 +- .../outputv2/akash/base/v1beta1/endpoint.ts | 6 +- .../outputv2/akash/base/v1beta2/endpoint.ts | 6 +- .../outputv2/akash/cert/v1beta2/cert.ts | 6 +- .../akash/deployment/v1beta1/deployment.ts | 6 +- .../akash/deployment/v1beta1/group.ts | 6 +- .../akash/deployment/v1beta2/deployment.ts | 6 +- .../akash/deployment/v1beta2/group.ts | 6 +- .../outputv2/akash/escrow/v1beta1/types.ts | 12 +- .../outputv2/akash/escrow/v1beta2/types.ts | 12 +- .../outputv2/akash/market/v1beta2/bid.ts | 6 +- .../outputv2/akash/market/v1beta2/lease.ts | 6 +- .../outputv2/akash/market/v1beta2/order.ts | 6 +- __fixtures__/v-next/outputv2/confio/proofs.ts | 36 ++-- .../outputv2/cosmos/authz/v1beta1/authz.ts | 8 +- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 +- .../v-next/outputv2/cosmos/gov/v1/gov.ts | 28 +-- .../v-next/outputv2/cosmos/gov/v1/query.ts | 6 +- .../v-next/outputv2/cosmos/gov/v1/tx.ts | 6 +- .../v-next/outputv2/cosmos/gov/v1beta1/gov.ts | 34 ++-- .../outputv2/cosmos/gov/v1beta1/query.ts | 6 +- .../v-next/outputv2/cosmos/gov/v1beta1/tx.ts | 6 +- .../v-next/outputv2/cosmos/group/v1/events.ts | 6 +- .../v-next/outputv2/cosmos/group/v1/tx.ts | 18 +- .../v-next/outputv2/cosmos/group/v1/types.ts | 48 ++--- .../outputv2/cosmos/orm/v1alpha1/schema.ts | 6 +- .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../outputv2/cosmos/staking/v1beta1/authz.ts | 6 +- .../cosmos/staking/v1beta1/staking.ts | 22 +-- .../outputv2/cosmos/staking/v1beta1/tx.ts | 8 +- .../cosmos/tx/signing/v1beta1/signing.ts | 6 +- .../outputv2/cosmos/tx/v1beta1/service.ts | 12 +- .../v-next/outputv2/cosmos/tx/v1beta1/tx.ts | 12 +- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../v-next/outputv2/cosmwasm/wasm/v1/types.ts | 24 +-- .../v-next/outputv2/evmos/claims/v1/claims.ts | 6 +- .../outputv2/evmos/claims/v1/genesis.ts | 4 +- .../outputv2/evmos/epochs/v1/genesis.ts | 8 +- .../v-next/outputv2/evmos/erc20/v1/erc20.ts | 6 +- .../evmos/incentives/v1/incentives.ts | 4 +- .../v-next/outputv2/evmos/vesting/v1/tx.ts | 4 +- .../outputv2/evmos/vesting/v1/vesting.ts | 4 +- .../v-next/outputv2/google/api/backend.ts | 6 +- .../outputv2/google/api/config_change.ts | 6 +- .../v-next/outputv2/google/api/consumer.ts | 6 +- .../outputv2/google/api/distribution.ts | 4 +- .../v1alpha1/conformance_service.ts | 6 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../v-next/outputv2/google/api/label.ts | 6 +- .../v-next/outputv2/google/api/metric.ts | 24 +-- .../outputv2/google/api/monitored_resource.ts | 6 +- .../v-next/outputv2/google/api/resource.ts | 6 +- .../api/servicecontrol/v1/check_error.ts | 6 +- .../google/api/servicecontrol/v1/log_entry.ts | 10 +- .../api/servicecontrol/v1/metric_value.ts | 8 +- .../google/api/servicecontrol/v1/operation.ts | 14 +- .../api/servicecontrol/v1/quota_controller.ts | 12 +- .../servicecontrol/v1/service_controller.ts | 6 +- .../api/servicemanagement/v1/resources.ts | 32 ++-- .../servicemanagement/v1/servicemanager.ts | 6 +- .../google/api/serviceusage/v1/resources.ts | 6 +- .../api/serviceusage/v1/serviceusage.ts | 6 +- .../api/serviceusage/v1beta1/resources.ts | 6 +- .../api/serviceusage/v1beta1/serviceusage.ts | 24 +-- .../outputv2/google/logging/v2/log_entry.ts | 14 +- .../outputv2/google/logging/v2/logging.ts | 6 +- .../google/logging/v2/logging_config.ts | 58 +++--- .../google/logging/v2/logging_metrics.ts | 14 +- .../v-next/outputv2/google/protobuf/api.ts | 12 +- .../outputv2/google/protobuf/descriptor.ts | 36 ++-- .../outputv2/google/protobuf/timestamp.ts | 12 +- .../v-next/outputv2/google/protobuf/type.ts | 24 +-- .../google/rpc/context/attribute_context.ts | 20 +- .../outputv2/ibc/core/channel/v1/channel.ts | 24 +-- .../ibc/core/connection/v1/connection.ts | 12 +- .../v-next/outputv2/ibc/core/port/v1/query.ts | 6 +- .../solomachine/v1/solomachine.ts | 12 +- .../solomachine/v2/solomachine.ts | 12 +- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../outputv2/osmosis/claim/v1beta1/params.ts | 4 +- .../outputv2/osmosis/claim/v1beta1/query.ts | 6 +- .../v-next/outputv2/osmosis/epochs/genesis.ts | 8 +- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../outputv2/osmosis/incentives/gauge.ts | 4 +- .../v-next/outputv2/osmosis/incentives/tx.ts | 4 +- .../v-next/outputv2/osmosis/lockup/lock.ts | 18 +- .../v-next/outputv2/osmosis/lockup/query.ts | 16 +- .../outputv2/osmosis/superfluid/query.ts | 6 +- .../outputv2/osmosis/superfluid/superfluid.ts | 6 +- .../outputv2/osmosis/twap/v1beta1/query.ts | 12 +- .../osmosis/twap/v1beta1/twap_record.ts | 8 +- .../v-next/outputv2/tendermint/abci/types.ts | 32 ++-- .../v-next/outputv2/tendermint/p2p/types.ts | 12 +- .../outputv2/tendermint/types/evidence.ts | 8 +- .../v-next/outputv2/tendermint/types/types.ts | 34 ++-- .../outputv3/akash/base/v1beta1/endpoint.ts | 6 +- .../outputv3/akash/base/v1beta2/endpoint.ts | 6 +- .../outputv3/akash/cert/v1beta2/cert.ts | 6 +- .../akash/deployment/v1beta1/deployment.ts | 6 +- .../akash/deployment/v1beta1/group.ts | 6 +- .../akash/deployment/v1beta2/deployment.ts | 6 +- .../akash/deployment/v1beta2/group.ts | 6 +- .../outputv3/akash/escrow/v1beta1/types.ts | 12 +- .../outputv3/akash/escrow/v1beta2/types.ts | 12 +- .../outputv3/akash/market/v1beta2/bid.ts | 6 +- .../outputv3/akash/market/v1beta2/lease.ts | 6 +- .../outputv3/akash/market/v1beta2/order.ts | 6 +- __fixtures__/v-next/outputv3/confio/proofs.ts | 36 ++-- .../outputv3/cosmos/authz/v1beta1/authz.ts | 8 +- .../cosmos/evidence/v1beta1/evidence.ts | 4 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 8 +- .../v-next/outputv3/cosmos/gov/v1/gov.ts | 28 +-- .../v-next/outputv3/cosmos/gov/v1/query.ts | 6 +- .../v-next/outputv3/cosmos/gov/v1/tx.ts | 6 +- .../v-next/outputv3/cosmos/gov/v1beta1/gov.ts | 34 ++-- .../outputv3/cosmos/gov/v1beta1/query.ts | 6 +- .../v-next/outputv3/cosmos/gov/v1beta1/tx.ts | 6 +- .../v-next/outputv3/cosmos/group/v1/events.ts | 6 +- .../v-next/outputv3/cosmos/group/v1/tx.ts | 18 +- .../v-next/outputv3/cosmos/group/v1/types.ts | 48 ++--- .../outputv3/cosmos/orm/v1alpha1/schema.ts | 6 +- .../cosmos/slashing/v1beta1/slashing.ts | 4 +- .../outputv3/cosmos/staking/v1beta1/authz.ts | 6 +- .../cosmos/staking/v1beta1/staking.ts | 22 +-- .../outputv3/cosmos/staking/v1beta1/tx.ts | 8 +- .../cosmos/tx/signing/v1beta1/signing.ts | 6 +- .../outputv3/cosmos/tx/v1beta1/service.ts | 12 +- .../v-next/outputv3/cosmos/tx/v1beta1/tx.ts | 12 +- .../cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../v-next/outputv3/cosmwasm/wasm/v1/types.ts | 24 +-- .../v-next/outputv3/evmos/claims/v1/claims.ts | 6 +- .../outputv3/evmos/claims/v1/genesis.ts | 4 +- .../outputv3/evmos/epochs/v1/genesis.ts | 8 +- .../v-next/outputv3/evmos/erc20/v1/erc20.ts | 6 +- .../evmos/incentives/v1/incentives.ts | 4 +- .../v-next/outputv3/evmos/vesting/v1/tx.ts | 4 +- .../outputv3/evmos/vesting/v1/vesting.ts | 4 +- .../v-next/outputv3/google/api/backend.ts | 6 +- .../outputv3/google/api/config_change.ts | 6 +- .../v-next/outputv3/google/api/consumer.ts | 6 +- .../outputv3/google/api/distribution.ts | 4 +- .../v1alpha1/conformance_service.ts | 6 +- .../google/api/expr/v1alpha1/syntax.ts | 4 +- .../v-next/outputv3/google/api/label.ts | 6 +- .../v-next/outputv3/google/api/metric.ts | 24 +-- .../outputv3/google/api/monitored_resource.ts | 6 +- .../v-next/outputv3/google/api/resource.ts | 6 +- .../api/servicecontrol/v1/check_error.ts | 6 +- .../google/api/servicecontrol/v1/log_entry.ts | 10 +- .../api/servicecontrol/v1/metric_value.ts | 8 +- .../google/api/servicecontrol/v1/operation.ts | 14 +- .../api/servicecontrol/v1/quota_controller.ts | 12 +- .../servicecontrol/v1/service_controller.ts | 6 +- .../api/servicemanagement/v1/resources.ts | 32 ++-- .../servicemanagement/v1/servicemanager.ts | 6 +- .../google/api/serviceusage/v1/resources.ts | 6 +- .../api/serviceusage/v1/serviceusage.ts | 6 +- .../api/serviceusage/v1beta1/resources.ts | 6 +- .../api/serviceusage/v1beta1/serviceusage.ts | 24 +-- .../outputv3/google/logging/v2/log_entry.ts | 14 +- .../outputv3/google/logging/v2/logging.ts | 6 +- .../google/logging/v2/logging_config.ts | 58 +++--- .../google/logging/v2/logging_metrics.ts | 14 +- .../v-next/outputv3/google/protobuf/api.ts | 12 +- .../outputv3/google/protobuf/descriptor.ts | 36 ++-- .../outputv3/google/protobuf/timestamp.ts | 12 +- .../v-next/outputv3/google/protobuf/type.ts | 24 +-- .../google/rpc/context/attribute_context.ts | 20 +- .../outputv3/ibc/core/channel/v1/channel.ts | 24 +-- .../ibc/core/connection/v1/connection.ts | 12 +- .../v-next/outputv3/ibc/core/port/v1/query.ts | 6 +- .../solomachine/v1/solomachine.ts | 12 +- .../solomachine/v2/solomachine.ts | 12 +- .../lightclients/tendermint/v1/tendermint.ts | 4 +- .../outputv3/osmosis/claim/v1beta1/params.ts | 4 +- .../outputv3/osmosis/claim/v1beta1/query.ts | 6 +- .../v-next/outputv3/osmosis/epochs/genesis.ts | 8 +- .../gamm/pool-models/balancer/balancerPool.ts | 4 +- .../outputv3/osmosis/incentives/gauge.ts | 4 +- .../v-next/outputv3/osmosis/incentives/tx.ts | 4 +- .../v-next/outputv3/osmosis/lockup/lock.ts | 18 +- .../v-next/outputv3/osmosis/lockup/query.ts | 16 +- .../outputv3/osmosis/superfluid/query.ts | 6 +- .../outputv3/osmosis/superfluid/superfluid.ts | 6 +- .../outputv3/osmosis/twap/v1beta1/query.ts | 12 +- .../osmosis/twap/v1beta1/twap_record.ts | 8 +- .../v-next/outputv3/tendermint/abci/types.ts | 32 ++-- .../v-next/outputv3/tendermint/p2p/types.ts | 12 +- .../outputv3/tendermint/types/evidence.ts | 8 +- .../v-next/outputv3/tendermint/types/types.ts | 34 ++-- .../outputv4/akash/base/v1beta1/endpoint.ts | 6 +- .../outputv4/akash/base/v1beta2/endpoint.ts | 6 +- .../outputv4/akash/cert/v1beta2/cert.ts | 6 +- .../akash/deployment/v1beta1/deployment.ts | 6 +- .../akash/deployment/v1beta1/group.ts | 6 +- .../akash/deployment/v1beta2/deployment.ts | 6 +- .../akash/deployment/v1beta2/group.ts | 6 +- .../outputv4/akash/escrow/v1beta1/types.ts | 12 +- .../outputv4/akash/escrow/v1beta2/types.ts | 12 +- .../outputv4/akash/market/v1beta2/bid.ts | 6 +- .../outputv4/akash/market/v1beta2/lease.ts | 6 +- .../outputv4/akash/market/v1beta2/order.ts | 6 +- __fixtures__/v-next/outputv4/binary.ts | 4 +- __fixtures__/v-next/outputv4/confio/proofs.ts | 36 ++-- .../v-next/outputv4/cosmos/gov/v1/gov.ts | 12 +- .../v-next/outputv4/cosmos/gov/v1/query.ts | 6 +- .../v-next/outputv4/cosmos/gov/v1/tx.ts | 6 +- .../v-next/outputv4/cosmos/gov/v1beta1/gov.ts | 18 +- .../outputv4/cosmos/gov/v1beta1/query.ts | 6 +- .../v-next/outputv4/cosmos/gov/v1beta1/tx.ts | 6 +- .../v-next/outputv4/cosmos/group/v1/events.ts | 6 +- .../v-next/outputv4/cosmos/group/v1/tx.ts | 18 +- .../v-next/outputv4/cosmos/group/v1/types.ts | 24 +-- .../outputv4/cosmos/orm/v1alpha1/schema.ts | 6 +- .../outputv4/cosmos/staking/v1beta1/authz.ts | 6 +- .../cosmos/staking/v1beta1/staking.ts | 6 +- .../cosmos/tx/signing/v1beta1/signing.ts | 6 +- .../outputv4/cosmos/tx/v1beta1/service.ts | 12 +- .../v-next/outputv4/cosmos/tx/v1beta1/tx.ts | 12 +- .../v-next/outputv4/cosmwasm/wasm/v1/types.ts | 24 +-- .../v-next/outputv4/evmos/claims/v1/claims.ts | 6 +- .../v-next/outputv4/evmos/erc20/v1/erc20.ts | 6 +- .../v-next/outputv4/google/api/backend.ts | 6 +- .../outputv4/google/api/config_change.ts | 6 +- .../v-next/outputv4/google/api/consumer.ts | 6 +- .../v1alpha1/conformance_service.ts | 6 +- .../v-next/outputv4/google/api/label.ts | 6 +- .../v-next/outputv4/google/api/metric.ts | 24 +-- .../outputv4/google/api/monitored_resource.ts | 6 +- .../v-next/outputv4/google/api/resource.ts | 6 +- .../api/servicecontrol/v1/check_error.ts | 6 +- .../google/api/servicecontrol/v1/log_entry.ts | 6 +- .../google/api/servicecontrol/v1/operation.ts | 6 +- .../api/servicecontrol/v1/quota_controller.ts | 12 +- .../servicecontrol/v1/service_controller.ts | 6 +- .../api/servicemanagement/v1/resources.ts | 24 +-- .../servicemanagement/v1/servicemanager.ts | 6 +- .../google/api/serviceusage/v1/resources.ts | 6 +- .../api/serviceusage/v1/serviceusage.ts | 6 +- .../api/serviceusage/v1beta1/resources.ts | 6 +- .../api/serviceusage/v1beta1/serviceusage.ts | 24 +-- .../outputv4/google/logging/v2/log_entry.ts | 6 +- .../outputv4/google/logging/v2/logging.ts | 6 +- .../google/logging/v2/logging_config.ts | 18 +- .../google/logging/v2/logging_metrics.ts | 6 +- .../v-next/outputv4/google/protobuf/api.ts | 12 +- .../outputv4/google/protobuf/descriptor.ts | 36 ++-- .../v-next/outputv4/google/protobuf/type.ts | 24 +-- .../ibc/applications/transfer/v1/tx.amino.ts | 4 +- .../outputv4/ibc/core/channel/v1/channel.ts | 24 +-- .../outputv4/ibc/core/channel/v1/tx.amino.ts | 48 ++--- .../ibc/core/connection/v1/connection.ts | 12 +- .../ibc/core/connection/v1/tx.amino.ts | 20 +- .../v-next/outputv4/ibc/core/port/v1/query.ts | 6 +- .../solomachine/v1/solomachine.ts | 12 +- .../solomachine/v2/solomachine.ts | 12 +- .../outputv4/osmosis/claim/v1beta1/query.ts | 6 +- .../v-next/outputv4/osmosis/lockup/lock.ts | 6 +- .../outputv4/osmosis/superfluid/query.ts | 6 +- .../outputv4/osmosis/superfluid/superfluid.ts | 6 +- .../v-next/outputv4/tendermint/abci/types.ts | 24 +-- .../v-next/outputv4/tendermint/types/types.ts | 18 +- .../__snapshots__/object.spec.ts.snap | 12 +- .../encoding/amino/from-amino-json/utils.ts | 55 +++--- .../src/encoding/proto/from-amino/index.ts | 11 +- .../src/encoding/proto/from-amino/utils.ts | 173 ++++++++++++------ .../ast/src/encoding/proto/from-json/utils.ts | 2 +- .../src/encoding/proto/from-sdk-json/utils.ts | 2 +- .../ast/src/encoding/proto/from-sdk/utils.ts | 2 +- .../ast/src/encoding/proto/to-amino/index.ts | 13 +- .../ast/src/encoding/proto/to-amino/utils.ts | 101 +++++++--- .../telescope/src/helpers/binary-coder.ts | 4 +- .../telescope/types/helpers/binary-coder.d.ts | 2 +- 350 files changed, 2163 insertions(+), 2058 deletions(-) diff --git a/__fixtures__/v-next/outputosmojs/akash/base/v1beta1/endpoint.ts b/__fixtures__/v-next/outputosmojs/akash/base/v1beta1/endpoint.ts index aaa5d7db30..700e373d2a 100644 --- a/__fixtures__/v-next/outputosmojs/akash/base/v1beta1/endpoint.ts +++ b/__fixtures__/v-next/outputosmojs/akash/base/v1beta1/endpoint.ts @@ -74,7 +74,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toJSON(message: Endpoint): unknown { @@ -89,12 +89,12 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, fromSDKJSON(object: any): EndpointSDKType { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toSDK(message: Endpoint): EndpointSDKType { diff --git a/__fixtures__/v-next/outputosmojs/akash/base/v1beta2/endpoint.ts b/__fixtures__/v-next/outputosmojs/akash/base/v1beta2/endpoint.ts index 960e3d48a2..e2c6055434 100644 --- a/__fixtures__/v-next/outputosmojs/akash/base/v1beta2/endpoint.ts +++ b/__fixtures__/v-next/outputosmojs/akash/base/v1beta2/endpoint.ts @@ -90,7 +90,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 }; }, @@ -108,13 +108,13 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object?.sequence_number }; }, fromSDKJSON(object: any): EndpointSDKType { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequence_number: isSet(object.sequence_number) ? Number(object.sequence_number) : 0 }; }, diff --git a/__fixtures__/v-next/outputosmojs/akash/cert/v1beta2/cert.ts b/__fixtures__/v-next/outputosmojs/akash/cert/v1beta2/cert.ts index 478c214600..939f8895aa 100644 --- a/__fixtures__/v-next/outputosmojs/akash/cert/v1beta2/cert.ts +++ b/__fixtures__/v-next/outputosmojs/akash/cert/v1beta2/cert.ts @@ -222,7 +222,7 @@ export const Certificate = { }, fromJSON(object: any): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; @@ -243,14 +243,14 @@ export const Certificate = { }, fromSDK(object: CertificateSDKType): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object?.cert, pubkey: object?.pubkey }; }, fromSDKJSON(object: any): CertificateSDKType { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; diff --git a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/deployment.ts b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/deployment.ts index 66f680215e..1e2788448e 100644 --- a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/deployment.ts +++ b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/deployment.ts @@ -774,7 +774,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -798,7 +798,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -806,7 +806,7 @@ export const Deployment = { fromSDKJSON(object: any): DeploymentSDKType { return { deployment_id: isSet(object.deployment_id) ? DeploymentID.fromSDKJSON(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/group.ts b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/group.ts index b1e43e7547..68940ef266 100644 --- a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/group.ts +++ b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta1/group.ts @@ -687,7 +687,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -711,7 +711,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -719,7 +719,7 @@ export const Group = { fromSDKJSON(object: any): GroupSDKType { return { group_id: isSet(object.group_id) ? GroupID.fromSDKJSON(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, group_spec: isSet(object.group_spec) ? GroupSpec.fromSDKJSON(object.group_spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/deployment.ts b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/deployment.ts index 8b803fa97f..3f81143d6f 100644 --- a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/deployment.ts +++ b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/deployment.ts @@ -204,7 +204,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -228,7 +228,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -236,7 +236,7 @@ export const Deployment = { fromSDKJSON(object: any): DeploymentSDKType { return { deployment_id: isSet(object.deployment_id) ? DeploymentID.fromSDKJSON(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/group.ts b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/group.ts index 69ceec779f..e39732dc5c 100644 --- a/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/group.ts +++ b/__fixtures__/v-next/outputosmojs/akash/deployment/v1beta2/group.ts @@ -125,7 +125,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -149,7 +149,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -157,7 +157,7 @@ export const Group = { fromSDKJSON(object: any): GroupSDKType { return { group_id: isSet(object.group_id) ? GroupID.fromSDKJSON(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, group_spec: isSet(object.group_spec) ? GroupSpec.fromSDKJSON(object.group_spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta1/types.ts b/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta1/types.ts index 9c8d1eda49..8a1fe43409 100644 --- a/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta1/types.ts +++ b/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta1/types.ts @@ -293,7 +293,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? BigInt(object.settledAt.toString()) : BigInt(0) @@ -323,7 +323,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, transferred: object.transferred ? Coin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at @@ -333,7 +333,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromSDKJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromSDKJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromSDKJSON(object.transferred) : undefined, settled_at: isSet(object.settled_at) ? BigInt(object.settled_at.toString()) : BigInt(0) @@ -426,7 +426,7 @@ export const Payment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -459,7 +459,7 @@ export const Payment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object.rate ? Coin.fromSDK(object.rate) : undefined, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -470,7 +470,7 @@ export const Payment = { account_id: isSet(object.account_id) ? AccountID.fromSDKJSON(object.account_id) : undefined, payment_id: isSet(object.payment_id) ? String(object.payment_id) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromSDKJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromSDKJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromSDKJSON(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta2/types.ts b/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta2/types.ts index d61ee4ef79..bd9d151e39 100644 --- a/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta2/types.ts +++ b/__fixtures__/v-next/outputosmojs/akash/escrow/v1beta2/types.ts @@ -320,7 +320,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? BigInt(object.settledAt.toString()) : BigInt(0), @@ -356,7 +356,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, transferred: object.transferred ? DecCoin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at, @@ -368,7 +368,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromSDKJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromSDKJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromSDKJSON(object.transferred) : undefined, settled_at: isSet(object.settled_at) ? BigInt(object.settled_at.toString()) : BigInt(0), @@ -465,7 +465,7 @@ export const FractionalPayment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -498,7 +498,7 @@ export const FractionalPayment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object.rate ? DecCoin.fromSDK(object.rate) : undefined, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -509,7 +509,7 @@ export const FractionalPayment = { account_id: isSet(object.account_id) ? AccountID.fromSDKJSON(object.account_id) : undefined, payment_id: isSet(object.payment_id) ? String(object.payment_id) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromSDKJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromSDKJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromSDKJSON(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/bid.ts b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/bid.ts index b7a85d5b5a..0d795924e4 100644 --- a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/bid.ts +++ b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/bid.ts @@ -552,7 +552,7 @@ export const Bid = { fromJSON(object: any): Bid { return { bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -576,7 +576,7 @@ export const Bid = { fromSDK(object: BidSDKType): Bid { return { bidId: object.bid_id ? BidID.fromSDK(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at }; @@ -584,7 +584,7 @@ export const Bid = { fromSDKJSON(object: any): BidSDKType { return { bid_id: isSet(object.bid_id) ? BidID.fromSDKJSON(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromSDKJSON(object.price) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/lease.ts b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/lease.ts index a172482379..539a98c90d 100644 --- a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/lease.ts +++ b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/lease.ts @@ -309,7 +309,7 @@ export const Lease = { fromJSON(object: any): Lease { return { leaseId: isSet(object.leaseId) ? LeaseID.fromJSON(object.leaseId) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0), closedOn: isSet(object.closedOn) ? BigInt(object.closedOn.toString()) : BigInt(0) @@ -336,7 +336,7 @@ export const Lease = { fromSDK(object: LeaseSDKType): Lease { return { leaseId: object.lease_id ? LeaseID.fromSDK(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at, closedOn: object?.closed_on @@ -345,7 +345,7 @@ export const Lease = { fromSDKJSON(object: any): LeaseSDKType { return { lease_id: isSet(object.lease_id) ? LeaseID.fromSDKJSON(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromSDKJSON(object.price) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0), closed_on: isSet(object.closed_on) ? BigInt(object.closed_on.toString()) : BigInt(0) diff --git a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/order.ts b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/order.ts index 84be24faf4..ffee5afb38 100644 --- a/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/order.ts +++ b/__fixtures__/v-next/outputosmojs/akash/market/v1beta2/order.ts @@ -246,7 +246,7 @@ export const Order = { fromJSON(object: any): Order { return { orderId: isSet(object.orderId) ? OrderID.fromJSON(object.orderId) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -270,7 +270,7 @@ export const Order = { fromSDK(object: OrderSDKType): Order { return { orderId: object.order_id ? OrderID.fromSDK(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object.spec ? GroupSpec.fromSDK(object.spec) : undefined, createdAt: object?.created_at }; @@ -278,7 +278,7 @@ export const Order = { fromSDKJSON(object: any): OrderSDKType { return { order_id: isSet(object.order_id) ? OrderID.fromSDKJSON(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromSDKJSON(object.spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/binary.ts b/__fixtures__/v-next/outputosmojs/binary.ts index a353b1190f..3e8b563b9c 100644 --- a/__fixtures__/v-next/outputosmojs/binary.ts +++ b/__fixtures__/v-next/outputosmojs/binary.ts @@ -189,11 +189,11 @@ export class BinaryReader { return BigInt(int64ToString(lo, hi)); } - float() { + float(): number { throw new Error("float not supported"); } - double() { + double(): number { throw new Error("double not supported"); } diff --git a/__fixtures__/v-next/outputosmojs/confio/proofs.ts b/__fixtures__/v-next/outputosmojs/confio/proofs.ts index 3963319dae..3e71846403 100644 --- a/__fixtures__/v-next/outputosmojs/confio/proofs.ts +++ b/__fixtures__/v-next/outputosmojs/confio/proofs.ts @@ -825,10 +825,10 @@ export const LeafOp = { }, fromJSON(object: any): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -852,19 +852,19 @@ export const LeafOp = { }, fromSDK(object: LeafOpSDKType): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object?.prefix }; }, fromSDKJSON(object: any): LeafOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -923,7 +923,7 @@ export const InnerOp = { }, fromJSON(object: any): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -944,14 +944,14 @@ export const InnerOp = { }, fromSDK(object: InnerOpSDKType): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object?.prefix, suffix: object?.suffix }; }, fromSDKJSON(object: any): InnerOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -1143,7 +1143,7 @@ export const InnerSpec = { minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toJSON(message: InnerSpec): unknown { @@ -1177,7 +1177,7 @@ export const InnerSpec = { minPrefixLength: object?.min_prefix_length, maxPrefixLength: object?.max_prefix_length, emptyChild: object?.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, fromSDKJSON(object: any): InnerSpecSDKType { @@ -1187,7 +1187,7 @@ export const InnerSpec = { min_prefix_length: isSet(object.min_prefix_length) ? Number(object.min_prefix_length) : 0, max_prefix_length: isSet(object.max_prefix_length) ? Number(object.max_prefix_length) : 0, empty_child: isSet(object.empty_child) ? bytesFromBase64(object.empty_child) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toSDK(message: InnerSpec): InnerSpecSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts index b3f6175c43..04067f5d0b 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/gov.ts @@ -315,7 +315,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -333,13 +333,13 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, fromSDKJSON(object: any): WeightedVoteOptionSDKType { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -540,7 +540,7 @@ export const Proposal = { return { id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -590,7 +590,7 @@ export const Proposal = { return { id: object?.id, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -604,7 +604,7 @@ export const Proposal = { return { id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, deposit_end_time: isSet(object.deposit_end_time) ? new Date(object.deposit_end_time) : undefined, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/query.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/query.ts index 9b39caef35..3d9254839a 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/query.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/query.ts @@ -361,7 +361,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -385,7 +385,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -393,7 +393,7 @@ export const QueryProposalsRequest = { }, fromSDKJSON(object: any): QueryProposalsRequestSDKType { return { - proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/tx.ts index 263faa6862..4d635671bb 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1/tx.ts @@ -452,7 +452,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, @@ -476,7 +476,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata }; }, @@ -484,7 +484,7 @@ export const MsgVote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts index 6a78917039..7ae991416a 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/gov.ts @@ -344,7 +344,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -362,13 +362,13 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, fromSDKJSON(object: any): WeightedVoteOptionSDKType { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -635,7 +635,7 @@ export const Proposal = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -678,7 +678,7 @@ export const Proposal = { return { proposalId: object?.proposal_id, content: object.content ? Any.fromSDK(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -691,7 +691,7 @@ export const Proposal = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), content: isSet(object.content) ? Any.fromSDKJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, deposit_end_time: isSet(object.deposit_end_time) ? new Date(object.deposit_end_time) : undefined, @@ -871,7 +871,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, @@ -899,7 +899,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDK(e)) : [] }; }, @@ -907,7 +907,7 @@ export const Vote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/query.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/query.ts index 037b103884..2bb9446bf7 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/query.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/query.ts @@ -361,7 +361,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -385,7 +385,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -393,7 +393,7 @@ export const QueryProposalsRequest = { }, fromSDKJSON(object: any): QueryProposalsRequestSDKType { return { - proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/tx.ts index 6079d5f664..4ae682fedf 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/gov/v1beta1/tx.ts @@ -295,7 +295,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -316,14 +316,14 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, fromSDKJSON(object: any): MsgVoteSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/events.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/events.ts index 91cabe9f6a..d7da5ab741 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/events.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/events.ts @@ -548,7 +548,7 @@ export const EventExec = { fromJSON(object: any): EventExec { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toJSON(message: EventExec): unknown { @@ -566,13 +566,13 @@ export const EventExec = { fromSDK(object: EventExecSDKType): EventExec { return { proposalId: object?.proposal_id, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, fromSDKJSON(object: any): EventExecSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toSDK(message: EventExec): EventExecSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.ts index ee5d73a3fe..8f349a50c0 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/tx.ts @@ -1726,7 +1726,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgSubmitProposal): unknown { @@ -1761,7 +1761,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object?.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, fromSDKJSON(object: any): MsgSubmitProposalSDKType { @@ -1770,7 +1770,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgSubmitProposal): MsgSubmitProposalSDKType { @@ -2028,9 +2028,9 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -2055,18 +2055,18 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, fromSDKJSON(object: any): MsgVoteSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts index 271c37086b..037fc691c7 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/group/v1/types.ts @@ -1326,11 +1326,11 @@ export const Proposal = { submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, groupVersion: isSet(object.groupVersion) ? BigInt(object.groupVersion.toString()) : BigInt(0), groupPolicyVersion: isSet(object.groupPolicyVersion) ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, votingPeriodEnd: isSet(object.votingPeriodEnd) ? new Date(object.votingPeriodEnd) : undefined, - executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : 0, + executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -1385,11 +1385,11 @@ export const Proposal = { submitTime: object.submit_time ?? undefined, groupVersion: object?.group_version, groupPolicyVersion: object?.group_policy_version, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, votingPeriodEnd: object.voting_period_end ?? undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -1402,11 +1402,11 @@ export const Proposal = { submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, group_version: isSet(object.group_version) ? BigInt(object.group_version.toString()) : BigInt(0), group_policy_version: isSet(object.group_policy_version) ? BigInt(object.group_policy_version.toString()) : BigInt(0), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, voting_period_end: isSet(object.voting_period_end) ? new Date(object.voting_period_end) : undefined, - executor_result: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executor_result: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [] }; }, @@ -1596,7 +1596,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined }; @@ -1623,7 +1623,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, submitTime: object.submit_time ?? undefined }; @@ -1632,7 +1632,7 @@ export const Vote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined }; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/ics23/v1/proofs.ts b/__fixtures__/v-next/outputosmojs/cosmos/ics23/v1/proofs.ts index 7c6f0aad06..66eb43b2da 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/ics23/v1/proofs.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/ics23/v1/proofs.ts @@ -831,10 +831,10 @@ export const LeafOp = { }, fromJSON(object: any): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -858,19 +858,19 @@ export const LeafOp = { }, fromSDK(object: LeafOpSDKType): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object?.prefix }; }, fromSDKJSON(object: any): LeafOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -929,7 +929,7 @@ export const InnerOp = { }, fromJSON(object: any): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -950,14 +950,14 @@ export const InnerOp = { }, fromSDK(object: InnerOpSDKType): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object?.prefix, suffix: object?.suffix }; }, fromSDKJSON(object: any): InnerOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -1149,7 +1149,7 @@ export const InnerSpec = { minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toJSON(message: InnerSpec): unknown { @@ -1183,7 +1183,7 @@ export const InnerSpec = { minPrefixLength: object?.min_prefix_length, maxPrefixLength: object?.max_prefix_length, emptyChild: object?.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, fromSDKJSON(object: any): InnerSpecSDKType { @@ -1193,7 +1193,7 @@ export const InnerSpec = { min_prefix_length: isSet(object.min_prefix_length) ? Number(object.min_prefix_length) : 0, max_prefix_length: isSet(object.max_prefix_length) ? Number(object.max_prefix_length) : 0, empty_child: isSet(object.empty_child) ? bytesFromBase64(object.empty_child) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toSDK(message: InnerSpec): InnerSpecSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/orm/v1alpha1/schema.ts b/__fixtures__/v-next/outputosmojs/cosmos/orm/v1alpha1/schema.ts index 6fbd0c826a..d12f9e52d3 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/orm/v1alpha1/schema.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/orm/v1alpha1/schema.ts @@ -253,7 +253,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: isSet(object.id) ? Number(object.id) : 0, protoFileName: isSet(object.protoFileName) ? String(object.protoFileName) : "", - storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : 0 + storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : -1 }; }, toJSON(message: ModuleSchemaDescriptor_FileEntry): unknown { @@ -274,14 +274,14 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object?.id, protoFileName: object?.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, fromSDKJSON(object: any): ModuleSchemaDescriptor_FileEntrySDKType { return { id: isSet(object.id) ? Number(object.id) : 0, proto_file_name: isSet(object.proto_file_name) ? String(object.proto_file_name) : "", - storage_type: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storage_type: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toSDK(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntrySDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/authz.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/authz.ts index b63cf705e2..2696c554a4 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/authz.ts @@ -149,7 +149,7 @@ export const StakeAuthorization = { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0 + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : -1 }; }, toJSON(message: StakeAuthorization): unknown { @@ -173,7 +173,7 @@ export const StakeAuthorization = { maxTokens: object.max_tokens ? Coin.fromSDK(object.max_tokens) : undefined, allowList: object.allow_list ? StakeAuthorization_Validators.fromSDK(object.allow_list) : undefined, denyList: object.deny_list ? StakeAuthorization_Validators.fromSDK(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, fromSDKJSON(object: any): StakeAuthorizationSDKType { @@ -181,7 +181,7 @@ export const StakeAuthorization = { max_tokens: isSet(object.max_tokens) ? Coin.fromSDKJSON(object.max_tokens) : undefined, allow_list: isSet(object.allow_list) ? StakeAuthorization_Validators.fromSDKJSON(object.allow_list) : undefined, deny_list: isSet(object.deny_list) ? StakeAuthorization_Validators.fromSDKJSON(object.deny_list) : undefined, - authorization_type: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorization_type: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toSDK(message: StakeAuthorization): StakeAuthorizationSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts index bd24265dd6..7231686ced 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/staking/v1beta1/staking.ts @@ -902,7 +902,7 @@ export const Validator = { operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, @@ -947,7 +947,7 @@ export const Validator = { operatorAddress: object?.operator_address, consensusPubkey: object.consensus_pubkey ? Any.fromSDK(object.consensus_pubkey) : undefined, jailed: object?.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object?.tokens, delegatorShares: object?.delegator_shares, description: object.description ? Description.fromSDK(object.description) : undefined, @@ -962,7 +962,7 @@ export const Validator = { operator_address: isSet(object.operator_address) ? String(object.operator_address) : "", consensus_pubkey: isSet(object.consensus_pubkey) ? Any.fromSDKJSON(object.consensus_pubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegator_shares: isSet(object.delegator_shares) ? String(object.delegator_shares) : "", description: isSet(object.description) ? Description.fromSDKJSON(object.description) : undefined, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/tx/signing/v1beta1/signing.ts b/__fixtures__/v-next/outputosmojs/cosmos/tx/signing/v1beta1/signing.ts index fd7d3c1d1a..05c03b7d16 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/tx/signing/v1beta1/signing.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/tx/signing/v1beta1/signing.ts @@ -425,7 +425,7 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, @@ -443,13 +443,13 @@ export const SignatureDescriptor_Data_Single = { }, fromSDK(object: SignatureDescriptor_Data_SingleSDKType): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object?.signature }; }, fromSDKJSON(object: any): SignatureDescriptor_Data_SingleSDKType { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/service.ts b/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/service.ts index a87dba815c..e936a7b2c2 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/service.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/service.ts @@ -342,7 +342,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0 + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1 }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -367,14 +367,14 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, fromSDKJSON(object: any): GetTxsEventRequestSDKType { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined, - order_by: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + order_by: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toSDK(message: GetTxsEventRequest): GetTxsEventRequestSDKType { @@ -530,7 +530,7 @@ export const BroadcastTxRequest = { fromJSON(object: any): BroadcastTxRequest { return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toJSON(message: BroadcastTxRequest): unknown { @@ -548,13 +548,13 @@ export const BroadcastTxRequest = { fromSDK(object: BroadcastTxRequestSDKType): BroadcastTxRequest { return { txBytes: object?.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, fromSDKJSON(object: any): BroadcastTxRequestSDKType { return { tx_bytes: isSet(object.tx_bytes) ? bytesFromBase64(object.tx_bytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toSDK(message: BroadcastTxRequest): BroadcastTxRequestSDKType { diff --git a/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/tx.ts b/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/tx.ts index de0d250b18..8351e9a4d6 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/tx/v1beta1/tx.ts @@ -1220,7 +1220,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1235,12 +1235,12 @@ export const ModeInfo_Single = { }, fromSDK(object: ModeInfo_SingleSDKType): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, fromSDKJSON(object: any): ModeInfo_SingleSDKType { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toSDK(message: ModeInfo_Single): ModeInfo_SingleSDKType { @@ -1572,7 +1572,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -1596,7 +1596,7 @@ export const AuxSignerData = { return { address: object?.address, signDoc: object.sign_doc ? SignDocDirectAux.fromSDK(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object?.sig }; }, @@ -1604,7 +1604,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", sign_doc: isSet(object.sign_doc) ? SignDocDirectAux.fromSDKJSON(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputosmojs/cosmwasm/wasm/v1/types.ts b/__fixtures__/v-next/outputosmojs/cosmwasm/wasm/v1/types.ts index ff8e7d6425..2caf5d92bb 100644 --- a/__fixtures__/v-next/outputosmojs/cosmwasm/wasm/v1/types.ts +++ b/__fixtures__/v-next/outputosmojs/cosmwasm/wasm/v1/types.ts @@ -256,7 +256,7 @@ export const AccessTypeParam = { }, fromJSON(object: any): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toJSON(message: AccessTypeParam): unknown { @@ -271,12 +271,12 @@ export const AccessTypeParam = { }, fromSDK(object: AccessTypeParamSDKType): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, fromSDKJSON(object: any): AccessTypeParamSDKType { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toSDK(message: AccessTypeParam): AccessTypeParamSDKType { @@ -323,7 +323,7 @@ export const AccessConfig = { }, fromJSON(object: any): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -341,13 +341,13 @@ export const AccessConfig = { }, fromSDK(object: AccessConfigSDKType): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object?.address }; }, fromSDKJSON(object: any): AccessConfigSDKType { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -404,7 +404,7 @@ export const Params = { fromJSON(object: any): Params { return { codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, - instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : 0, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : -1, maxWasmCodeSize: isSet(object.maxWasmCodeSize) ? BigInt(object.maxWasmCodeSize.toString()) : BigInt(0) }; }, @@ -425,14 +425,14 @@ export const Params = { fromSDK(object: ParamsSDKType): Params { return { codeUploadAccess: object.code_upload_access ? AccessConfig.fromSDK(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: object?.max_wasm_code_size }; }, fromSDKJSON(object: any): ParamsSDKType { return { code_upload_access: isSet(object.code_upload_access) ? AccessConfig.fromSDKJSON(object.code_upload_access) : undefined, - instantiate_default_permission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiate_default_permission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, max_wasm_code_size: isSet(object.max_wasm_code_size) ? BigInt(object.max_wasm_code_size.toString()) : BigInt(0) }; }, @@ -720,7 +720,7 @@ export const ContractCodeHistoryEntry = { }, fromJSON(object: any): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() @@ -744,7 +744,7 @@ export const ContractCodeHistoryEntry = { }, fromSDK(object: ContractCodeHistoryEntrySDKType): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: object?.code_id, updated: object.updated ? AbsoluteTxPosition.fromSDK(object.updated) : undefined, msg: object?.msg @@ -752,7 +752,7 @@ export const ContractCodeHistoryEntry = { }, fromSDKJSON(object: any): ContractCodeHistoryEntrySDKType { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, code_id: isSet(object.code_id) ? BigInt(object.code_id.toString()) : BigInt(0), updated: isSet(object.updated) ? AbsoluteTxPosition.fromSDKJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() diff --git a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/claims.ts b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/claims.ts index e240949024..768b5ceac5 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/claims/v1/claims.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/claims/v1/claims.ts @@ -155,7 +155,7 @@ export const Claim = { }, fromJSON(object: any): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimableAmount: isSet(object.claimableAmount) ? String(object.claimableAmount) : "" }; @@ -176,14 +176,14 @@ export const Claim = { }, fromSDK(object: ClaimSDKType): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object?.completed, claimableAmount: object?.claimable_amount }; }, fromSDKJSON(object: any): ClaimSDKType { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimable_amount: isSet(object.claimable_amount) ? String(object.claimable_amount) : "" }; diff --git a/__fixtures__/v-next/outputosmojs/evmos/erc20/v1/erc20.ts b/__fixtures__/v-next/outputosmojs/evmos/erc20/v1/erc20.ts index e3360111ff..bb45f83756 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/erc20/v1/erc20.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/erc20/v1/erc20.ts @@ -188,7 +188,7 @@ export const TokenPair = { erc20Address: isSet(object.erc20Address) ? String(object.erc20Address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : 0 + contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : -1 }; }, toJSON(message: TokenPair): unknown { @@ -212,7 +212,7 @@ export const TokenPair = { erc20Address: object?.erc20_address, denom: object?.denom, enabled: object?.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, fromSDKJSON(object: any): TokenPairSDKType { @@ -220,7 +220,7 @@ export const TokenPair = { erc20_address: isSet(object.erc20_address) ? String(object.erc20_address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contract_owner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contract_owner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toSDK(message: TokenPair): TokenPairSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/backend.ts b/__fixtures__/v-next/outputosmojs/google/api/backend.ts index 7acb38019e..ce44b73e80 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/backend.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/backend.ts @@ -363,7 +363,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, minDeadline: isSet(object.minDeadline) ? Number(object.minDeadline) : 0, operationDeadline: isSet(object.operationDeadline) ? Number(object.operationDeadline) : 0, - pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : 0, + pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : -1, jwtAudience: isSet(object.jwtAudience) ? String(object.jwtAudience) : undefined, disableAuth: isSet(object.disableAuth) ? Boolean(object.disableAuth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" @@ -402,7 +402,7 @@ export const BackendRule = { deadline: object?.deadline, minDeadline: object?.min_deadline, operationDeadline: object?.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object?.protocol @@ -415,7 +415,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, min_deadline: isSet(object.min_deadline) ? Number(object.min_deadline) : 0, operation_deadline: isSet(object.operation_deadline) ? Number(object.operation_deadline) : 0, - path_translation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + path_translation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwt_audience: isSet(object.jwt_audience) ? String(object.jwt_audience) : undefined, disable_auth: isSet(object.disable_auth) ? Boolean(object.disable_auth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" diff --git a/__fixtures__/v-next/outputosmojs/google/api/config_change.ts b/__fixtures__/v-next/outputosmojs/google/api/config_change.ts index bfaa34eb7f..6d357c1e96 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/config_change.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/config_change.ts @@ -195,7 +195,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", oldValue: isSet(object.oldValue) ? String(object.oldValue) : "", newValue: isSet(object.newValue) ? String(object.newValue) : "", - changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : 0, + changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [] }; }, @@ -226,7 +226,7 @@ export const ConfigChange = { element: object?.element, oldValue: object?.old_value, newValue: object?.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDK(e)) : [] }; }, @@ -235,7 +235,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", old_value: isSet(object.old_value) ? String(object.old_value) : "", new_value: isSet(object.new_value) ? String(object.new_value) : "", - change_type: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + change_type: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/api/consumer.ts b/__fixtures__/v-next/outputosmojs/google/api/consumer.ts index e8c056734d..3d94885cde 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/consumer.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/consumer.ts @@ -250,7 +250,7 @@ export const Property = { fromJSON(object: any): Property { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -271,14 +271,14 @@ export const Property = { fromSDK(object: PropertySDKType): Property { return { name: object?.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object?.description }; }, fromSDKJSON(object: any): PropertySDKType { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/api/expr/conformance/v1alpha1/conformance_service.ts b/__fixtures__/v-next/outputosmojs/google/api/expr/conformance/v1alpha1/conformance_service.ts index 25bdfdc506..001cdec128 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/expr/conformance/v1alpha1/conformance_service.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/expr/conformance/v1alpha1/conformance_service.ts @@ -904,7 +904,7 @@ export const IssueDetails = { }, fromJSON(object: any): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromJSON(object.position) : undefined, id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; @@ -925,14 +925,14 @@ export const IssueDetails = { }, fromSDK(object: IssueDetailsSDKType): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object.position ? SourcePosition.fromSDK(object.position) : undefined, id: object?.id }; }, fromSDKJSON(object: any): IssueDetailsSDKType { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromSDKJSON(object.position) : undefined, id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/google/api/label.ts b/__fixtures__/v-next/outputosmojs/google/api/label.ts index 42bce266ea..1533ff6361 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/label.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/label.ts @@ -103,7 +103,7 @@ export const LabelDescriptor = { fromJSON(object: any): LabelDescriptor { return { key: isSet(object.key) ? String(object.key) : "", - valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : 0, + valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -124,14 +124,14 @@ export const LabelDescriptor = { fromSDK(object: LabelDescriptorSDKType): LabelDescriptor { return { key: object?.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object?.description }; }, fromSDKJSON(object: any): LabelDescriptorSDKType { return { key: isSet(object.key) ? String(object.key) : "", - value_type: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + value_type: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/api/metric.ts b/__fixtures__/v-next/outputosmojs/google/api/metric.ts index c696302c15..caa058c0a2 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/metric.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/metric.ts @@ -486,13 +486,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : 0, - valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : 0, + metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : -1, + valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", displayName: isSet(object.displayName) ? String(object.displayName) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromJSON(object.metadata) : undefined, - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, monitoredResourceTypes: Array.isArray(object?.monitoredResourceTypes) ? object.monitoredResourceTypes.map((e: any) => String(e)) : [] }; }, @@ -539,13 +539,13 @@ export const MetricDescriptor = { name: object?.name, type: object?.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object?.unit, description: object?.description, displayName: object?.display_name, metadata: object.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromSDK(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -554,13 +554,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDKJSON(e)) : [], - metric_kind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - value_type: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metric_kind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + value_type: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", display_name: isSet(object.display_name) ? String(object.display_name) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromSDKJSON(object.metadata) : undefined, - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitored_resource_types: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => String(e)) : [] }; }, @@ -633,7 +633,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromJSON(object: any): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, samplePeriod: isSet(object.samplePeriod) ? Duration.fromJSON(object.samplePeriod) : undefined, ingestDelay: isSet(object.ingestDelay) ? Duration.fromJSON(object.ingestDelay) : undefined }; @@ -654,14 +654,14 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromSDK(object: MetricDescriptor_MetricDescriptorMetadataSDKType): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object.sample_period ? Duration.fromSDK(object.sample_period) : undefined, ingestDelay: object.ingest_delay ? Duration.fromSDK(object.ingest_delay) : undefined }; }, fromSDKJSON(object: any): MetricDescriptor_MetricDescriptorMetadataSDKType { return { - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, sample_period: isSet(object.sample_period) ? Duration.fromSDKJSON(object.sample_period) : undefined, ingest_delay: isSet(object.ingest_delay) ? Duration.fromSDKJSON(object.ingest_delay) : undefined }; diff --git a/__fixtures__/v-next/outputosmojs/google/api/monitored_resource.ts b/__fixtures__/v-next/outputosmojs/google/api/monitored_resource.ts index a192c56627..5596f88706 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/monitored_resource.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/monitored_resource.ts @@ -250,7 +250,7 @@ export const MonitoredResourceDescriptor = { displayName: isSet(object.displayName) ? String(object.displayName) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0 + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1 }; }, toJSON(message: MonitoredResourceDescriptor): unknown { @@ -284,7 +284,7 @@ export const MonitoredResourceDescriptor = { displayName: object?.display_name, description: object?.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, fromSDKJSON(object: any): MonitoredResourceDescriptorSDKType { @@ -294,7 +294,7 @@ export const MonitoredResourceDescriptor = { display_name: isSet(object.display_name) ? String(object.display_name) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDKJSON(e)) : [], - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toSDK(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/resource.ts b/__fixtures__/v-next/outputosmojs/google/api/resource.ts index 44ebe80d46..9ea5dba2ee 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/resource.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/resource.ts @@ -421,7 +421,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], nameField: isSet(object.nameField) ? String(object.nameField) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -462,7 +462,7 @@ export const ResourceDescriptor = { type: object?.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object?.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object?.plural, singular: object?.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -473,7 +473,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], name_field: isSet(object.name_field) ? String(object.name_field) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/check_error.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/check_error.ts index 8f893fbd4a..7fa3932f0c 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/check_error.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/check_error.ts @@ -277,7 +277,7 @@ export const CheckError = { }, fromJSON(object: any): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -301,7 +301,7 @@ export const CheckError = { }, fromSDK(object: CheckErrorSDKType): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object?.subject, detail: object?.detail, status: object.status ? Status.fromSDK(object.status) : undefined @@ -309,7 +309,7 @@ export const CheckError = { }, fromSDKJSON(object: any): CheckErrorSDKType { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromSDKJSON(object.status) : undefined diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts index 5a500cd7e8..d38dd286d7 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/log_entry.ts @@ -350,7 +350,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insertId: isSet(object.insertId) ? String(object.insertId) : "", @@ -415,7 +415,7 @@ export const LogEntry = { return { name: object?.name, timestamp: object.timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, trace: object?.trace, insertId: object?.insert_id, @@ -436,7 +436,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, http_request: isSet(object.http_request) ? HttpRequest.fromSDKJSON(object.http_request) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insert_id: isSet(object.insert_id) ? String(object.insert_id) : "", diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts index b96a38378a..084222782c 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/operation.ts @@ -337,7 +337,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metricValueSets) ? object.metricValueSets.map((e: any) => MetricValueSet.fromJSON(e)) : [], logEntries: Array.isArray(object?.logEntries) ? object.logEntries.map((e: any) => LogEntry.fromJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -408,7 +408,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDK(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDK(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -427,7 +427,7 @@ export const Operation = { }, {}) : {}, metric_value_sets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDKJSON(e)) : [], log_entries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDKJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/quota_controller.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/quota_controller.ts index f2b9947165..0e4de23507 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/quota_controller.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/quota_controller.ts @@ -571,7 +571,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quotaMetrics) ? object.quotaMetrics.map((e: any) => MetricValueSet.fromJSON(e)) : [], - quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : 0 + quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : -1 }; }, toJSON(message: QuotaOperation): unknown { @@ -622,7 +622,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDK(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, fromSDKJSON(object: any): QuotaOperationSDKType { @@ -637,7 +637,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quota_metrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDKJSON(e)) : [], - quota_mode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quota_mode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toSDK(message: QuotaOperation): QuotaOperationSDKType { @@ -827,7 +827,7 @@ export const QuotaError = { }, fromJSON(object: any): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -851,7 +851,7 @@ export const QuotaError = { }, fromSDK(object: QuotaErrorSDKType): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object?.subject, description: object?.description, status: object.status ? Status.fromSDK(object.status) : undefined @@ -859,7 +859,7 @@ export const QuotaError = { }, fromSDKJSON(object: any): QuotaErrorSDKType { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromSDKJSON(object.status) : undefined diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/service_controller.ts b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/service_controller.ts index b471cf2fe5..a0230167f3 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/service_controller.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicecontrol/v1/service_controller.ts @@ -597,7 +597,7 @@ export const CheckResponse_ConsumerInfo = { fromJSON(object: any): CheckResponse_ConsumerInfo { return { projectNumber: isSet(object.projectNumber) ? BigInt(object.projectNumber.toString()) : BigInt(0), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: isSet(object.consumerNumber) ? BigInt(object.consumerNumber.toString()) : BigInt(0) }; }, @@ -618,14 +618,14 @@ export const CheckResponse_ConsumerInfo = { fromSDK(object: CheckResponse_ConsumerInfoSDKType): CheckResponse_ConsumerInfo { return { projectNumber: object?.project_number, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: object?.consumer_number }; }, fromSDKJSON(object: any): CheckResponse_ConsumerInfoSDKType { return { project_number: isSet(object.project_number) ? BigInt(object.project_number.toString()) : BigInt(0), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumer_number: isSet(object.consumer_number) ? BigInt(object.consumer_number.toString()) : BigInt(0) }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts index 83c7332b44..576c088563 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/resources.ts @@ -776,7 +776,7 @@ export const OperationMetadata_Step = { fromJSON(object: any): OperationMetadata_Step { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toJSON(message: OperationMetadata_Step): unknown { @@ -794,13 +794,13 @@ export const OperationMetadata_Step = { fromSDK(object: OperationMetadata_StepSDKType): OperationMetadata_Step { return { description: object?.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, fromSDKJSON(object: any): OperationMetadata_StepSDKType { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toSDK(message: OperationMetadata_Step): OperationMetadata_StepSDKType { @@ -856,7 +856,7 @@ export const Diagnostic = { fromJSON(object: any): Diagnostic { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -877,14 +877,14 @@ export const Diagnostic = { fromSDK(object: DiagnosticSDKType): Diagnostic { return { location: object?.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object?.message }; }, fromSDKJSON(object: any): DiagnosticSDKType { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -1024,7 +1024,7 @@ export const ConfigFile = { return { filePath: isSet(object.filePath) ? String(object.filePath) : "", fileContents: isSet(object.fileContents) ? bytesFromBase64(object.fileContents) : new Uint8Array(), - fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : 0 + fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : -1 }; }, toJSON(message: ConfigFile): unknown { @@ -1045,14 +1045,14 @@ export const ConfigFile = { return { filePath: object?.file_path, fileContents: object?.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, fromSDKJSON(object: any): ConfigFileSDKType { return { file_path: isSet(object.file_path) ? String(object.file_path) : "", file_contents: isSet(object.file_contents) ? bytesFromBase64(object.file_contents) : new Uint8Array(), - file_type: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + file_type: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toSDK(message: ConfigFile): ConfigFileSDKType { @@ -1267,7 +1267,7 @@ export const Rollout = { rolloutId: isSet(object.rolloutId) ? String(object.rolloutId) : "", createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, createdBy: isSet(object.createdBy) ? String(object.createdBy) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: isSet(object.trafficPercentStrategy) ? Rollout_TrafficPercentStrategy.fromJSON(object.trafficPercentStrategy) : undefined, deleteServiceStrategy: isSet(object.deleteServiceStrategy) ? Rollout_DeleteServiceStrategy.fromJSON(object.deleteServiceStrategy) : undefined, serviceName: isSet(object.serviceName) ? String(object.serviceName) : "" @@ -1300,7 +1300,7 @@ export const Rollout = { rolloutId: object?.rollout_id, createTime: object.create_time ?? undefined, createdBy: object?.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromSDK(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromSDK(object.delete_service_strategy) : undefined, serviceName: object?.service_name @@ -1311,7 +1311,7 @@ export const Rollout = { rollout_id: isSet(object.rollout_id) ? String(object.rollout_id) : "", create_time: isSet(object.create_time) ? new Date(object.create_time) : undefined, created_by: isSet(object.created_by) ? String(object.created_by) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, traffic_percent_strategy: isSet(object.traffic_percent_strategy) ? Rollout_TrafficPercentStrategy.fromSDKJSON(object.traffic_percent_strategy) : undefined, delete_service_strategy: isSet(object.delete_service_strategy) ? Rollout_DeleteServiceStrategy.fromSDKJSON(object.delete_service_strategy) : undefined, service_name: isSet(object.service_name) ? String(object.service_name) : "" diff --git a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/servicemanager.ts b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/servicemanager.ts index 4a103dadaf..baae5982c6 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/servicemanager.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/servicemanagement/v1/servicemanager.ts @@ -896,7 +896,7 @@ export const GetServiceConfigRequest = { return { serviceName: isSet(object.serviceName) ? String(object.serviceName) : "", configId: isSet(object.configId) ? String(object.configId) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toJSON(message: GetServiceConfigRequest): unknown { @@ -917,14 +917,14 @@ export const GetServiceConfigRequest = { return { serviceName: object?.service_name, configId: object?.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetServiceConfigRequestSDKType { return { service_name: isSet(object.service_name) ? String(object.service_name) : "", config_id: isSet(object.config_id) ? String(object.config_id) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toSDK(message: GetServiceConfigRequest): GetServiceConfigRequestSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/resources.ts b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/resources.ts index 061d1e4c12..853cfc4062 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/resources.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/resources.ts @@ -213,7 +213,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -237,7 +237,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): ServiceSDKType { @@ -245,7 +245,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromSDKJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/serviceusage.ts b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/serviceusage.ts index f4bf88e677..5a75eaaf4b 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/serviceusage.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1/serviceusage.ts @@ -464,7 +464,7 @@ export const DisableServiceRequest = { return { name: isSet(object.name) ? String(object.name) : "", disableDependentServices: isSet(object.disableDependentServices) ? Boolean(object.disableDependentServices) : false, - checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : 0 + checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : -1 }; }, toJSON(message: DisableServiceRequest): unknown { @@ -485,14 +485,14 @@ export const DisableServiceRequest = { return { name: object?.name, disableDependentServices: object?.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, fromSDKJSON(object: any): DisableServiceRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", disable_dependent_services: isSet(object.disable_dependent_services) ? Boolean(object.disable_dependent_services) : false, - check_if_service_has_usage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + check_if_service_has_usage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toSDK(message: DisableServiceRequest): DisableServiceRequestSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/resources.ts b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/resources.ts index 5719e27b9b..29e9096801 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/resources.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/resources.ts @@ -667,7 +667,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -691,7 +691,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): ServiceSDKType { @@ -699,7 +699,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromSDKJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/serviceusage.ts b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/serviceusage.ts index 1f7f009613..46315c0306 100644 --- a/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/serviceusage.ts +++ b/__fixtures__/v-next/outputosmojs/google/api/serviceusage/v1beta1/serviceusage.ts @@ -1252,7 +1252,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0, pageToken: isSet(object.pageToken) ? String(object.pageToken) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: ListConsumerQuotaMetricsRequest): unknown { @@ -1276,7 +1276,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object?.parent, pageSize: object?.page_size, pageToken: object?.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): ListConsumerQuotaMetricsRequestSDKType { @@ -1284,7 +1284,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", page_size: isSet(object.page_size) ? Number(object.page_size) : 0, page_token: isSet(object.page_token) ? String(object.page_token) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestSDKType { @@ -1416,7 +1416,7 @@ export const GetConsumerQuotaMetricRequest = { fromJSON(object: any): GetConsumerQuotaMetricRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaMetricRequest): unknown { @@ -1434,13 +1434,13 @@ export const GetConsumerQuotaMetricRequest = { fromSDK(object: GetConsumerQuotaMetricRequestSDKType): GetConsumerQuotaMetricRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetConsumerQuotaMetricRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestSDKType { @@ -1489,7 +1489,7 @@ export const GetConsumerQuotaLimitRequest = { fromJSON(object: any): GetConsumerQuotaLimitRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaLimitRequest): unknown { @@ -1507,13 +1507,13 @@ export const GetConsumerQuotaLimitRequest = { fromSDK(object: GetConsumerQuotaLimitRequestSDKType): GetConsumerQuotaLimitRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetConsumerQuotaLimitRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestSDKType { @@ -3482,7 +3482,7 @@ export const GetServiceIdentityResponse = { fromJSON(object: any): GetServiceIdentityResponse { return { identity: isSet(object.identity) ? ServiceIdentity.fromJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toJSON(message: GetServiceIdentityResponse): unknown { @@ -3500,13 +3500,13 @@ export const GetServiceIdentityResponse = { fromSDK(object: GetServiceIdentityResponseSDKType): GetServiceIdentityResponse { return { identity: object.identity ? ServiceIdentity.fromSDK(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): GetServiceIdentityResponseSDKType { return { identity: isSet(object.identity) ? ServiceIdentity.fromSDKJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toSDK(message: GetServiceIdentityResponse): GetServiceIdentityResponseSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts index 6dbf0ddb14..326c1009cf 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/log_entry.ts @@ -510,7 +510,7 @@ export const LogEntry = { jsonPayload: isSet(object.jsonPayload) ? Struct.fromJSON(object.jsonPayload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receiveTimestamp: isSet(object.receiveTimestamp) ? new Date(object.receiveTimestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: isSet(object.insertId) ? String(object.insertId) : "", httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -590,7 +590,7 @@ export const LogEntry = { jsonPayload: object.json_payload ? Struct.fromSDK(object.json_payload) : undefined, timestamp: object.timestamp ?? undefined, receiveTimestamp: object.receive_timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object?.insert_id, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -616,7 +616,7 @@ export const LogEntry = { json_payload: isSet(object.json_payload) ? Struct.fromSDKJSON(object.json_payload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receive_timestamp: isSet(object.receive_timestamp) ? new Date(object.receive_timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insert_id: isSet(object.insert_id) ? String(object.insert_id) : "", http_request: isSet(object.http_request) ? HttpRequest.fromSDKJSON(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging.ts index 4f40963774..a954001c40 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging.ts @@ -1765,7 +1765,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromJSON(object: any): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: isSet(object.suppressedCount) ? Number(object.suppressedCount) : 0 }; }, @@ -1783,13 +1783,13 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromSDK(object: TailLogEntriesResponse_SuppressionInfoSDKType): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object?.suppressed_count }; }, fromSDKJSON(object: any): TailLogEntriesResponse_SuppressionInfoSDKType { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressed_count: isSet(object.suppressed_count) ? Number(object.suppressed_count) : 0 }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts index 39f8f31f1a..23601f47b4 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_config.ts @@ -1678,7 +1678,7 @@ export const LogBucket = { updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, retentionDays: isSet(object.retentionDays) ? Number(object.retentionDays) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : 0, + lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : -1, restrictedFields: Array.isArray(object?.restrictedFields) ? object.restrictedFields.map((e: any) => String(e)) : [], cmekSettings: isSet(object.cmekSettings) ? CmekSettings.fromJSON(object.cmekSettings) : undefined }; @@ -1721,7 +1721,7 @@ export const LogBucket = { updateTime: object.update_time ?? undefined, retentionDays: object?.retention_days, locked: object?.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object.cmek_settings ? CmekSettings.fromSDK(object.cmek_settings) : undefined }; @@ -1734,7 +1734,7 @@ export const LogBucket = { update_time: isSet(object.update_time) ? new Date(object.update_time) : undefined, retention_days: isSet(object.retention_days) ? Number(object.retention_days) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycle_state: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycle_state: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restricted_fields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => String(e)) : [], cmek_settings: isSet(object.cmek_settings) ? CmekSettings.fromSDKJSON(object.cmek_settings) : undefined }; @@ -1983,7 +1983,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromJSON(e)) : [], - outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : 0, + outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : -1, writerIdentity: isSet(object.writerIdentity) ? String(object.writerIdentity) : "", includeChildren: isSet(object.includeChildren) ? Boolean(object.includeChildren) : false, bigqueryOptions: isSet(object.bigqueryOptions) ? BigQueryOptions.fromJSON(object.bigqueryOptions) : undefined, @@ -2035,7 +2035,7 @@ export const LogSink = { description: object?.description, disabled: object?.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDK(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object?.writer_identity, includeChildren: object?.include_children, bigqueryOptions: object.bigquery_options ? BigQueryOptions.fromSDK(object.bigquery_options) : undefined, @@ -2051,7 +2051,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDKJSON(e)) : [], - output_version_format: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + output_version_format: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writer_identity: isSet(object.writer_identity) ? String(object.writer_identity) : "", include_children: isSet(object.include_children) ? Boolean(object.include_children) : false, bigquery_options: isSet(object.bigquery_options) ? BigQueryOptions.fromSDKJSON(object.bigquery_options) : undefined, @@ -4825,7 +4825,7 @@ export const CopyLogEntriesMetadata = { return { startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: isSet(object.cancellationRequested) ? Boolean(object.cancellationRequested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, @@ -4858,7 +4858,7 @@ export const CopyLogEntriesMetadata = { return { startTime: object.start_time ?? undefined, endTime: object.end_time ?? undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object?.cancellation_requested, request: object.request ? CopyLogEntriesRequest.fromSDK(object.request) : undefined, progress: object?.progress, @@ -4869,7 +4869,7 @@ export const CopyLogEntriesMetadata = { return { start_time: isSet(object.start_time) ? new Date(object.start_time) : undefined, end_time: isSet(object.end_time) ? new Date(object.end_time) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellation_requested: isSet(object.cancellation_requested) ? Boolean(object.cancellation_requested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromSDKJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, diff --git a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts index 684ef5e255..386fed9a88 100644 --- a/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputosmojs/google/logging/v2/logging_metrics.ts @@ -513,7 +513,7 @@ export const LogMetric = { bucketOptions: isSet(object.bucketOptions) ? Distribution_BucketOptions.fromJSON(object.bucketOptions) : undefined, createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toJSON(message: LogMetric): unknown { @@ -575,7 +575,7 @@ export const LogMetric = { bucketOptions: object.bucket_options ? Distribution_BucketOptions.fromSDK(object.bucket_options) : undefined, createTime: object.create_time ?? undefined, updateTime: object.update_time ?? undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, fromSDKJSON(object: any): LogMetricSDKType { @@ -595,7 +595,7 @@ export const LogMetric = { bucket_options: isSet(object.bucket_options) ? Distribution_BucketOptions.fromSDKJSON(object.bucket_options) : undefined, create_time: isSet(object.create_time) ? new Date(object.create_time) : undefined, update_time: isSet(object.update_time) ? new Date(object.update_time) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toSDK(message: LogMetric): LogMetricSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/protobuf/api.ts b/__fixtures__/v-next/outputosmojs/google/protobuf/api.ts index 0764f6874e..d846ab44e3 100644 --- a/__fixtures__/v-next/outputosmojs/google/protobuf/api.ts +++ b/__fixtures__/v-next/outputosmojs/google/protobuf/api.ts @@ -355,7 +355,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Api): unknown { @@ -400,7 +400,7 @@ export const Api = { version: object?.version, sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): ApiSDKType { @@ -411,7 +411,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDKJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Api): ApiSDKType { @@ -517,7 +517,7 @@ export const Method = { responseTypeUrl: isSet(object.responseTypeUrl) ? String(object.responseTypeUrl) : "", responseStreaming: isSet(object.responseStreaming) ? Boolean(object.responseStreaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Method): unknown { @@ -554,7 +554,7 @@ export const Method = { responseTypeUrl: object?.response_type_url, responseStreaming: object?.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): MethodSDKType { @@ -565,7 +565,7 @@ export const Method = { response_type_url: isSet(object.response_type_url) ? String(object.response_type_url) : "", response_streaming: isSet(object.response_streaming) ? Boolean(object.response_streaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Method): MethodSDKType { diff --git a/__fixtures__/v-next/outputosmojs/google/protobuf/descriptor.ts b/__fixtures__/v-next/outputosmojs/google/protobuf/descriptor.ts index afea9e2978..041e2bc5ab 100644 --- a/__fixtures__/v-next/outputosmojs/google/protobuf/descriptor.ts +++ b/__fixtures__/v-next/outputosmojs/google/protobuf/descriptor.ts @@ -2187,8 +2187,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: isSet(object.typeName) ? String(object.typeName) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", @@ -2229,8 +2229,8 @@ export const FieldDescriptorProto = { return { name: object?.name, number: object?.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object?.type_name, extendee: object?.extendee, defaultValue: object?.default_value, @@ -2243,8 +2243,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, type_name: isSet(object.type_name) ? String(object.type_name) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", default_value: isSet(object.default_value) ? String(object.default_value) : "", @@ -3031,7 +3031,7 @@ export const FileOptions = { javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 0, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : -1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, @@ -3110,7 +3110,7 @@ export const FileOptions = { javaMultipleFiles: object?.java_multiple_files, javaGenerateEqualsAndHash: object?.java_generate_equals_and_hash, javaStringCheckUtf8: object?.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object?.go_package, ccGenericServices: object?.cc_generic_services, javaGenericServices: object?.java_generic_services, @@ -3135,7 +3135,7 @@ export const FileOptions = { java_multiple_files: isSet(object.java_multiple_files) ? Boolean(object.java_multiple_files) : false, java_generate_equals_and_hash: isSet(object.java_generate_equals_and_hash) ? Boolean(object.java_generate_equals_and_hash) : false, java_string_check_utf8: isSet(object.java_string_check_utf8) ? Boolean(object.java_string_check_utf8) : false, - optimize_for: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimize_for: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, go_package: isSet(object.go_package) ? String(object.go_package) : "", cc_generic_services: isSet(object.cc_generic_services) ? Boolean(object.cc_generic_services) : false, java_generic_services: isSet(object.java_generic_services) ? Boolean(object.java_generic_services) : false, @@ -3376,9 +3376,9 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -3413,9 +3413,9 @@ export const FieldOptions = { }, fromSDK(object: FieldOptionsSDKType): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object?.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object?.lazy, deprecated: object?.deprecated, weak: object?.weak, @@ -3424,9 +3424,9 @@ export const FieldOptions = { }, fromSDKJSON(object: any): FieldOptionsSDKType { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -3819,7 +3819,7 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, @@ -3844,14 +3844,14 @@ export const MethodOptions = { fromSDK(object: MethodOptionsSDKType): MethodOptions { return { deprecated: object?.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDK(e)) : [] }; }, fromSDKJSON(object: any): MethodOptionsSDKType { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotency_level: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotency_level: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpreted_option: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputosmojs/google/protobuf/type.ts b/__fixtures__/v-next/outputosmojs/google/protobuf/type.ts index fed71f6fe9..c127b5152c 100644 --- a/__fixtures__/v-next/outputosmojs/google/protobuf/type.ts +++ b/__fixtures__/v-next/outputosmojs/google/protobuf/type.ts @@ -439,7 +439,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Type): unknown { @@ -481,7 +481,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): TypeSDKType { @@ -491,7 +491,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Type): TypeSDKType { @@ -611,8 +611,8 @@ export const Field = { }, fromJSON(object: any): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", @@ -657,8 +657,8 @@ export const Field = { }, fromSDK(object: FieldSDKType): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object?.number, name: object?.name, typeUrl: object?.type_url, @@ -671,8 +671,8 @@ export const Field = { }, fromSDKJSON(object: any): FieldSDKType { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", type_url: isSet(object.type_url) ? String(object.type_url) : "", @@ -765,7 +765,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Enum): unknown { @@ -800,7 +800,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDK(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): EnumSDKType { @@ -809,7 +809,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDKJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Enum): EnumSDKType { diff --git a/__fixtures__/v-next/outputosmojs/ibc/applications/interchain_accounts/v1/packet.ts b/__fixtures__/v-next/outputosmojs/ibc/applications/interchain_accounts/v1/packet.ts index 08a65ae1b5..14b5782cda 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/applications/interchain_accounts/v1/packet.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/applications/interchain_accounts/v1/packet.ts @@ -104,7 +104,7 @@ export const InterchainAccountPacketData = { }, fromJSON(object: any): InterchainAccountPacketData { return { - type: isSet(object.type) ? typeFromJSON(object.type) : 0, + type: isSet(object.type) ? typeFromJSON(object.type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), memo: isSet(object.memo) ? String(object.memo) : "" }; @@ -125,14 +125,14 @@ export const InterchainAccountPacketData = { }, fromSDK(object: InterchainAccountPacketDataSDKType): InterchainAccountPacketData { return { - type: isSet(object.type) ? typeFromJSON(object.type) : 0, + type: isSet(object.type) ? typeFromJSON(object.type) : -1, data: object?.data, memo: object?.memo }; }, fromSDKJSON(object: any): InterchainAccountPacketDataSDKType { return { - type: isSet(object.type) ? typeFromJSON(object.type) : 0, + type: isSet(object.type) ? typeFromJSON(object.type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), memo: isSet(object.memo) ? String(object.memo) : "" }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/applications/transfer/v1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/ibc/applications/transfer/v1/tx.amino.ts index eb26603d66..a03ccde6de 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/applications/transfer/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/applications/transfer/v1/tx.amino.ts @@ -65,8 +65,8 @@ export const AminoConverter = { sender, receiver, timeoutHeight: timeout_height ? { - revisionHeight: BigInt(timeout_height.revision_height || "0", true), - revisionNumber: BigInt(timeout_height.revision_number || "0", true) + revisionHeight: BigInt(timeout_height.revision_height || "0"), + revisionNumber: BigInt(timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(timeout_timestamp) }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/channel.ts b/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/channel.ts index d786bfd493..dc19060387 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/channel.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/channel.ts @@ -337,8 +337,8 @@ export const Channel = { }, fromJSON(object: any): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -368,8 +368,8 @@ export const Channel = { }, fromSDK(object: ChannelSDKType): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version @@ -377,8 +377,8 @@ export const Channel = { }, fromSDKJSON(object: any): ChannelSDKType { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, connection_hops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -471,8 +471,8 @@ export const IdentifiedChannel = { }, fromJSON(object: any): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", @@ -508,8 +508,8 @@ export const IdentifiedChannel = { }, fromSDK(object: IdentifiedChannelSDKType): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version, @@ -519,8 +519,8 @@ export const IdentifiedChannel = { }, fromSDKJSON(object: any): IdentifiedChannelSDKType { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, connection_hops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", diff --git a/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/tx.amino.ts index faf969e232..a2055c9569 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/core/channel/v1/tx.amino.ts @@ -259,8 +259,8 @@ export const AminoConverter = { counterpartyVersion: counterparty_version, proofInit: proof_init, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -306,8 +306,8 @@ export const AminoConverter = { counterpartyVersion: counterparty_version, proofTry: proof_try, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -345,8 +345,8 @@ export const AminoConverter = { channelId: channel_id, proofAck: proof_ack, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -409,8 +409,8 @@ export const AminoConverter = { channelId: channel_id, proofInit: proof_init, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -461,15 +461,15 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofCommitment: proof_commitment, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -523,15 +523,15 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofUnreceived: proof_unreceived, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, nextSequenceRecv: BigInt(next_sequence_recv), signer @@ -589,16 +589,16 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofUnreceived: proof_unreceived, proofClose: proof_close, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, nextSequenceRecv: BigInt(next_sequence_recv), signer @@ -653,16 +653,16 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, acknowledgement, proofAcked: proof_acked, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/connection.ts b/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/connection.ts index 141b94f753..8b0782a361 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/connection.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/connection.ts @@ -261,7 +261,7 @@ export const ConnectionEnd = { return { clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) }; @@ -292,7 +292,7 @@ export const ConnectionEnd = { return { clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -301,7 +301,7 @@ export const ConnectionEnd = { return { client_id: isSet(object.client_id) ? String(object.client_id) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDKJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, delay_period: isSet(object.delay_period) ? BigInt(object.delay_period.toString()) : BigInt(0) }; @@ -389,7 +389,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) }; @@ -423,7 +423,7 @@ export const IdentifiedConnection = { id: object?.id, clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -433,7 +433,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", client_id: isSet(object.client_id) ? String(object.client_id) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDKJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, delay_period: isSet(object.delay_period) ? BigInt(object.delay_period.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/tx.amino.ts b/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/tx.amino.ts index 6b18245ea7..53e0a3765c 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/core/connection/v1/tx.amino.ts @@ -218,15 +218,15 @@ export const AminoConverter = { features: el0.features })), proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, proofInit: proof_init, proofClient: proof_client, proofConsensus: proof_consensus, consensusHeight: consensus_height ? { - revisionHeight: BigInt(consensus_height.revision_height || "0", true), - revisionNumber: BigInt(consensus_height.revision_number || "0", true) + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0") } : undefined, signer }; @@ -295,15 +295,15 @@ export const AminoConverter = { value: client_state.value }, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, proofTry: proof_try, proofClient: proof_client, proofConsensus: proof_consensus, consensusHeight: consensus_height ? { - revisionHeight: BigInt(consensus_height.revision_height || "0", true), - revisionNumber: BigInt(consensus_height.revision_number || "0", true) + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0") } : undefined, signer }; @@ -337,8 +337,8 @@ export const AminoConverter = { connectionId: connection_id, proofAck: proof_ack, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/core/port/v1/query.ts b/__fixtures__/v-next/outputosmojs/ibc/core/port/v1/query.ts index b835988f45..1665018f6e 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/core/port/v1/query.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/core/port/v1/query.ts @@ -96,7 +96,7 @@ export const QueryAppVersionRequest = { return { portId: isSet(object.portId) ? String(object.portId) : "", connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, proposedVersion: isSet(object.proposedVersion) ? String(object.proposedVersion) : "" }; @@ -123,7 +123,7 @@ export const QueryAppVersionRequest = { return { portId: object?.port_id, connectionId: object?.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, proposedVersion: object?.proposed_version }; @@ -132,7 +132,7 @@ export const QueryAppVersionRequest = { return { port_id: isSet(object.port_id) ? String(object.port_id) : "", connection_id: isSet(object.connection_id) ? String(object.connection_id) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, proposed_version: isSet(object.proposed_version) ? String(object.proposed_version) : "" }; diff --git a/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v1/solomachine.ts b/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v1/solomachine.ts index 08c6572e5f..40bdcdcb1e 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v1/solomachine.ts @@ -821,7 +821,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -845,7 +845,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -853,7 +853,7 @@ export const SignatureAndData = { fromSDKJSON(object: any): SignatureAndDataSDKType { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -1002,7 +1002,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1029,7 +1029,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1038,7 +1038,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v2/solomachine.ts b/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v2/solomachine.ts index 0114583a2e..c422514345 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/lightclients/solomachine/v2/solomachine.ts @@ -821,7 +821,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -845,7 +845,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -853,7 +853,7 @@ export const SignatureAndData = { fromSDKJSON(object: any): SignatureAndDataSDKType { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -1002,7 +1002,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1029,7 +1029,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1038,7 +1038,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/query.ts index 27f8c77a33..5155543c80 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/claim/v1beta1/query.ts @@ -441,7 +441,7 @@ export const QueryClaimableForActionRequest = { fromJSON(object: any): QueryClaimableForActionRequest { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toJSON(message: QueryClaimableForActionRequest): unknown { @@ -459,13 +459,13 @@ export const QueryClaimableForActionRequest = { fromSDK(object: QueryClaimableForActionRequestSDKType): QueryClaimableForActionRequest { return { address: object?.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, fromSDKJSON(object: any): QueryClaimableForActionRequestSDKType { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toSDK(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestSDKType { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts index 729277928b..3003f0fd8b 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/genesis.ts @@ -59,7 +59,7 @@ export const GenesisDowntimeEntry = { }, fromJSON(object: any): GenesisDowntimeEntry { return { - duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : 0, + duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, lastDowntime: isSet(object.lastDowntime) ? new Date(object.lastDowntime) : undefined }; }, @@ -77,13 +77,13 @@ export const GenesisDowntimeEntry = { }, fromSDK(object: GenesisDowntimeEntrySDKType): GenesisDowntimeEntry { return { - duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : 0, + duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, lastDowntime: object.last_downtime ?? undefined }; }, fromSDKJSON(object: any): GenesisDowntimeEntrySDKType { return { - duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : 0, + duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, last_downtime: isSet(object.last_downtime) ? new Date(object.last_downtime) : undefined }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/query.ts index 7cb983a54b..0a85c8fac5 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/downtime-detector/v1beta1/query.ts @@ -63,7 +63,7 @@ export const RecoveredSinceDowntimeOfLengthRequest = { }, fromJSON(object: any): RecoveredSinceDowntimeOfLengthRequest { return { - downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : 0, + downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, recovery: isSet(object.recovery) ? Duration.fromJSON(object.recovery) : undefined }; }, @@ -81,13 +81,13 @@ export const RecoveredSinceDowntimeOfLengthRequest = { }, fromSDK(object: RecoveredSinceDowntimeOfLengthRequestSDKType): RecoveredSinceDowntimeOfLengthRequest { return { - downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : 0, + downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, recovery: object.recovery ? Duration.fromSDK(object.recovery) : undefined }; }, fromSDKJSON(object: any): RecoveredSinceDowntimeOfLengthRequestSDKType { return { - downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : 0, + downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, recovery: isSet(object.recovery) ? Duration.fromSDKJSON(object.recovery) : undefined }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts index 31ea1413de..200072bec9 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/lockup/lock.ts @@ -332,7 +332,7 @@ export const QueryCondition = { }, fromJSON(object: any): QueryCondition { return { - lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : 0, + lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined @@ -356,7 +356,7 @@ export const QueryCondition = { }, fromSDK(object: QueryConditionSDKType): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object?.denom, duration: object.duration ? Duration.fromSDK(object.duration) : undefined, timestamp: object.timestamp ?? undefined @@ -364,7 +364,7 @@ export const QueryCondition = { }, fromSDKJSON(object: any): QueryConditionSDKType { return { - lock_query_type: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lock_query_type: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromSDKJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined diff --git a/__fixtures__/v-next/outputosmojs/osmosis/poolmanager/v1beta1/module_route.ts b/__fixtures__/v-next/outputosmojs/osmosis/poolmanager/v1beta1/module_route.ts index 9c74f5368d..41b673f1b5 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/poolmanager/v1beta1/module_route.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/poolmanager/v1beta1/module_route.ts @@ -117,7 +117,7 @@ export const ModuleRoute = { }, fromJSON(object: any): ModuleRoute { return { - poolType: isSet(object.poolType) ? poolTypeFromJSON(object.poolType) : 0, + poolType: isSet(object.poolType) ? poolTypeFromJSON(object.poolType) : -1, poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : undefined }; }, @@ -135,13 +135,13 @@ export const ModuleRoute = { }, fromSDK(object: ModuleRouteSDKType): ModuleRoute { return { - poolType: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : 0, + poolType: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : -1, poolId: object?.pool_id }; }, fromSDKJSON(object: any): ModuleRouteSDKType { return { - pool_type: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : 0, + pool_type: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : -1, pool_id: isSet(object.pool_id) ? BigInt(object.pool_id.toString()) : undefined }; }, diff --git a/__fixtures__/v-next/outputosmojs/osmosis/superfluid/query.ts b/__fixtures__/v-next/outputosmojs/osmosis/superfluid/query.ts index 46b9027db1..2dfc4455ca 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/superfluid/query.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/superfluid/query.ts @@ -414,7 +414,7 @@ export const AssetTypeResponse = { }, fromJSON(object: any): AssetTypeResponse { return { - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: AssetTypeResponse): unknown { @@ -429,12 +429,12 @@ export const AssetTypeResponse = { }, fromSDK(object: AssetTypeResponseSDKType): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, fromSDKJSON(object: any): AssetTypeResponseSDKType { return { - asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: AssetTypeResponse): AssetTypeResponseSDKType { diff --git a/__fixtures__/v-next/outputosmojs/osmosis/superfluid/superfluid.ts b/__fixtures__/v-next/outputosmojs/osmosis/superfluid/superfluid.ts index 2383859b6b..d5ddc42ead 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/superfluid/superfluid.ts @@ -186,7 +186,7 @@ export const SuperfluidAsset = { fromJSON(object: any): SuperfluidAsset { return { denom: isSet(object.denom) ? String(object.denom) : "", - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: SuperfluidAsset): unknown { @@ -204,13 +204,13 @@ export const SuperfluidAsset = { fromSDK(object: SuperfluidAssetSDKType): SuperfluidAsset { return { denom: object?.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, fromSDKJSON(object: any): SuperfluidAssetSDKType { return { denom: isSet(object.denom) ? String(object.denom) : "", - asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: SuperfluidAsset): SuperfluidAssetSDKType { diff --git a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts index 8ca768d27d..371fe174b1 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/abci/types.ts @@ -1623,7 +1623,7 @@ export const RequestCheckTx = { fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toJSON(message: RequestCheckTx): unknown { @@ -1641,13 +1641,13 @@ export const RequestCheckTx = { fromSDK(object: RequestCheckTxSDKType): RequestCheckTx { return { tx: object?.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, fromSDKJSON(object: any): RequestCheckTxSDKType { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toSDK(message: RequestCheckTx): RequestCheckTxSDKType { @@ -3642,7 +3642,7 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toJSON(message: ResponseOfferSnapshot): unknown { @@ -3657,12 +3657,12 @@ export const ResponseOfferSnapshot = { }, fromSDK(object: ResponseOfferSnapshotSDKType): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, fromSDKJSON(object: any): ResponseOfferSnapshotSDKType { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toSDK(message: ResponseOfferSnapshot): ResponseOfferSnapshotSDKType { @@ -3785,7 +3785,7 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [] }; @@ -3814,14 +3814,14 @@ export const ResponseApplySnapshotChunk = { }, fromSDK(object: ResponseApplySnapshotChunkSDKType): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; }, fromSDKJSON(object: any): ResponseApplySnapshotChunkSDKType { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetch_chunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => Number(e)) : [], reject_senders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => String(e)) : [] }; @@ -4639,7 +4639,7 @@ export const Evidence = { }, fromJSON(object: any): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? new Date(object.time) : undefined, @@ -4666,7 +4666,7 @@ export const Evidence = { }, fromSDK(object: EvidenceSDKType): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object.validator ? Validator.fromSDK(object.validator) : undefined, height: object?.height, time: object.time ?? undefined, @@ -4675,7 +4675,7 @@ export const Evidence = { }, fromSDKJSON(object: any): EvidenceSDKType { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromSDKJSON(object.validator) : undefined, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? new Date(object.time) : undefined, diff --git a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts index 1e8ea1d1cc..c70f63302a 100644 --- a/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputosmojs/tendermint/types/types.ts @@ -905,7 +905,7 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, @@ -941,7 +941,7 @@ export const Vote = { }, fromSDK(object: VoteSDKType): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, blockId: object.block_id ? BlockID.fromSDK(object.block_id) : undefined, @@ -953,7 +953,7 @@ export const Vote = { }, fromSDKJSON(object: any): VoteSDKType { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, block_id: isSet(object.block_id) ? BlockID.fromSDKJSON(object.block_id) : undefined, @@ -1135,7 +1135,7 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1159,7 +1159,7 @@ export const CommitSig = { }, fromSDK(object: CommitSigSDKType): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object?.validator_address, timestamp: object.timestamp ?? undefined, signature: object?.signature @@ -1167,7 +1167,7 @@ export const CommitSig = { }, fromSDKJSON(object: any): CommitSigSDKType { return { - block_id_flag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + block_id_flag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validator_address: isSet(object.validator_address) ? bytesFromBase64(object.validator_address) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1255,7 +1255,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, @@ -1288,7 +1288,7 @@ export const Proposal = { }, fromSDK(object: ProposalSDKType): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, polRound: object?.pol_round, @@ -1299,7 +1299,7 @@ export const Proposal = { }, fromSDKJSON(object: any): ProposalSDKType { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, pol_round: isSet(object.pol_round) ? Number(object.pol_round) : 0, diff --git a/__fixtures__/v-next/outputv2/akash/base/v1beta1/endpoint.ts b/__fixtures__/v-next/outputv2/akash/base/v1beta1/endpoint.ts index d196609988..92bca98d83 100644 --- a/__fixtures__/v-next/outputv2/akash/base/v1beta1/endpoint.ts +++ b/__fixtures__/v-next/outputv2/akash/base/v1beta1/endpoint.ts @@ -88,7 +88,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toJSON(message: Endpoint): unknown { @@ -103,7 +103,7 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toSDK(message: Endpoint): EndpointSDKType { @@ -113,7 +113,7 @@ export const Endpoint = { }, fromAmino(object: EndpointAmino): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toAmino(message: Endpoint): EndpointAmino { diff --git a/__fixtures__/v-next/outputv2/akash/base/v1beta2/endpoint.ts b/__fixtures__/v-next/outputv2/akash/base/v1beta2/endpoint.ts index b30a202dd1..ed9175d47a 100644 --- a/__fixtures__/v-next/outputv2/akash/base/v1beta2/endpoint.ts +++ b/__fixtures__/v-next/outputv2/akash/base/v1beta2/endpoint.ts @@ -105,7 +105,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 }; }, @@ -123,7 +123,7 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object?.sequence_number }; }, @@ -135,7 +135,7 @@ export const Endpoint = { }, fromAmino(object: EndpointAmino): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object.sequence_number }; }, diff --git a/__fixtures__/v-next/outputv2/akash/cert/v1beta2/cert.ts b/__fixtures__/v-next/outputv2/akash/cert/v1beta2/cert.ts index af60f313ea..22a5ff94ce 100644 --- a/__fixtures__/v-next/outputv2/akash/cert/v1beta2/cert.ts +++ b/__fixtures__/v-next/outputv2/akash/cert/v1beta2/cert.ts @@ -333,7 +333,7 @@ export const Certificate = { }, fromJSON(object: any): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; @@ -354,7 +354,7 @@ export const Certificate = { }, fromSDK(object: CertificateSDKType): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object?.cert, pubkey: object?.pubkey }; @@ -368,7 +368,7 @@ export const Certificate = { }, fromAmino(object: CertificateAmino): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object.cert, pubkey: object.pubkey }; diff --git a/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/deployment.ts b/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/deployment.ts index be6377c866..00917f9cae 100644 --- a/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/deployment.ts +++ b/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/deployment.ts @@ -1112,7 +1112,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -1136,7 +1136,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -1152,7 +1152,7 @@ export const Deployment = { fromAmino(object: DeploymentAmino): Deployment { return { deploymentId: object?.deployment_id ? DeploymentID.fromAmino(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object.version, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/group.ts b/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/group.ts index 80a8a220cf..c0a87a79dc 100644 --- a/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/group.ts +++ b/__fixtures__/v-next/outputv2/akash/deployment/v1beta1/group.ts @@ -985,7 +985,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -1009,7 +1009,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -1025,7 +1025,7 @@ export const Group = { fromAmino(object: GroupAmino): Group { return { groupId: object?.group_id ? GroupID.fromAmino(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object?.group_spec ? GroupSpec.fromAmino(object.group_spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/deployment.ts b/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/deployment.ts index e386e5e40c..8d5df8d297 100644 --- a/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/deployment.ts +++ b/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/deployment.ts @@ -270,7 +270,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -294,7 +294,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -310,7 +310,7 @@ export const Deployment = { fromAmino(object: DeploymentAmino): Deployment { return { deploymentId: object?.deployment_id ? DeploymentID.fromAmino(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object.version, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/group.ts b/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/group.ts index 406938fafa..e2c4cc54a4 100644 --- a/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/group.ts +++ b/__fixtures__/v-next/outputv2/akash/deployment/v1beta2/group.ts @@ -142,7 +142,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -166,7 +166,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -182,7 +182,7 @@ export const Group = { fromAmino(object: GroupAmino): Group { return { groupId: object?.group_id ? GroupID.fromAmino(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object?.group_spec ? GroupSpec.fromAmino(object.group_spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/akash/escrow/v1beta1/types.ts b/__fixtures__/v-next/outputv2/akash/escrow/v1beta1/types.ts index 4634afcef6..5da7666363 100644 --- a/__fixtures__/v-next/outputv2/akash/escrow/v1beta1/types.ts +++ b/__fixtures__/v-next/outputv2/akash/escrow/v1beta1/types.ts @@ -372,7 +372,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? Long.fromValue(object.settledAt) : Long.ZERO @@ -402,7 +402,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, transferred: object.transferred ? Coin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at @@ -422,7 +422,7 @@ export const Account = { return { id: object?.id ? AccountID.fromAmino(object.id) : undefined, owner: object.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object?.balance ? Coin.fromAmino(object.balance) : undefined, transferred: object?.transferred ? Coin.fromAmino(object.transferred) : undefined, settledAt: Long.fromString(object.settled_at) @@ -531,7 +531,7 @@ export const Payment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -564,7 +564,7 @@ export const Payment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object.rate ? Coin.fromSDK(object.rate) : undefined, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -586,7 +586,7 @@ export const Payment = { accountId: object?.account_id ? AccountID.fromAmino(object.account_id) : undefined, paymentId: object.payment_id, owner: object.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object?.rate ? Coin.fromAmino(object.rate) : undefined, balance: object?.balance ? Coin.fromAmino(object.balance) : undefined, withdrawn: object?.withdrawn ? Coin.fromAmino(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv2/akash/escrow/v1beta2/types.ts b/__fixtures__/v-next/outputv2/akash/escrow/v1beta2/types.ts index e615cbc1a8..727207e63a 100644 --- a/__fixtures__/v-next/outputv2/akash/escrow/v1beta2/types.ts +++ b/__fixtures__/v-next/outputv2/akash/escrow/v1beta2/types.ts @@ -410,7 +410,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? Long.fromValue(object.settledAt) : Long.ZERO, @@ -446,7 +446,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, transferred: object.transferred ? DecCoin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at, @@ -470,7 +470,7 @@ export const Account = { return { id: object?.id ? AccountID.fromAmino(object.id) : undefined, owner: object.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object?.balance ? DecCoin.fromAmino(object.balance) : undefined, transferred: object?.transferred ? DecCoin.fromAmino(object.transferred) : undefined, settledAt: Long.fromString(object.settled_at), @@ -583,7 +583,7 @@ export const FractionalPayment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -616,7 +616,7 @@ export const FractionalPayment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object.rate ? DecCoin.fromSDK(object.rate) : undefined, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -638,7 +638,7 @@ export const FractionalPayment = { accountId: object?.account_id ? AccountID.fromAmino(object.account_id) : undefined, paymentId: object.payment_id, owner: object.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object?.rate ? DecCoin.fromAmino(object.rate) : undefined, balance: object?.balance ? DecCoin.fromAmino(object.balance) : undefined, withdrawn: object?.withdrawn ? Coin.fromAmino(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv2/akash/market/v1beta2/bid.ts b/__fixtures__/v-next/outputv2/akash/market/v1beta2/bid.ts index 32ff34d6fb..2f59b73472 100644 --- a/__fixtures__/v-next/outputv2/akash/market/v1beta2/bid.ts +++ b/__fixtures__/v-next/outputv2/akash/market/v1beta2/bid.ts @@ -762,7 +762,7 @@ export const Bid = { fromJSON(object: any): Bid { return { bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -786,7 +786,7 @@ export const Bid = { fromSDK(object: BidSDKType): Bid { return { bidId: object.bid_id ? BidID.fromSDK(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at }; @@ -802,7 +802,7 @@ export const Bid = { fromAmino(object: BidAmino): Bid { return { bidId: object?.bid_id ? BidID.fromAmino(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object?.price ? DecCoin.fromAmino(object.price) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/akash/market/v1beta2/lease.ts b/__fixtures__/v-next/outputv2/akash/market/v1beta2/lease.ts index b88d837bca..396b563e44 100644 --- a/__fixtures__/v-next/outputv2/akash/market/v1beta2/lease.ts +++ b/__fixtures__/v-next/outputv2/akash/market/v1beta2/lease.ts @@ -451,7 +451,7 @@ export const Lease = { fromJSON(object: any): Lease { return { leaseId: isSet(object.leaseId) ? LeaseID.fromJSON(object.leaseId) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO, closedOn: isSet(object.closedOn) ? Long.fromValue(object.closedOn) : Long.ZERO @@ -478,7 +478,7 @@ export const Lease = { fromSDK(object: LeaseSDKType): Lease { return { leaseId: object.lease_id ? LeaseID.fromSDK(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at, closedOn: object?.closed_on @@ -496,7 +496,7 @@ export const Lease = { fromAmino(object: LeaseAmino): Lease { return { leaseId: object?.lease_id ? LeaseID.fromAmino(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object?.price ? DecCoin.fromAmino(object.price) : undefined, createdAt: Long.fromString(object.created_at), closedOn: Long.fromString(object.closed_on) diff --git a/__fixtures__/v-next/outputv2/akash/market/v1beta2/order.ts b/__fixtures__/v-next/outputv2/akash/market/v1beta2/order.ts index d8a8acde6a..599cb1856b 100644 --- a/__fixtures__/v-next/outputv2/akash/market/v1beta2/order.ts +++ b/__fixtures__/v-next/outputv2/akash/market/v1beta2/order.ts @@ -318,7 +318,7 @@ export const Order = { fromJSON(object: any): Order { return { orderId: isSet(object.orderId) ? OrderID.fromJSON(object.orderId) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -342,7 +342,7 @@ export const Order = { fromSDK(object: OrderSDKType): Order { return { orderId: object.order_id ? OrderID.fromSDK(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object.spec ? GroupSpec.fromSDK(object.spec) : undefined, createdAt: object?.created_at }; @@ -358,7 +358,7 @@ export const Order = { fromAmino(object: OrderAmino): Order { return { orderId: object?.order_id ? OrderID.fromAmino(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object?.spec ? GroupSpec.fromAmino(object.spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv2/confio/proofs.ts b/__fixtures__/v-next/outputv2/confio/proofs.ts index b15b2bf2a1..0ac5bf37c1 100644 --- a/__fixtures__/v-next/outputv2/confio/proofs.ts +++ b/__fixtures__/v-next/outputv2/confio/proofs.ts @@ -1181,10 +1181,10 @@ export const LeafOp = { }, fromJSON(object: any): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -1208,10 +1208,10 @@ export const LeafOp = { }, fromSDK(object: LeafOpSDKType): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object?.prefix }; }, @@ -1226,10 +1226,10 @@ export const LeafOp = { }, fromAmino(object: LeafOpAmino): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object.prefix }; }, @@ -1304,7 +1304,7 @@ export const InnerOp = { }, fromJSON(object: any): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -1325,7 +1325,7 @@ export const InnerOp = { }, fromSDK(object: InnerOpSDKType): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object?.prefix, suffix: object?.suffix }; @@ -1339,7 +1339,7 @@ export const InnerOp = { }, fromAmino(object: InnerOpAmino): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object.prefix, suffix: object.suffix }; @@ -1571,7 +1571,7 @@ export const InnerSpec = { minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toJSON(message: InnerSpec): unknown { @@ -1605,7 +1605,7 @@ export const InnerSpec = { minPrefixLength: object?.min_prefix_length, maxPrefixLength: object?.max_prefix_length, emptyChild: object?.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toSDK(message: InnerSpec): InnerSpecSDKType { @@ -1629,7 +1629,7 @@ export const InnerSpec = { minPrefixLength: object.min_prefix_length, maxPrefixLength: object.max_prefix_length, emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toAmino(message: InnerSpec): InnerSpecAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts index e5a1223ff2..f56ed54dd9 100644 --- a/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv2/cosmos/authz/v1beta1/authz.ts @@ -309,13 +309,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object?.expiration }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -437,7 +437,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object.expiration }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -445,7 +445,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts index 523f13c424..e674054b60 100644 --- a/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv2/cosmos/evidence/v1beta1/evidence.ts @@ -135,7 +135,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, power: Long.fromString(object.power), consensusAddress: object.consensus_address }; @@ -143,7 +143,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts index fee8feac68..b05067adfc 100644 --- a/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv2/cosmos/feegrant/v1beta1/feegrant.ts @@ -264,7 +264,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object.expiration }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -274,7 +274,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { @@ -425,7 +425,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: object?.period_reset ? Timestamp.fromAmino(object.period_reset) : undefined + periodReset: object.period_reset }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -442,7 +442,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset ? Timestamp.toAmino(message.periodReset) : undefined; + obj.period_reset = message.periodReset; return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts index 153d8fdabf..7312735a24 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1/gov.ts @@ -464,7 +464,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -482,7 +482,7 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, @@ -494,7 +494,7 @@ export const WeightedVoteOption = { }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object.weight }; }, @@ -752,7 +752,7 @@ export const Proposal = { return { id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -802,7 +802,7 @@ export const Proposal = { return { id: object?.id, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -838,13 +838,13 @@ export const Proposal = { return { id: Long.fromString(object.id), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, + submitTime: object.submit_time, + depositEndTime: object.deposit_end_time, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined, + votingStartTime: object.voting_start_time, + votingEndTime: object.voting_end_time, metadata: object.metadata }; }, @@ -858,15 +858,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; - obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; + obj.submit_time = message.submitTime; + obj.deposit_end_time = message.depositEndTime; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; - obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; + obj.voting_start_time = message.votingStartTime; + obj.voting_end_time = message.votingEndTime; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1/query.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1/query.ts index 16333f5fd5..28ea92cc2f 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1/query.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1/query.ts @@ -654,7 +654,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -678,7 +678,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -694,7 +694,7 @@ export const QueryProposalsRequest = { }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object.voter, depositor: object.depositor, pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1/tx.ts index 05caa1e76e..7918b1888f 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1/tx.ts @@ -722,7 +722,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, @@ -746,7 +746,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata }; }, @@ -762,7 +762,7 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata }; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts index 116ec93019..2ac7dd7138 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/gov.ts @@ -524,7 +524,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -542,7 +542,7 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, @@ -554,7 +554,7 @@ export const WeightedVoteOption = { }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object.weight }; }, @@ -907,7 +907,7 @@ export const Proposal = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -950,7 +950,7 @@ export const Proposal = { return { proposalId: object?.proposal_id, content: object.content ? Any.fromSDK(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -980,13 +980,13 @@ export const Proposal = { return { proposalId: Long.fromString(object.proposal_id), content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, + submitTime: object.submit_time, + depositEndTime: object.deposit_end_time, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined + votingStartTime: object.voting_start_time, + votingEndTime: object.voting_end_time }; }, toAmino(message: Proposal): ProposalAmino { @@ -995,15 +995,15 @@ export const Proposal = { obj.content = message.content ? ProposalContentI_ToAmino((message.content as Any)) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; - obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; + obj.submit_time = message.submitTime; + obj.deposit_end_time = message.depositEndTime; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; - obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; + obj.voting_start_time = message.votingStartTime; + obj.voting_end_time = message.votingEndTime; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1214,7 +1214,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, @@ -1242,7 +1242,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDK(e)) : [] }; }, @@ -1262,7 +1262,7 @@ export const Vote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/query.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/query.ts index 159564eced..77799b15c4 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/query.ts @@ -654,7 +654,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -678,7 +678,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -694,7 +694,7 @@ export const QueryProposalsRequest = { }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object.voter, depositor: object.depositor, pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/tx.ts index 6a1ba4ca4b..aeb77b7b9a 100644 --- a/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/gov/v1beta1/tx.ts @@ -476,7 +476,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -497,7 +497,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { @@ -511,7 +511,7 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toAmino(message: MsgVote): MsgVoteAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/group/v1/events.ts b/__fixtures__/v-next/outputv2/cosmos/group/v1/events.ts index add421333c..e2d4e2cd39 100644 --- a/__fixtures__/v-next/outputv2/cosmos/group/v1/events.ts +++ b/__fixtures__/v-next/outputv2/cosmos/group/v1/events.ts @@ -867,7 +867,7 @@ export const EventExec = { fromJSON(object: any): EventExec { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toJSON(message: EventExec): unknown { @@ -885,7 +885,7 @@ export const EventExec = { fromSDK(object: EventExecSDKType): EventExec { return { proposalId: object?.proposal_id, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toSDK(message: EventExec): EventExecSDKType { @@ -897,7 +897,7 @@ export const EventExec = { fromAmino(object: EventExecAmino): EventExec { return { proposalId: Long.fromString(object.proposal_id), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toAmino(message: EventExec): EventExecAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/group/v1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/group/v1/tx.ts index 04e1a8b1de..7fa663f037 100644 --- a/__fixtures__/v-next/outputv2/cosmos/group/v1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/group/v1/tx.ts @@ -2686,7 +2686,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgSubmitProposal): unknown { @@ -2721,7 +2721,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object?.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgSubmitProposal): MsgSubmitProposalSDKType { @@ -2747,7 +2747,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { @@ -3112,9 +3112,9 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -3139,9 +3139,9 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { @@ -3157,9 +3157,9 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toAmino(message: MsgVote): MsgVoteAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts index 2a63aab6f7..66b839b270 100644 --- a/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv2/cosmos/group/v1/types.ts @@ -854,7 +854,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object?.added_at ? Timestamp.fromAmino(object.added_at) : undefined + addedAt: object.added_at }; }, toAmino(message: Member): MemberAmino { @@ -862,7 +862,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt ? Timestamp.toAmino(message.addedAt) : undefined; + obj.added_at = message.addedAt; return obj; }, fromAminoMsg(object: MemberAminoMsg): Member { @@ -1416,7 +1416,7 @@ export const GroupInfo = { metadata: object.metadata, version: Long.fromString(object.version), totalWeight: object.total_weight, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined + createdAt: object.created_at }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1426,7 +1426,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; + obj.created_at = message.createdAt; return obj; }, fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { @@ -1689,7 +1689,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: Long.fromString(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined + createdAt: object.created_at }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1700,7 +1700,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; - obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; + obj.created_at = message.createdAt; return obj; }, fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { @@ -1849,11 +1849,11 @@ export const Proposal = { submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, groupVersion: isSet(object.groupVersion) ? Long.fromValue(object.groupVersion) : Long.UZERO, groupPolicyVersion: isSet(object.groupPolicyVersion) ? Long.fromValue(object.groupPolicyVersion) : Long.UZERO, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, votingPeriodEnd: isSet(object.votingPeriodEnd) ? new Date(object.votingPeriodEnd) : undefined, - executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : 0, + executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -1908,11 +1908,11 @@ export const Proposal = { submitTime: object.submit_time ?? undefined, groupVersion: object?.group_version, groupPolicyVersion: object?.group_policy_version, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, votingPeriodEnd: object.voting_period_end ?? undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -1947,14 +1947,14 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, + submitTime: object.submit_time, groupVersion: Long.fromString(object.group_version), groupPolicyVersion: Long.fromString(object.group_policy_version), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + 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: object?.voting_period_end ? Timestamp.fromAmino(object.voting_period_end) : undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + votingPeriodEnd: object.voting_period_end, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; }, @@ -1968,13 +1968,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; + obj.submit_time = message.submitTime; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(message.votingPeriodEnd) : undefined; + obj.voting_period_end = message.votingPeriodEnd; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2198,7 +2198,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined }; @@ -2225,7 +2225,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, submitTime: object.submit_time ?? undefined }; @@ -2243,9 +2243,9 @@ export const Vote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined + submitTime: object.submit_time }; }, toAmino(message: Vote): VoteAmino { @@ -2254,7 +2254,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; + obj.submit_time = message.submitTime; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { diff --git a/__fixtures__/v-next/outputv2/cosmos/orm/v1alpha1/schema.ts b/__fixtures__/v-next/outputv2/cosmos/orm/v1alpha1/schema.ts index 33590e3330..d9a4f10c54 100644 --- a/__fixtures__/v-next/outputv2/cosmos/orm/v1alpha1/schema.ts +++ b/__fixtures__/v-next/outputv2/cosmos/orm/v1alpha1/schema.ts @@ -334,7 +334,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: isSet(object.id) ? Number(object.id) : 0, protoFileName: isSet(object.protoFileName) ? String(object.protoFileName) : "", - storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : 0 + storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : -1 }; }, toJSON(message: ModuleSchemaDescriptor_FileEntry): unknown { @@ -355,7 +355,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object?.id, protoFileName: object?.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toSDK(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntrySDKType { @@ -369,7 +369,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object.id, protoFileName: object.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toAmino(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts index dd78b110ae..d8bebd54da 100644 --- a/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv2/cosmos/slashing/v1beta1/slashing.ts @@ -230,7 +230,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: Long.fromString(object.start_height), indexOffset: Long.fromString(object.index_offset), - jailedUntil: object?.jailed_until ? Timestamp.fromAmino(object.jailed_until) : undefined, + jailedUntil: object.jailed_until, tombstoned: object.tombstoned, missedBlocksCounter: Long.fromString(object.missed_blocks_counter) }; @@ -240,7 +240,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(message.jailedUntil) : undefined; + obj.jailed_until = message.jailedUntil; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/authz.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/authz.ts index fe1fa42208..da59dbc969 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/authz.ts @@ -193,7 +193,7 @@ export const StakeAuthorization = { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0 + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : -1 }; }, toJSON(message: StakeAuthorization): unknown { @@ -217,7 +217,7 @@ export const StakeAuthorization = { maxTokens: object.max_tokens ? Coin.fromSDK(object.max_tokens) : undefined, allowList: object.allow_list ? StakeAuthorization_Validators.fromSDK(object.allow_list) : undefined, denyList: object.deny_list ? StakeAuthorization_Validators.fromSDK(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toSDK(message: StakeAuthorization): StakeAuthorizationSDKType { @@ -233,7 +233,7 @@ export const StakeAuthorization = { maxTokens: object?.max_tokens ? Coin.fromAmino(object.max_tokens) : undefined, allowList: object?.allow_list ? StakeAuthorization_Validators.fromAmino(object.allow_list) : undefined, denyList: object?.deny_list ? StakeAuthorization_Validators.fromAmino(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toAmino(message: StakeAuthorization): StakeAuthorizationAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts index 7e15c6eea8..9285a9a504 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/staking.ts @@ -1130,13 +1130,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + updateTime: object.update_time }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1411,7 +1411,7 @@ export const Validator = { operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, @@ -1456,7 +1456,7 @@ export const Validator = { operatorAddress: object?.operator_address, consensusPubkey: object.consensus_pubkey ? Any.fromSDK(object.consensus_pubkey) : undefined, jailed: object?.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object?.tokens, delegatorShares: object?.delegator_shares, description: object.description ? Description.fromSDK(object.description) : undefined, @@ -1489,12 +1489,12 @@ export const Validator = { value: toBase64(object.consensus_pubkey.value) }, "cosmos"), jailed: object.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object.tokens, delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: Long.fromString(object.unbonding_height), - unbondingTime: object?.unbonding_time ? Timestamp.fromAmino(object.unbonding_time) : undefined, + unbondingTime: object.unbonding_time, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1512,7 +1512,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(message.unbondingTime) : undefined; + obj.unbonding_time = message.unbondingTime; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2396,7 +2396,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, + completionTime: object.completion_time, initialBalance: object.initial_balance, balance: object.balance }; @@ -2404,7 +2404,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2526,7 +2526,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, + completionTime: object.completion_time, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2534,7 +2534,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts index d8f6c6338f..7b669ef0a5 100644 --- a/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/staking/v1beta1/tx.ts @@ -1101,12 +1101,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined + completionTime: object.completion_time }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1305,12 +1305,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined + completionTime: object.completion_time }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputv2/cosmos/tx/signing/v1beta1/signing.ts b/__fixtures__/v-next/outputv2/cosmos/tx/signing/v1beta1/signing.ts index 0ae1d45be6..19e6c7afa2 100644 --- a/__fixtures__/v-next/outputv2/cosmos/tx/signing/v1beta1/signing.ts +++ b/__fixtures__/v-next/outputv2/cosmos/tx/signing/v1beta1/signing.ts @@ -602,7 +602,7 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, @@ -620,7 +620,7 @@ export const SignatureDescriptor_Data_Single = { }, fromSDK(object: SignatureDescriptor_Data_SingleSDKType): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object?.signature }; }, @@ -632,7 +632,7 @@ export const SignatureDescriptor_Data_Single = { }, fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object.signature }; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/service.ts b/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/service.ts index d83be4ea3f..7fd71fb04a 100644 --- a/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/service.ts +++ b/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/service.ts @@ -534,7 +534,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0 + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1 }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -559,7 +559,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toSDK(message: GetTxsEventRequest): GetTxsEventRequestSDKType { @@ -577,7 +577,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { @@ -794,7 +794,7 @@ export const BroadcastTxRequest = { fromJSON(object: any): BroadcastTxRequest { return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toJSON(message: BroadcastTxRequest): unknown { @@ -812,7 +812,7 @@ export const BroadcastTxRequest = { fromSDK(object: BroadcastTxRequestSDKType): BroadcastTxRequest { return { txBytes: object?.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toSDK(message: BroadcastTxRequest): BroadcastTxRequestSDKType { @@ -824,7 +824,7 @@ export const BroadcastTxRequest = { fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { return { txBytes: object.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { diff --git a/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/tx.ts b/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/tx.ts index 6f28e6c0c4..1a86dd6978 100644 --- a/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv2/cosmos/tx/v1beta1/tx.ts @@ -1861,7 +1861,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1876,7 +1876,7 @@ export const ModeInfo_Single = { }, fromSDK(object: ModeInfo_SingleSDKType): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toSDK(message: ModeInfo_Single): ModeInfo_SingleSDKType { @@ -1886,7 +1886,7 @@ export const ModeInfo_Single = { }, fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { @@ -2342,7 +2342,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -2366,7 +2366,7 @@ export const AuxSignerData = { return { address: object?.address, signDoc: object.sign_doc ? SignDocDirectAux.fromSDK(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object?.sig }; }, @@ -2382,7 +2382,7 @@ export const AuxSignerData = { return { address: object.address, signDoc: object?.sign_doc ? SignDocDirectAux.fromAmino(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object.sig }; }, diff --git a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts index bbeebe680a..97dc260fd9 100644 --- a/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv2/cosmos/upgrade/v1beta1/upgrade.ts @@ -326,7 +326,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, height: Long.fromString(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -335,7 +335,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputv2/cosmwasm/wasm/v1/types.ts b/__fixtures__/v-next/outputv2/cosmwasm/wasm/v1/types.ts index 44244ba8ee..ae3e9b5030 100644 --- a/__fixtures__/v-next/outputv2/cosmwasm/wasm/v1/types.ts +++ b/__fixtures__/v-next/outputv2/cosmwasm/wasm/v1/types.ts @@ -408,7 +408,7 @@ export const AccessTypeParam = { }, fromJSON(object: any): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toJSON(message: AccessTypeParam): unknown { @@ -423,7 +423,7 @@ export const AccessTypeParam = { }, fromSDK(object: AccessTypeParamSDKType): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toSDK(message: AccessTypeParam): AccessTypeParamSDKType { @@ -433,7 +433,7 @@ export const AccessTypeParam = { }, fromAmino(object: AccessTypeParamAmino): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toAmino(message: AccessTypeParam): AccessTypeParamAmino { @@ -503,7 +503,7 @@ export const AccessConfig = { }, fromJSON(object: any): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -521,7 +521,7 @@ export const AccessConfig = { }, fromSDK(object: AccessConfigSDKType): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object?.address }; }, @@ -533,7 +533,7 @@ export const AccessConfig = { }, fromAmino(object: AccessConfigAmino): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object.address }; }, @@ -613,7 +613,7 @@ export const Params = { fromJSON(object: any): Params { return { codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, - instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : 0, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : -1, maxWasmCodeSize: isSet(object.maxWasmCodeSize) ? Long.fromValue(object.maxWasmCodeSize) : Long.UZERO }; }, @@ -634,7 +634,7 @@ export const Params = { fromSDK(object: ParamsSDKType): Params { return { codeUploadAccess: object.code_upload_access ? AccessConfig.fromSDK(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: object?.max_wasm_code_size }; }, @@ -648,7 +648,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { codeUploadAccess: object?.code_upload_access ? AccessConfig.fromAmino(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: Long.fromString(object.max_wasm_code_size) }; }, @@ -1023,7 +1023,7 @@ export const ContractCodeHistoryEntry = { }, fromJSON(object: any): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: isSet(object.codeId) ? Long.fromValue(object.codeId) : Long.UZERO, updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() @@ -1047,7 +1047,7 @@ export const ContractCodeHistoryEntry = { }, fromSDK(object: ContractCodeHistoryEntrySDKType): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: object?.code_id, updated: object.updated ? AbsoluteTxPosition.fromSDK(object.updated) : undefined, msg: object?.msg @@ -1063,7 +1063,7 @@ export const ContractCodeHistoryEntry = { }, fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: Long.fromString(object.code_id), updated: object?.updated ? AbsoluteTxPosition.fromAmino(object.updated) : undefined, msg: toUtf8(JSON.stringify(object.msg)) diff --git a/__fixtures__/v-next/outputv2/evmos/claims/v1/claims.ts b/__fixtures__/v-next/outputv2/evmos/claims/v1/claims.ts index c0a88f077d..e004efb28e 100644 --- a/__fixtures__/v-next/outputv2/evmos/claims/v1/claims.ts +++ b/__fixtures__/v-next/outputv2/evmos/claims/v1/claims.ts @@ -212,7 +212,7 @@ export const Claim = { }, fromJSON(object: any): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimableAmount: isSet(object.claimableAmount) ? String(object.claimableAmount) : "" }; @@ -233,7 +233,7 @@ export const Claim = { }, fromSDK(object: ClaimSDKType): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object?.completed, claimableAmount: object?.claimable_amount }; @@ -247,7 +247,7 @@ export const Claim = { }, fromAmino(object: ClaimAmino): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object.completed, claimableAmount: object.claimable_amount }; diff --git a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts index ed7e66e75c..61b7529b61 100644 --- a/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/claims/v1/genesis.ts @@ -342,7 +342,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object?.airdrop_start_time ? Timestamp.fromAmino(object.airdrop_start_time) : undefined, + airdropStartTime: object.airdrop_start_time, 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, @@ -353,7 +353,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(message.airdropStartTime) : undefined; + obj.airdrop_start_time = message.airdropStartTime; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts index b0a9fdd5b3..b99e4fb298 100644 --- a/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv2/evmos/epochs/v1/genesis.ts @@ -188,10 +188,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: Long.fromString(object.current_epoch), - currentEpochStartTime: object?.current_epoch_start_time ? Timestamp.fromAmino(object.current_epoch_start_time) : undefined, + currentEpochStartTime: object.current_epoch_start_time, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: Long.fromString(object.current_epoch_start_height) }; @@ -199,10 +199,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(message.currentEpochStartTime) : undefined; + obj.current_epoch_start_time = message.currentEpochStartTime; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/evmos/erc20/v1/erc20.ts b/__fixtures__/v-next/outputv2/evmos/erc20/v1/erc20.ts index acc78ca745..71ff04ce36 100644 --- a/__fixtures__/v-next/outputv2/evmos/erc20/v1/erc20.ts +++ b/__fixtures__/v-next/outputv2/evmos/erc20/v1/erc20.ts @@ -275,7 +275,7 @@ export const TokenPair = { erc20Address: isSet(object.erc20Address) ? String(object.erc20Address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : 0 + contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : -1 }; }, toJSON(message: TokenPair): unknown { @@ -299,7 +299,7 @@ export const TokenPair = { erc20Address: object?.erc20_address, denom: object?.denom, enabled: object?.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toSDK(message: TokenPair): TokenPairSDKType { @@ -315,7 +315,7 @@ export const TokenPair = { erc20Address: object.erc20_address, denom: object.denom, enabled: object.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toAmino(message: TokenPair): TokenPairAmino { diff --git a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts index 0254e0f096..01bce4baea 100644 --- a/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv2/evmos/incentives/v1/incentives.ts @@ -276,7 +276,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, totalGas: Long.fromString(object.total_gas) }; }, @@ -289,7 +289,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts index 20cd21cc68..dc3be7dab2 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/tx.ts @@ -289,7 +289,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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 @@ -299,7 +299,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts index a77509ba1b..884085935c 100644 --- a/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv2/evmos/vesting/v1/vesting.ts @@ -189,7 +189,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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)) : [] }; @@ -198,7 +198,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/google/api/backend.ts b/__fixtures__/v-next/outputv2/google/api/backend.ts index 3bbe90f6d5..620d5e02d3 100644 --- a/__fixtures__/v-next/outputv2/google/api/backend.ts +++ b/__fixtures__/v-next/outputv2/google/api/backend.ts @@ -500,7 +500,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, minDeadline: isSet(object.minDeadline) ? Number(object.minDeadline) : 0, operationDeadline: isSet(object.operationDeadline) ? Number(object.operationDeadline) : 0, - pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : 0, + pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : -1, jwtAudience: isSet(object.jwtAudience) ? String(object.jwtAudience) : undefined, disableAuth: isSet(object.disableAuth) ? Boolean(object.disableAuth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" @@ -539,7 +539,7 @@ export const BackendRule = { deadline: object?.deadline, minDeadline: object?.min_deadline, operationDeadline: object?.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object?.protocol @@ -565,7 +565,7 @@ export const BackendRule = { deadline: object.deadline, minDeadline: object.min_deadline, operationDeadline: object.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object.protocol diff --git a/__fixtures__/v-next/outputv2/google/api/config_change.ts b/__fixtures__/v-next/outputv2/google/api/config_change.ts index 5c221f5f68..61cb9da111 100644 --- a/__fixtures__/v-next/outputv2/google/api/config_change.ts +++ b/__fixtures__/v-next/outputv2/google/api/config_change.ts @@ -263,7 +263,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", oldValue: isSet(object.oldValue) ? String(object.oldValue) : "", newValue: isSet(object.newValue) ? String(object.newValue) : "", - changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : 0, + changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [] }; }, @@ -294,7 +294,7 @@ export const ConfigChange = { element: object?.element, oldValue: object?.old_value, newValue: object?.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDK(e)) : [] }; }, @@ -316,7 +316,7 @@ export const ConfigChange = { element: object.element, oldValue: object.old_value, newValue: object.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv2/google/api/consumer.ts b/__fixtures__/v-next/outputv2/google/api/consumer.ts index 245de23c85..1fc8feba69 100644 --- a/__fixtures__/v-next/outputv2/google/api/consumer.ts +++ b/__fixtures__/v-next/outputv2/google/api/consumer.ts @@ -335,7 +335,7 @@ export const Property = { fromJSON(object: any): Property { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -356,7 +356,7 @@ export const Property = { fromSDK(object: PropertySDKType): Property { return { name: object?.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object?.description }; }, @@ -370,7 +370,7 @@ export const Property = { fromAmino(object: PropertyAmino): Property { return { name: object.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object.description }; }, diff --git a/__fixtures__/v-next/outputv2/google/api/distribution.ts b/__fixtures__/v-next/outputv2/google/api/distribution.ts index 3dcbd89c88..f9e04dc486 100644 --- a/__fixtures__/v-next/outputv2/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv2/google/api/distribution.ts @@ -1359,14 +1359,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv2/google/api/expr/conformance/v1alpha1/conformance_service.ts b/__fixtures__/v-next/outputv2/google/api/expr/conformance/v1alpha1/conformance_service.ts index a3fd97c1a9..21904ca403 100644 --- a/__fixtures__/v-next/outputv2/google/api/expr/conformance/v1alpha1/conformance_service.ts +++ b/__fixtures__/v-next/outputv2/google/api/expr/conformance/v1alpha1/conformance_service.ts @@ -1236,7 +1236,7 @@ export const IssueDetails = { }, fromJSON(object: any): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromJSON(object.position) : undefined, id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO }; @@ -1257,7 +1257,7 @@ export const IssueDetails = { }, fromSDK(object: IssueDetailsSDKType): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object.position ? SourcePosition.fromSDK(object.position) : undefined, id: object?.id }; @@ -1271,7 +1271,7 @@ export const IssueDetails = { }, fromAmino(object: IssueDetailsAmino): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object?.position ? SourcePosition.fromAmino(object.position) : undefined, id: Long.fromString(object.id) }; diff --git a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts index ae29733de8..3096e87e9b 100644 --- a/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv2/google/api/expr/v1alpha1/syntax.ts @@ -2131,7 +2131,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value ? Timestamp.fromAmino(object.timestamp_value) : undefined + timestampValue: object?.timestamp_value }; }, toAmino(message: Constant): ConstantAmino { @@ -2144,7 +2144,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(message.timestampValue) : undefined; + obj.timestamp_value = message.timestampValue; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { diff --git a/__fixtures__/v-next/outputv2/google/api/label.ts b/__fixtures__/v-next/outputv2/google/api/label.ts index 178db58c52..566006d8ed 100644 --- a/__fixtures__/v-next/outputv2/google/api/label.ts +++ b/__fixtures__/v-next/outputv2/google/api/label.ts @@ -122,7 +122,7 @@ export const LabelDescriptor = { fromJSON(object: any): LabelDescriptor { return { key: isSet(object.key) ? String(object.key) : "", - valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : 0, + valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -143,7 +143,7 @@ export const LabelDescriptor = { fromSDK(object: LabelDescriptorSDKType): LabelDescriptor { return { key: object?.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object?.description }; }, @@ -157,7 +157,7 @@ export const LabelDescriptor = { fromAmino(object: LabelDescriptorAmino): LabelDescriptor { return { key: object.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object.description }; }, diff --git a/__fixtures__/v-next/outputv2/google/api/metric.ts b/__fixtures__/v-next/outputv2/google/api/metric.ts index 26caaf3fdb..81ffa331ee 100644 --- a/__fixtures__/v-next/outputv2/google/api/metric.ts +++ b/__fixtures__/v-next/outputv2/google/api/metric.ts @@ -727,13 +727,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : 0, - valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : 0, + metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : -1, + valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", displayName: isSet(object.displayName) ? String(object.displayName) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromJSON(object.metadata) : undefined, - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, monitoredResourceTypes: Array.isArray(object?.monitoredResourceTypes) ? object.monitoredResourceTypes.map((e: any) => String(e)) : [] }; }, @@ -780,13 +780,13 @@ export const MetricDescriptor = { name: object?.name, type: object?.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object?.unit, description: object?.description, displayName: object?.display_name, metadata: object.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromSDK(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -818,13 +818,13 @@ export const MetricDescriptor = { name: object.name, type: object.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromAmino(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object.unit, description: object.description, displayName: object.display_name, metadata: object?.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromAmino(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -913,7 +913,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromJSON(object: any): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, samplePeriod: isSet(object.samplePeriod) ? Duration.fromJSON(object.samplePeriod) : undefined, ingestDelay: isSet(object.ingestDelay) ? Duration.fromJSON(object.ingestDelay) : undefined }; @@ -934,7 +934,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromSDK(object: MetricDescriptor_MetricDescriptorMetadataSDKType): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object.sample_period ? Duration.fromSDK(object.sample_period) : undefined, ingestDelay: object.ingest_delay ? Duration.fromSDK(object.ingest_delay) : undefined }; @@ -948,7 +948,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromAmino(object: MetricDescriptor_MetricDescriptorMetadataAmino): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object?.sample_period ? Duration.fromAmino(object.sample_period) : undefined, ingestDelay: object?.ingest_delay ? Duration.fromAmino(object.ingest_delay) : undefined }; diff --git a/__fixtures__/v-next/outputv2/google/api/monitored_resource.ts b/__fixtures__/v-next/outputv2/google/api/monitored_resource.ts index ce2366fe98..d8965159e4 100644 --- a/__fixtures__/v-next/outputv2/google/api/monitored_resource.ts +++ b/__fixtures__/v-next/outputv2/google/api/monitored_resource.ts @@ -404,7 +404,7 @@ export const MonitoredResourceDescriptor = { displayName: isSet(object.displayName) ? String(object.displayName) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0 + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1 }; }, toJSON(message: MonitoredResourceDescriptor): unknown { @@ -438,7 +438,7 @@ export const MonitoredResourceDescriptor = { displayName: object?.display_name, description: object?.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toSDK(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorSDKType { @@ -462,7 +462,7 @@ export const MonitoredResourceDescriptor = { displayName: object.display_name, description: object.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromAmino(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toAmino(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorAmino { diff --git a/__fixtures__/v-next/outputv2/google/api/resource.ts b/__fixtures__/v-next/outputv2/google/api/resource.ts index 4302a28fb5..8f44975d27 100644 --- a/__fixtures__/v-next/outputv2/google/api/resource.ts +++ b/__fixtures__/v-next/outputv2/google/api/resource.ts @@ -615,7 +615,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], nameField: isSet(object.nameField) ? String(object.nameField) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -656,7 +656,7 @@ export const ResourceDescriptor = { type: object?.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object?.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object?.plural, singular: object?.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -686,7 +686,7 @@ export const ResourceDescriptor = { type: object.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object.plural, singular: object.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/check_error.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/check_error.ts index fb36d804cb..f84fb7ac3a 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/check_error.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/check_error.ts @@ -312,7 +312,7 @@ export const CheckError = { }, fromJSON(object: any): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -336,7 +336,7 @@ export const CheckError = { }, fromSDK(object: CheckErrorSDKType): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object?.subject, detail: object?.detail, status: object.status ? Status.fromSDK(object.status) : undefined @@ -352,7 +352,7 @@ export const CheckError = { }, fromAmino(object: CheckErrorAmino): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object.subject, detail: object.detail, status: object?.status ? Status.fromAmino(object.status) : undefined diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts index 74a99bd2be..d375ddb6ad 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/log_entry.ts @@ -513,7 +513,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insertId: isSet(object.insertId) ? String(object.insertId) : "", @@ -578,7 +578,7 @@ export const LogEntry = { return { name: object?.name, timestamp: object.timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, trace: object?.trace, insertId: object?.insert_id, @@ -619,8 +619,8 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + timestamp: object.timestamp, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, insertId: object.insert_id, @@ -640,7 +640,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts index 885228ba82..65381585fe 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/metric_value.ts @@ -423,8 +423,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + startTime: object.start_time, + endTime: object.end_time, boolValue: object?.bool_value, int64Value: object?.int64_value ? Long.fromString(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -440,8 +440,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts index a9fd382b51..6785af1667 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/operation.ts @@ -456,7 +456,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metricValueSets) ? object.metricValueSets.map((e: any) => MetricValueSet.fromJSON(e)) : [], logEntries: Array.isArray(object?.logEntries) ? object.logEntries.map((e: any) => LogEntry.fromJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -527,7 +527,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDK(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDK(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -567,8 +567,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + startTime: object.start_time, + endTime: object.end_time, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -577,7 +577,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromAmino(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromAmino(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromAmino(e)) : [] }; }, @@ -586,8 +586,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/quota_controller.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/quota_controller.ts index d206ca043d..e54ac17549 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/quota_controller.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/quota_controller.ts @@ -776,7 +776,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quotaMetrics) ? object.quotaMetrics.map((e: any) => MetricValueSet.fromJSON(e)) : [], - quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : 0 + quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : -1 }; }, toJSON(message: QuotaOperation): unknown { @@ -827,7 +827,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDK(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toSDK(message: QuotaOperation): QuotaOperationSDKType { @@ -861,7 +861,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromAmino(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toAmino(message: QuotaOperation): QuotaOperationAmino { @@ -1099,7 +1099,7 @@ export const QuotaError = { }, fromJSON(object: any): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -1123,7 +1123,7 @@ export const QuotaError = { }, fromSDK(object: QuotaErrorSDKType): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object?.subject, description: object?.description, status: object.status ? Status.fromSDK(object.status) : undefined @@ -1139,7 +1139,7 @@ export const QuotaError = { }, fromAmino(object: QuotaErrorAmino): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object.subject, description: object.description, status: object?.status ? Status.fromAmino(object.status) : undefined diff --git a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/service_controller.ts b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/service_controller.ts index 2876925def..246eaa490c 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/service_controller.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicecontrol/v1/service_controller.ts @@ -886,7 +886,7 @@ export const CheckResponse_ConsumerInfo = { fromJSON(object: any): CheckResponse_ConsumerInfo { return { projectNumber: isSet(object.projectNumber) ? Long.fromValue(object.projectNumber) : Long.ZERO, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: isSet(object.consumerNumber) ? Long.fromValue(object.consumerNumber) : Long.ZERO }; }, @@ -907,7 +907,7 @@ export const CheckResponse_ConsumerInfo = { fromSDK(object: CheckResponse_ConsumerInfoSDKType): CheckResponse_ConsumerInfo { return { projectNumber: object?.project_number, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: object?.consumer_number }; }, @@ -921,7 +921,7 @@ export const CheckResponse_ConsumerInfo = { fromAmino(object: CheckResponse_ConsumerInfoAmino): CheckResponse_ConsumerInfo { return { projectNumber: Long.fromString(object.project_number), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: Long.fromString(object.consumer_number) }; }, diff --git a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts index c13c261410..bec7505240 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/resources.ts @@ -1040,7 +1040,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined + startTime: object.start_time }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -1056,7 +1056,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; return obj; }, fromAminoMsg(object: OperationMetadataAminoMsg): OperationMetadata { @@ -1115,7 +1115,7 @@ export const OperationMetadata_Step = { fromJSON(object: any): OperationMetadata_Step { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toJSON(message: OperationMetadata_Step): unknown { @@ -1133,7 +1133,7 @@ export const OperationMetadata_Step = { fromSDK(object: OperationMetadata_StepSDKType): OperationMetadata_Step { return { description: object?.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toSDK(message: OperationMetadata_Step): OperationMetadata_StepSDKType { @@ -1145,7 +1145,7 @@ export const OperationMetadata_Step = { fromAmino(object: OperationMetadata_StepAmino): OperationMetadata_Step { return { description: object.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toAmino(message: OperationMetadata_Step): OperationMetadata_StepAmino { @@ -1217,7 +1217,7 @@ export const Diagnostic = { fromJSON(object: any): Diagnostic { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -1238,7 +1238,7 @@ export const Diagnostic = { fromSDK(object: DiagnosticSDKType): Diagnostic { return { location: object?.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object?.message }; }, @@ -1252,7 +1252,7 @@ export const Diagnostic = { fromAmino(object: DiagnosticAmino): Diagnostic { return { location: object.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object.message }; }, @@ -1434,7 +1434,7 @@ export const ConfigFile = { return { filePath: isSet(object.filePath) ? String(object.filePath) : "", fileContents: isSet(object.fileContents) ? bytesFromBase64(object.fileContents) : new Uint8Array(), - fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : 0 + fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : -1 }; }, toJSON(message: ConfigFile): unknown { @@ -1455,7 +1455,7 @@ export const ConfigFile = { return { filePath: object?.file_path, fileContents: object?.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toSDK(message: ConfigFile): ConfigFileSDKType { @@ -1469,7 +1469,7 @@ export const ConfigFile = { return { filePath: object.file_path, fileContents: object.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toAmino(message: ConfigFile): ConfigFileAmino { @@ -1746,7 +1746,7 @@ export const Rollout = { rolloutId: isSet(object.rolloutId) ? String(object.rolloutId) : "", createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, createdBy: isSet(object.createdBy) ? String(object.createdBy) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: isSet(object.trafficPercentStrategy) ? Rollout_TrafficPercentStrategy.fromJSON(object.trafficPercentStrategy) : undefined, deleteServiceStrategy: isSet(object.deleteServiceStrategy) ? Rollout_DeleteServiceStrategy.fromJSON(object.deleteServiceStrategy) : undefined, serviceName: isSet(object.serviceName) ? String(object.serviceName) : "" @@ -1779,7 +1779,7 @@ export const Rollout = { rolloutId: object?.rollout_id, createTime: object.create_time ?? undefined, createdBy: object?.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromSDK(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromSDK(object.delete_service_strategy) : undefined, serviceName: object?.service_name @@ -1799,9 +1799,9 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, + createTime: object.create_time, createdBy: object.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object?.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromAmino(object.delete_service_strategy) : undefined, serviceName: object.service_name @@ -1810,7 +1810,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; + obj.create_time = message.createTime; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/servicemanager.ts b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/servicemanager.ts index fe1ad3351d..23546c12f5 100644 --- a/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/servicemanager.ts +++ b/__fixtures__/v-next/outputv2/google/api/servicemanagement/v1/servicemanager.ts @@ -1433,7 +1433,7 @@ export const GetServiceConfigRequest = { return { serviceName: isSet(object.serviceName) ? String(object.serviceName) : "", configId: isSet(object.configId) ? String(object.configId) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toJSON(message: GetServiceConfigRequest): unknown { @@ -1454,7 +1454,7 @@ export const GetServiceConfigRequest = { return { serviceName: object?.service_name, configId: object?.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toSDK(message: GetServiceConfigRequest): GetServiceConfigRequestSDKType { @@ -1468,7 +1468,7 @@ export const GetServiceConfigRequest = { return { serviceName: object.service_name, configId: object.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toAmino(message: GetServiceConfigRequest): GetServiceConfigRequestAmino { diff --git a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/resources.ts b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/resources.ts index f5aae209cd..2cf5f80535 100644 --- a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/resources.ts +++ b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/resources.ts @@ -316,7 +316,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -340,7 +340,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { @@ -356,7 +356,7 @@ export const Service = { name: object.name, parent: object.parent, config: object?.config ? ServiceConfig.fromAmino(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toAmino(message: Service): ServiceAmino { diff --git a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/serviceusage.ts b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/serviceusage.ts index 86a8005949..de735e9c48 100644 --- a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/serviceusage.ts +++ b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1/serviceusage.ts @@ -781,7 +781,7 @@ export const DisableServiceRequest = { return { name: isSet(object.name) ? String(object.name) : "", disableDependentServices: isSet(object.disableDependentServices) ? Boolean(object.disableDependentServices) : false, - checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : 0 + checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : -1 }; }, toJSON(message: DisableServiceRequest): unknown { @@ -802,7 +802,7 @@ export const DisableServiceRequest = { return { name: object?.name, disableDependentServices: object?.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toSDK(message: DisableServiceRequest): DisableServiceRequestSDKType { @@ -816,7 +816,7 @@ export const DisableServiceRequest = { return { name: object.name, disableDependentServices: object.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toAmino(message: DisableServiceRequest): DisableServiceRequestAmino { diff --git a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/resources.ts b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/resources.ts index e21df986ed..9597ede05e 100644 --- a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/resources.ts +++ b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/resources.ts @@ -1130,7 +1130,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -1154,7 +1154,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { @@ -1170,7 +1170,7 @@ export const Service = { name: object.name, parent: object.parent, config: object?.config ? ServiceConfig.fromAmino(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toAmino(message: Service): ServiceAmino { diff --git a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/serviceusage.ts b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/serviceusage.ts index 4677319257..72e2ccab4f 100644 --- a/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/serviceusage.ts +++ b/__fixtures__/v-next/outputv2/google/api/serviceusage/v1beta1/serviceusage.ts @@ -2201,7 +2201,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0, pageToken: isSet(object.pageToken) ? String(object.pageToken) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: ListConsumerQuotaMetricsRequest): unknown { @@ -2225,7 +2225,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object?.parent, pageSize: object?.page_size, pageToken: object?.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestSDKType { @@ -2241,7 +2241,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object.parent, pageSize: object.page_size, pageToken: object.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestAmino { @@ -2415,7 +2415,7 @@ export const GetConsumerQuotaMetricRequest = { fromJSON(object: any): GetConsumerQuotaMetricRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaMetricRequest): unknown { @@ -2433,7 +2433,7 @@ export const GetConsumerQuotaMetricRequest = { fromSDK(object: GetConsumerQuotaMetricRequestSDKType): GetConsumerQuotaMetricRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestSDKType { @@ -2445,7 +2445,7 @@ export const GetConsumerQuotaMetricRequest = { fromAmino(object: GetConsumerQuotaMetricRequestAmino): GetConsumerQuotaMetricRequest { return { name: object.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestAmino { @@ -2510,7 +2510,7 @@ export const GetConsumerQuotaLimitRequest = { fromJSON(object: any): GetConsumerQuotaLimitRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaLimitRequest): unknown { @@ -2528,7 +2528,7 @@ export const GetConsumerQuotaLimitRequest = { fromSDK(object: GetConsumerQuotaLimitRequestSDKType): GetConsumerQuotaLimitRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestSDKType { @@ -2540,7 +2540,7 @@ export const GetConsumerQuotaLimitRequest = { fromAmino(object: GetConsumerQuotaLimitRequestAmino): GetConsumerQuotaLimitRequest { return { name: object.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestAmino { @@ -5113,7 +5113,7 @@ export const GetServiceIdentityResponse = { fromJSON(object: any): GetServiceIdentityResponse { return { identity: isSet(object.identity) ? ServiceIdentity.fromJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toJSON(message: GetServiceIdentityResponse): unknown { @@ -5131,7 +5131,7 @@ export const GetServiceIdentityResponse = { fromSDK(object: GetServiceIdentityResponseSDKType): GetServiceIdentityResponse { return { identity: object.identity ? ServiceIdentity.fromSDK(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toSDK(message: GetServiceIdentityResponse): GetServiceIdentityResponseSDKType { @@ -5143,7 +5143,7 @@ export const GetServiceIdentityResponse = { fromAmino(object: GetServiceIdentityResponseAmino): GetServiceIdentityResponse { return { identity: object?.identity ? ServiceIdentity.fromAmino(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toAmino(message: GetServiceIdentityResponse): GetServiceIdentityResponseAmino { diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts index 971359386c..0780ac3f87 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/log_entry.ts @@ -785,7 +785,7 @@ export const LogEntry = { jsonPayload: isSet(object.jsonPayload) ? Struct.fromJSON(object.jsonPayload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receiveTimestamp: isSet(object.receiveTimestamp) ? new Date(object.receiveTimestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: isSet(object.insertId) ? String(object.insertId) : "", httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -865,7 +865,7 @@ export const LogEntry = { jsonPayload: object.json_payload ? Struct.fromSDK(object.json_payload) : undefined, timestamp: object.timestamp ?? undefined, receiveTimestamp: object.receive_timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object?.insert_id, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -915,9 +915,9 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - receiveTimestamp: object?.receive_timestamp ? Timestamp.fromAmino(object.receive_timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + timestamp: object.timestamp, + receiveTimestamp: object.receive_timestamp, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -941,8 +941,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; - obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(message.receiveTimestamp) : undefined; + obj.timestamp = message.timestamp; + obj.receive_timestamp = message.receiveTimestamp; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging.ts index 47c2a15ce7..a61c4a3326 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging.ts @@ -2580,7 +2580,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromJSON(object: any): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: isSet(object.suppressedCount) ? Number(object.suppressedCount) : 0 }; }, @@ -2598,7 +2598,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromSDK(object: TailLogEntriesResponse_SuppressionInfoSDKType): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object?.suppressed_count }; }, @@ -2610,7 +2610,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromAmino(object: TailLogEntriesResponse_SuppressionInfoAmino): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object.suppressed_count }; }, diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts index edf371ba15..9bc5cf9995 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_config.ts @@ -3127,7 +3127,7 @@ export const LogBucket = { updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, retentionDays: isSet(object.retentionDays) ? Number(object.retentionDays) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : 0, + lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : -1, restrictedFields: Array.isArray(object?.restrictedFields) ? object.restrictedFields.map((e: any) => String(e)) : [], cmekSettings: isSet(object.cmekSettings) ? CmekSettings.fromJSON(object.cmekSettings) : undefined }; @@ -3170,7 +3170,7 @@ export const LogBucket = { updateTime: object.update_time ?? undefined, retentionDays: object?.retention_days, locked: object?.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object.cmek_settings ? CmekSettings.fromSDK(object.cmek_settings) : undefined }; @@ -3196,11 +3196,11 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, retentionDays: object.retention_days, locked: object.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object?.cmek_settings ? CmekSettings.fromAmino(object.cmek_settings) : undefined }; @@ -3209,8 +3209,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -3345,8 +3345,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, filter: object.filter }; }, @@ -3354,8 +3354,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.filter = message.filter; return obj; }, @@ -3490,7 +3490,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromJSON(e)) : [], - outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : 0, + outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : -1, writerIdentity: isSet(object.writerIdentity) ? String(object.writerIdentity) : "", includeChildren: isSet(object.includeChildren) ? Boolean(object.includeChildren) : false, bigqueryOptions: isSet(object.bigqueryOptions) ? BigQueryOptions.fromJSON(object.bigqueryOptions) : undefined, @@ -3542,7 +3542,7 @@ export const LogSink = { description: object?.description, disabled: object?.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDK(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object?.writer_identity, includeChildren: object?.include_children, bigqueryOptions: object.bigquery_options ? BigQueryOptions.fromSDK(object.bigquery_options) : undefined, @@ -3578,12 +3578,12 @@ export const LogSink = { description: object.description, disabled: object.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromAmino(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + createTime: object.create_time, + updateTime: object.update_time }; }, toAmino(message: LogSink): LogSinkAmino { @@ -3602,8 +3602,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: LogSinkAminoMsg): LogSink { @@ -5721,8 +5721,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + createTime: object.create_time, + updateTime: object.update_time }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -5731,8 +5731,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: LogExclusionAminoMsg): LogExclusion { @@ -7144,7 +7144,7 @@ export const CopyLogEntriesMetadata = { return { startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: isSet(object.cancellationRequested) ? Boolean(object.cancellationRequested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, @@ -7177,7 +7177,7 @@ export const CopyLogEntriesMetadata = { return { startTime: object.start_time ?? undefined, endTime: object.end_time ?? undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object?.cancellation_requested, request: object.request ? CopyLogEntriesRequest.fromSDK(object.request) : undefined, progress: object?.progress, @@ -7197,9 +7197,9 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + startTime: object.start_time, + endTime: object.end_time, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, progress: object.progress, @@ -7208,8 +7208,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts index aab59d8cb8..41969ee7e4 100644 --- a/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv2/google/logging/v2/logging_metrics.ts @@ -816,7 +816,7 @@ export const LogMetric = { bucketOptions: isSet(object.bucketOptions) ? Distribution_BucketOptions.fromJSON(object.bucketOptions) : undefined, createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toJSON(message: LogMetric): unknown { @@ -878,7 +878,7 @@ export const LogMetric = { bucketOptions: object.bucket_options ? Distribution_BucketOptions.fromSDK(object.bucket_options) : undefined, createTime: object.create_time ?? undefined, updateTime: object.update_time ?? undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toSDK(message: LogMetric): LogMetricSDKType { @@ -916,9 +916,9 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + createTime: object.create_time, + updateTime: object.update_time, + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toAmino(message: LogMetric): LogMetricAmino { @@ -936,8 +936,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputv2/google/protobuf/api.ts b/__fixtures__/v-next/outputv2/google/protobuf/api.ts index 473c83cb32..234e6c70bd 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/api.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/api.ts @@ -539,7 +539,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Api): unknown { @@ -584,7 +584,7 @@ export const Api = { version: object?.version, sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Api): ApiSDKType { @@ -618,7 +618,7 @@ export const Api = { version: object.version, sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromAmino(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Api): ApiAmino { @@ -740,7 +740,7 @@ export const Method = { responseTypeUrl: isSet(object.responseTypeUrl) ? String(object.responseTypeUrl) : "", responseStreaming: isSet(object.responseStreaming) ? Boolean(object.responseStreaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Method): unknown { @@ -777,7 +777,7 @@ export const Method = { responseTypeUrl: object?.response_type_url, responseStreaming: object?.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Method): MethodSDKType { @@ -803,7 +803,7 @@ export const Method = { responseTypeUrl: object.response_type_url, responseStreaming: object.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Method): MethodAmino { diff --git a/__fixtures__/v-next/outputv2/google/protobuf/descriptor.ts b/__fixtures__/v-next/outputv2/google/protobuf/descriptor.ts index 3c691713fe..ad2f6fae8c 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/descriptor.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/descriptor.ts @@ -3324,8 +3324,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: isSet(object.typeName) ? String(object.typeName) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", @@ -3366,8 +3366,8 @@ export const FieldDescriptorProto = { return { name: object?.name, number: object?.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object?.type_name, extendee: object?.extendee, defaultValue: object?.default_value, @@ -3394,8 +3394,8 @@ export const FieldDescriptorProto = { return { name: object.name, number: object.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object.type_name, extendee: object.extendee, defaultValue: object.default_value, @@ -4355,7 +4355,7 @@ export const FileOptions = { javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 0, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : -1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, @@ -4434,7 +4434,7 @@ export const FileOptions = { javaMultipleFiles: object?.java_multiple_files, javaGenerateEqualsAndHash: object?.java_generate_equals_and_hash, javaStringCheckUtf8: object?.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object?.go_package, ccGenericServices: object?.cc_generic_services, javaGenericServices: object?.java_generic_services, @@ -4488,7 +4488,7 @@ export const FileOptions = { javaMultipleFiles: object.java_multiple_files, javaGenerateEqualsAndHash: object.java_generate_equals_and_hash, javaStringCheckUtf8: object.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object.go_package, ccGenericServices: object.cc_generic_services, javaGenericServices: object.java_generic_services, @@ -4774,9 +4774,9 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -4811,9 +4811,9 @@ export const FieldOptions = { }, fromSDK(object: FieldOptionsSDKType): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object?.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object?.lazy, deprecated: object?.deprecated, weak: object?.weak, @@ -4837,9 +4837,9 @@ export const FieldOptions = { }, fromAmino(object: FieldOptionsAmino): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object.lazy, deprecated: object.deprecated, weak: object.weak, @@ -5352,7 +5352,7 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, @@ -5377,7 +5377,7 @@ export const MethodOptions = { fromSDK(object: MethodOptionsSDKType): MethodOptions { return { deprecated: object?.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDK(e)) : [] }; }, @@ -5395,7 +5395,7 @@ export const MethodOptions = { fromAmino(object: MethodOptionsAmino): MethodOptions { return { deprecated: object.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts index 78a4175c12..b4a69e888a 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/timestamp.ts @@ -1,4 +1,4 @@ -import { Long, isSet, DeepPartial } from "../../helpers"; +import { Long, isSet, DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; /** @@ -349,16 +349,10 @@ export const Timestamp = { return obj; }, fromAmino(object: TimestampAmino): Timestamp { - return { - seconds: Long.fromString(object.seconds), - nanos: object.nanos - }; + return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - const obj: any = {}; - obj.seconds = message.seconds ? message.seconds.toString() : undefined; - obj.nanos = message.nanos; - return obj; + return fromTimestamp(message).toString(); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv2/google/protobuf/type.ts b/__fixtures__/v-next/outputv2/google/protobuf/type.ts index eed6aabaac..e4af245774 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/type.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/type.ts @@ -569,7 +569,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Type): unknown { @@ -611,7 +611,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Type): TypeSDKType { @@ -643,7 +643,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Type): TypeAmino { @@ -779,8 +779,8 @@ export const Field = { }, fromJSON(object: any): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", @@ -825,8 +825,8 @@ export const Field = { }, fromSDK(object: FieldSDKType): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object?.number, name: object?.name, typeUrl: object?.type_url, @@ -857,8 +857,8 @@ export const Field = { }, fromAmino(object: FieldAmino): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object.number, name: object.name, typeUrl: object.type_url, @@ -967,7 +967,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Enum): unknown { @@ -1002,7 +1002,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDK(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Enum): EnumSDKType { @@ -1028,7 +1028,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromAmino(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Enum): EnumAmino { diff --git a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts index 63c9d2f6e2..54b48cd50c 100644 --- a/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv2/google/rpc/context/attribute_context.ts @@ -2070,7 +2070,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, size: Long.fromString(object.size), protocol: object.protocol, reason: object.reason, @@ -2091,7 +2091,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2348,7 +2348,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2362,7 +2362,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2830,9 +2830,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, - deleteTime: object?.delete_time ? Timestamp.fromAmino(object.delete_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, + deleteTime: object.delete_time, etag: object.etag, location: object.location }; @@ -2856,9 +2856,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; - obj.delete_time = message.deleteTime ? Timestamp.toAmino(message.deleteTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; + obj.delete_time = message.deleteTime; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputv2/ibc/core/channel/v1/channel.ts b/__fixtures__/v-next/outputv2/ibc/core/channel/v1/channel.ts index 290b0681d0..e4dc135ae2 100644 --- a/__fixtures__/v-next/outputv2/ibc/core/channel/v1/channel.ts +++ b/__fixtures__/v-next/outputv2/ibc/core/channel/v1/channel.ts @@ -491,8 +491,8 @@ export const Channel = { }, fromJSON(object: any): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -522,8 +522,8 @@ export const Channel = { }, fromSDK(object: ChannelSDKType): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version @@ -544,8 +544,8 @@ export const Channel = { }, fromAmino(object: ChannelAmino): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object.version @@ -661,8 +661,8 @@ export const IdentifiedChannel = { }, fromJSON(object: any): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", @@ -698,8 +698,8 @@ export const IdentifiedChannel = { }, fromSDK(object: IdentifiedChannelSDKType): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version, @@ -724,8 +724,8 @@ export const IdentifiedChannel = { }, fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object.version, diff --git a/__fixtures__/v-next/outputv2/ibc/core/connection/v1/connection.ts b/__fixtures__/v-next/outputv2/ibc/core/connection/v1/connection.ts index 799c26cd2f..cbc16e00ce 100644 --- a/__fixtures__/v-next/outputv2/ibc/core/connection/v1/connection.ts +++ b/__fixtures__/v-next/outputv2/ibc/core/connection/v1/connection.ts @@ -412,7 +412,7 @@ export const ConnectionEnd = { return { clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? Long.fromValue(object.delayPeriod) : Long.UZERO }; @@ -443,7 +443,7 @@ export const ConnectionEnd = { return { clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -465,7 +465,7 @@ export const ConnectionEnd = { return { clientId: object.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, delayPeriod: Long.fromString(object.delay_period) }; @@ -576,7 +576,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? Long.fromValue(object.delayPeriod) : Long.UZERO }; @@ -610,7 +610,7 @@ export const IdentifiedConnection = { id: object?.id, clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -634,7 +634,7 @@ export const IdentifiedConnection = { id: object.id, clientId: object.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, delayPeriod: Long.fromString(object.delay_period) }; diff --git a/__fixtures__/v-next/outputv2/ibc/core/port/v1/query.ts b/__fixtures__/v-next/outputv2/ibc/core/port/v1/query.ts index 1ed43be13c..c76f1d4146 100644 --- a/__fixtures__/v-next/outputv2/ibc/core/port/v1/query.ts +++ b/__fixtures__/v-next/outputv2/ibc/core/port/v1/query.ts @@ -134,7 +134,7 @@ export const QueryAppVersionRequest = { return { portId: isSet(object.portId) ? String(object.portId) : "", connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, proposedVersion: isSet(object.proposedVersion) ? String(object.proposedVersion) : "" }; @@ -161,7 +161,7 @@ export const QueryAppVersionRequest = { return { portId: object?.port_id, connectionId: object?.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, proposedVersion: object?.proposed_version }; @@ -179,7 +179,7 @@ export const QueryAppVersionRequest = { return { portId: object.port_id, connectionId: object.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, proposedVersion: object.proposed_version }; diff --git a/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v1/solomachine.ts b/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v1/solomachine.ts index fd3a32fb06..a89663cb39 100644 --- a/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v1/solomachine.ts @@ -1222,7 +1222,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO }; @@ -1246,7 +1246,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -1262,7 +1262,7 @@ export const SignatureAndData = { fromAmino(object: SignatureAndDataAmino): SignatureAndData { return { signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data, timestamp: Long.fromString(object.timestamp) }; @@ -1463,7 +1463,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO, diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1490,7 +1490,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1508,7 +1508,7 @@ export const SignBytes = { sequence: Long.fromString(object.sequence), timestamp: Long.fromString(object.timestamp), diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data }; }, diff --git a/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v2/solomachine.ts b/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v2/solomachine.ts index 1077e490fb..fc556edc68 100644 --- a/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/__fixtures__/v-next/outputv2/ibc/lightclients/solomachine/v2/solomachine.ts @@ -1222,7 +1222,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO }; @@ -1246,7 +1246,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -1262,7 +1262,7 @@ export const SignatureAndData = { fromAmino(object: SignatureAndDataAmino): SignatureAndData { return { signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data, timestamp: Long.fromString(object.timestamp) }; @@ -1463,7 +1463,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO, diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1490,7 +1490,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1508,7 +1508,7 @@ export const SignBytes = { sequence: Long.fromString(object.sequence), timestamp: Long.fromString(object.timestamp), diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data }; }, diff --git a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts index c658a35dda..b2dac96e50 100644 --- a/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv2/ibc/lightclients/tendermint/v1/tendermint.ts @@ -624,14 +624,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts index 4ba1978bd8..1bb02aabda 100644 --- a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/params.ts @@ -128,7 +128,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object?.airdrop_start_time ? Timestamp.fromAmino(object.airdrop_start_time) : undefined, + airdropStartTime: object.airdrop_start_time, 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 @@ -136,7 +136,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(message.airdropStartTime) : undefined; + obj.airdrop_start_time = message.airdropStartTime; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/query.ts b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/query.ts index a51c55cbbb..63651e78ac 100644 --- a/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/claim/v1beta1/query.ts @@ -726,7 +726,7 @@ export const QueryClaimableForActionRequest = { fromJSON(object: any): QueryClaimableForActionRequest { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toJSON(message: QueryClaimableForActionRequest): unknown { @@ -744,7 +744,7 @@ export const QueryClaimableForActionRequest = { fromSDK(object: QueryClaimableForActionRequestSDKType): QueryClaimableForActionRequest { return { address: object?.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toSDK(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestSDKType { @@ -756,7 +756,7 @@ export const QueryClaimableForActionRequest = { fromAmino(object: QueryClaimableForActionRequestAmino): QueryClaimableForActionRequest { return { address: object.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toAmino(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestAmino { diff --git a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts index ee0cb8aa51..9a0a9d85f4 100644 --- a/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv2/osmosis/epochs/genesis.ts @@ -291,10 +291,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: Long.fromString(object.current_epoch), - currentEpochStartTime: object?.current_epoch_start_time ? Timestamp.fromAmino(object.current_epoch_start_time) : undefined, + currentEpochStartTime: object.current_epoch_start_time, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: Long.fromString(object.current_epoch_start_height) }; @@ -302,10 +302,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(message.currentEpochStartTime) : undefined; + obj.current_epoch_start_time = message.currentEpochStartTime; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts index 8e1f8306d6..6dbdee984e 100644 --- a/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv2/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -375,7 +375,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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)) : [] @@ -383,7 +383,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts index 1bf5f3e57d..20778fcc20 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/gauge.ts @@ -291,7 +291,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: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, numEpochsPaidOver: Long.fromString(object.num_epochs_paid_over), filledEpochs: Long.fromString(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -307,7 +307,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts index d91f84c9e3..1e7be70c94 100644 --- a/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv2/osmosis/incentives/tx.ts @@ -259,7 +259,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: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, numEpochsPaidOver: Long.fromString(object.num_epochs_paid_over) }; }, @@ -273,7 +273,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts index 536d308d6c..d6bb4af0d6 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/lock.ts @@ -386,7 +386,7 @@ export const PeriodLock = { ID: Long.fromString(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + endTime: object.end_time, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -395,7 +395,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.end_time = message.endTime; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -479,7 +479,7 @@ export const QueryCondition = { }, fromJSON(object: any): QueryCondition { return { - lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : 0, + lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined @@ -503,7 +503,7 @@ export const QueryCondition = { }, fromSDK(object: QueryConditionSDKType): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object?.denom, duration: object.duration ? Duration.fromSDK(object.duration) : undefined, timestamp: object.timestamp ?? undefined @@ -519,10 +519,10 @@ export const QueryCondition = { }, fromAmino(object: QueryConditionAmino): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -530,7 +530,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -651,7 +651,7 @@ export const SyntheticLock = { return { underlyingLockId: Long.fromString(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + endTime: object.end_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -659,7 +659,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.end_time = message.endTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts index 6198181d12..5b20910245 100644 --- a/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/lockup/query.ts @@ -1574,13 +1574,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1776,13 +1776,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1978,13 +1978,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -2192,14 +2192,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputv2/osmosis/superfluid/query.ts b/__fixtures__/v-next/outputv2/osmosis/superfluid/query.ts index 717b1510cf..5475e7e89c 100644 --- a/__fixtures__/v-next/outputv2/osmosis/superfluid/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/superfluid/query.ts @@ -862,7 +862,7 @@ export const AssetTypeResponse = { }, fromJSON(object: any): AssetTypeResponse { return { - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: AssetTypeResponse): unknown { @@ -877,7 +877,7 @@ export const AssetTypeResponse = { }, fromSDK(object: AssetTypeResponseSDKType): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: AssetTypeResponse): AssetTypeResponseSDKType { @@ -887,7 +887,7 @@ export const AssetTypeResponse = { }, fromAmino(object: AssetTypeResponseAmino): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toAmino(message: AssetTypeResponse): AssetTypeResponseAmino { diff --git a/__fixtures__/v-next/outputv2/osmosis/superfluid/superfluid.ts b/__fixtures__/v-next/outputv2/osmosis/superfluid/superfluid.ts index fb4b0b7857..fdf2ce1188 100644 --- a/__fixtures__/v-next/outputv2/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/v-next/outputv2/osmosis/superfluid/superfluid.ts @@ -294,7 +294,7 @@ export const SuperfluidAsset = { fromJSON(object: any): SuperfluidAsset { return { denom: isSet(object.denom) ? String(object.denom) : "", - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: SuperfluidAsset): unknown { @@ -312,7 +312,7 @@ export const SuperfluidAsset = { fromSDK(object: SuperfluidAssetSDKType): SuperfluidAsset { return { denom: object?.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: SuperfluidAsset): SuperfluidAssetSDKType { @@ -324,7 +324,7 @@ export const SuperfluidAsset = { fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { return { denom: object.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts index 5371c3f697..afa7472cde 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/query.ts @@ -229,8 +229,8 @@ export const ArithmeticTwapRequest = { poolId: Long.fromString(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined + startTime: object.start_time, + endTime: object?.end_time }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -238,8 +238,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -449,7 +449,7 @@ export const ArithmeticTwapToNowRequest = { poolId: Long.fromString(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined + startTime: object.start_time }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -457,7 +457,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts index 876891e0ae..b63ff051ca 100644 --- a/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv2/osmosis/twap/v1beta1/twap_record.ts @@ -275,12 +275,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object?.last_error_time ? Timestamp.fromAmino(object.last_error_time) : undefined + lastErrorTime: object.last_error_time }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -289,12 +289,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(message.lastErrorTime) : undefined; + obj.last_error_time = message.lastErrorTime; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts index 6ef2801481..6749a043f7 100644 --- a/__fixtures__/v-next/outputv2/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/abci/types.ts @@ -2136,7 +2136,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -2146,7 +2146,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -2472,7 +2472,7 @@ export const RequestCheckTx = { fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toJSON(message: RequestCheckTx): unknown { @@ -2490,7 +2490,7 @@ export const RequestCheckTx = { fromSDK(object: RequestCheckTxSDKType): RequestCheckTx { return { tx: object?.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toSDK(message: RequestCheckTx): RequestCheckTxSDKType { @@ -2502,7 +2502,7 @@ export const RequestCheckTx = { fromAmino(object: RequestCheckTxAmino): RequestCheckTx { return { tx: object.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { @@ -5032,7 +5032,7 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toJSON(message: ResponseOfferSnapshot): unknown { @@ -5047,7 +5047,7 @@ export const ResponseOfferSnapshot = { }, fromSDK(object: ResponseOfferSnapshotSDKType): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toSDK(message: ResponseOfferSnapshot): ResponseOfferSnapshotSDKType { @@ -5057,7 +5057,7 @@ export const ResponseOfferSnapshot = { }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { @@ -5217,7 +5217,7 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [] }; @@ -5246,7 +5246,7 @@ export const ResponseApplySnapshotChunk = { }, fromSDK(object: ResponseApplySnapshotChunkSDKType): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; @@ -5268,7 +5268,7 @@ export const ResponseApplySnapshotChunk = { }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; @@ -6313,7 +6313,7 @@ export const Evidence = { }, fromJSON(object: any): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, time: isSet(object.time) ? new Date(object.time) : undefined, @@ -6340,7 +6340,7 @@ export const Evidence = { }, fromSDK(object: EvidenceSDKType): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object.validator ? Validator.fromSDK(object.validator) : undefined, height: object?.height, time: object.time ?? undefined, @@ -6358,10 +6358,10 @@ export const Evidence = { }, fromAmino(object: EvidenceAmino): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, totalVotingPower: Long.fromString(object.total_voting_power) }; }, @@ -6370,7 +6370,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts index 4ac1ff78ba..e4b2262011 100644 --- a/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/p2p/types.ts @@ -606,7 +606,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected ? Timestamp.fromAmino(object.last_connected) : undefined + lastConnected: object.last_connected }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -617,7 +617,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected ? Timestamp.toAmino(message.lastConnected) : undefined; + obj.last_connected = message.lastConnected; return obj; }, fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { @@ -730,16 +730,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success ? Timestamp.fromAmino(object.last_dial_success) : undefined, - lastDialFailure: object?.last_dial_failure ? Timestamp.fromAmino(object.last_dial_failure) : undefined, + lastDialSuccess: object.last_dial_success, + lastDialFailure: object.last_dial_failure, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(message.lastDialSuccess) : undefined; - obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(message.lastDialFailure) : undefined; + obj.last_dial_success = message.lastDialSuccess; + obj.last_dial_failure = message.lastDialFailure; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts index 455a93fd16..836041bf04 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/evidence.ts @@ -309,7 +309,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: Long.fromString(object.total_voting_power), validatorPower: Long.fromString(object.validator_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -318,7 +318,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -454,7 +454,7 @@ export const LightClientAttackEvidence = { commonHeight: Long.fromString(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: Long.fromString(object.total_voting_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -467,7 +467,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputv2/tendermint/types/types.ts b/__fixtures__/v-next/outputv2/tendermint/types/types.ts index 0bffa7b8e1..aa36666cd8 100644 --- a/__fixtures__/v-next/outputv2/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv2/tendermint/types/types.ts @@ -1025,7 +1025,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1043,7 +1043,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1246,7 +1246,7 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, @@ -1282,7 +1282,7 @@ export const Vote = { }, fromSDK(object: VoteSDKType): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, blockId: object.block_id ? BlockID.fromSDK(object.block_id) : undefined, @@ -1306,11 +1306,11 @@ export const Vote = { }, fromAmino(object: VoteAmino): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: Long.fromString(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1322,7 +1322,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1532,7 +1532,7 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1556,7 +1556,7 @@ export const CommitSig = { }, fromSDK(object: CommitSigSDKType): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object?.validator_address, timestamp: object.timestamp ?? undefined, signature: object?.signature @@ -1572,9 +1572,9 @@ export const CommitSig = { }, fromAmino(object: CommitSigAmino): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, signature: object.signature }; }, @@ -1582,7 +1582,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.signature = message.signature; return obj; }, @@ -1676,7 +1676,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, @@ -1709,7 +1709,7 @@ export const Proposal = { }, fromSDK(object: ProposalSDKType): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, polRound: object?.pol_round, @@ -1731,12 +1731,12 @@ export const Proposal = { }, fromAmino(object: ProposalAmino): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: Long.fromString(object.height), round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, signature: object.signature }; }, @@ -1747,7 +1747,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.signature = message.signature; return obj; }, diff --git a/__fixtures__/v-next/outputv3/akash/base/v1beta1/endpoint.ts b/__fixtures__/v-next/outputv3/akash/base/v1beta1/endpoint.ts index d196609988..92bca98d83 100644 --- a/__fixtures__/v-next/outputv3/akash/base/v1beta1/endpoint.ts +++ b/__fixtures__/v-next/outputv3/akash/base/v1beta1/endpoint.ts @@ -88,7 +88,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toJSON(message: Endpoint): unknown { @@ -103,7 +103,7 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toSDK(message: Endpoint): EndpointSDKType { @@ -113,7 +113,7 @@ export const Endpoint = { }, fromAmino(object: EndpointAmino): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toAmino(message: Endpoint): EndpointAmino { diff --git a/__fixtures__/v-next/outputv3/akash/base/v1beta2/endpoint.ts b/__fixtures__/v-next/outputv3/akash/base/v1beta2/endpoint.ts index b30a202dd1..ed9175d47a 100644 --- a/__fixtures__/v-next/outputv3/akash/base/v1beta2/endpoint.ts +++ b/__fixtures__/v-next/outputv3/akash/base/v1beta2/endpoint.ts @@ -105,7 +105,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 }; }, @@ -123,7 +123,7 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object?.sequence_number }; }, @@ -135,7 +135,7 @@ export const Endpoint = { }, fromAmino(object: EndpointAmino): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object.sequence_number }; }, diff --git a/__fixtures__/v-next/outputv3/akash/cert/v1beta2/cert.ts b/__fixtures__/v-next/outputv3/akash/cert/v1beta2/cert.ts index af60f313ea..22a5ff94ce 100644 --- a/__fixtures__/v-next/outputv3/akash/cert/v1beta2/cert.ts +++ b/__fixtures__/v-next/outputv3/akash/cert/v1beta2/cert.ts @@ -333,7 +333,7 @@ export const Certificate = { }, fromJSON(object: any): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; @@ -354,7 +354,7 @@ export const Certificate = { }, fromSDK(object: CertificateSDKType): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object?.cert, pubkey: object?.pubkey }; @@ -368,7 +368,7 @@ export const Certificate = { }, fromAmino(object: CertificateAmino): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object.cert, pubkey: object.pubkey }; diff --git a/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/deployment.ts b/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/deployment.ts index 90dc9a6d05..8be83c28a2 100644 --- a/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/deployment.ts +++ b/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/deployment.ts @@ -1112,7 +1112,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -1136,7 +1136,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -1152,7 +1152,7 @@ export const Deployment = { fromAmino(object: DeploymentAmino): Deployment { return { deploymentId: object?.deployment_id ? DeploymentID.fromAmino(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object.version, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/group.ts b/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/group.ts index 80a8a220cf..c0a87a79dc 100644 --- a/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/group.ts +++ b/__fixtures__/v-next/outputv3/akash/deployment/v1beta1/group.ts @@ -985,7 +985,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -1009,7 +1009,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -1025,7 +1025,7 @@ export const Group = { fromAmino(object: GroupAmino): Group { return { groupId: object?.group_id ? GroupID.fromAmino(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object?.group_spec ? GroupSpec.fromAmino(object.group_spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/deployment.ts b/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/deployment.ts index e386e5e40c..8d5df8d297 100644 --- a/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/deployment.ts +++ b/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/deployment.ts @@ -270,7 +270,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -294,7 +294,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -310,7 +310,7 @@ export const Deployment = { fromAmino(object: DeploymentAmino): Deployment { return { deploymentId: object?.deployment_id ? DeploymentID.fromAmino(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object.version, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/group.ts b/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/group.ts index 406938fafa..e2c4cc54a4 100644 --- a/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/group.ts +++ b/__fixtures__/v-next/outputv3/akash/deployment/v1beta2/group.ts @@ -142,7 +142,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -166,7 +166,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -182,7 +182,7 @@ export const Group = { fromAmino(object: GroupAmino): Group { return { groupId: object?.group_id ? GroupID.fromAmino(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object?.group_spec ? GroupSpec.fromAmino(object.group_spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/akash/escrow/v1beta1/types.ts b/__fixtures__/v-next/outputv3/akash/escrow/v1beta1/types.ts index 4634afcef6..5da7666363 100644 --- a/__fixtures__/v-next/outputv3/akash/escrow/v1beta1/types.ts +++ b/__fixtures__/v-next/outputv3/akash/escrow/v1beta1/types.ts @@ -372,7 +372,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? Long.fromValue(object.settledAt) : Long.ZERO @@ -402,7 +402,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, transferred: object.transferred ? Coin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at @@ -422,7 +422,7 @@ export const Account = { return { id: object?.id ? AccountID.fromAmino(object.id) : undefined, owner: object.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object?.balance ? Coin.fromAmino(object.balance) : undefined, transferred: object?.transferred ? Coin.fromAmino(object.transferred) : undefined, settledAt: Long.fromString(object.settled_at) @@ -531,7 +531,7 @@ export const Payment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -564,7 +564,7 @@ export const Payment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object.rate ? Coin.fromSDK(object.rate) : undefined, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -586,7 +586,7 @@ export const Payment = { accountId: object?.account_id ? AccountID.fromAmino(object.account_id) : undefined, paymentId: object.payment_id, owner: object.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object?.rate ? Coin.fromAmino(object.rate) : undefined, balance: object?.balance ? Coin.fromAmino(object.balance) : undefined, withdrawn: object?.withdrawn ? Coin.fromAmino(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv3/akash/escrow/v1beta2/types.ts b/__fixtures__/v-next/outputv3/akash/escrow/v1beta2/types.ts index e615cbc1a8..727207e63a 100644 --- a/__fixtures__/v-next/outputv3/akash/escrow/v1beta2/types.ts +++ b/__fixtures__/v-next/outputv3/akash/escrow/v1beta2/types.ts @@ -410,7 +410,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? Long.fromValue(object.settledAt) : Long.ZERO, @@ -446,7 +446,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, transferred: object.transferred ? DecCoin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at, @@ -470,7 +470,7 @@ export const Account = { return { id: object?.id ? AccountID.fromAmino(object.id) : undefined, owner: object.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object?.balance ? DecCoin.fromAmino(object.balance) : undefined, transferred: object?.transferred ? DecCoin.fromAmino(object.transferred) : undefined, settledAt: Long.fromString(object.settled_at), @@ -583,7 +583,7 @@ export const FractionalPayment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -616,7 +616,7 @@ export const FractionalPayment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object.rate ? DecCoin.fromSDK(object.rate) : undefined, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -638,7 +638,7 @@ export const FractionalPayment = { accountId: object?.account_id ? AccountID.fromAmino(object.account_id) : undefined, paymentId: object.payment_id, owner: object.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object?.rate ? DecCoin.fromAmino(object.rate) : undefined, balance: object?.balance ? DecCoin.fromAmino(object.balance) : undefined, withdrawn: object?.withdrawn ? Coin.fromAmino(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv3/akash/market/v1beta2/bid.ts b/__fixtures__/v-next/outputv3/akash/market/v1beta2/bid.ts index 32ff34d6fb..2f59b73472 100644 --- a/__fixtures__/v-next/outputv3/akash/market/v1beta2/bid.ts +++ b/__fixtures__/v-next/outputv3/akash/market/v1beta2/bid.ts @@ -762,7 +762,7 @@ export const Bid = { fromJSON(object: any): Bid { return { bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -786,7 +786,7 @@ export const Bid = { fromSDK(object: BidSDKType): Bid { return { bidId: object.bid_id ? BidID.fromSDK(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at }; @@ -802,7 +802,7 @@ export const Bid = { fromAmino(object: BidAmino): Bid { return { bidId: object?.bid_id ? BidID.fromAmino(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object?.price ? DecCoin.fromAmino(object.price) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/akash/market/v1beta2/lease.ts b/__fixtures__/v-next/outputv3/akash/market/v1beta2/lease.ts index b88d837bca..396b563e44 100644 --- a/__fixtures__/v-next/outputv3/akash/market/v1beta2/lease.ts +++ b/__fixtures__/v-next/outputv3/akash/market/v1beta2/lease.ts @@ -451,7 +451,7 @@ export const Lease = { fromJSON(object: any): Lease { return { leaseId: isSet(object.leaseId) ? LeaseID.fromJSON(object.leaseId) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO, closedOn: isSet(object.closedOn) ? Long.fromValue(object.closedOn) : Long.ZERO @@ -478,7 +478,7 @@ export const Lease = { fromSDK(object: LeaseSDKType): Lease { return { leaseId: object.lease_id ? LeaseID.fromSDK(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at, closedOn: object?.closed_on @@ -496,7 +496,7 @@ export const Lease = { fromAmino(object: LeaseAmino): Lease { return { leaseId: object?.lease_id ? LeaseID.fromAmino(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object?.price ? DecCoin.fromAmino(object.price) : undefined, createdAt: Long.fromString(object.created_at), closedOn: Long.fromString(object.closed_on) diff --git a/__fixtures__/v-next/outputv3/akash/market/v1beta2/order.ts b/__fixtures__/v-next/outputv3/akash/market/v1beta2/order.ts index d8a8acde6a..599cb1856b 100644 --- a/__fixtures__/v-next/outputv3/akash/market/v1beta2/order.ts +++ b/__fixtures__/v-next/outputv3/akash/market/v1beta2/order.ts @@ -318,7 +318,7 @@ export const Order = { fromJSON(object: any): Order { return { orderId: isSet(object.orderId) ? OrderID.fromJSON(object.orderId) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, createdAt: isSet(object.createdAt) ? Long.fromValue(object.createdAt) : Long.ZERO }; @@ -342,7 +342,7 @@ export const Order = { fromSDK(object: OrderSDKType): Order { return { orderId: object.order_id ? OrderID.fromSDK(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object.spec ? GroupSpec.fromSDK(object.spec) : undefined, createdAt: object?.created_at }; @@ -358,7 +358,7 @@ export const Order = { fromAmino(object: OrderAmino): Order { return { orderId: object?.order_id ? OrderID.fromAmino(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object?.spec ? GroupSpec.fromAmino(object.spec) : undefined, createdAt: Long.fromString(object.created_at) }; diff --git a/__fixtures__/v-next/outputv3/confio/proofs.ts b/__fixtures__/v-next/outputv3/confio/proofs.ts index b15b2bf2a1..0ac5bf37c1 100644 --- a/__fixtures__/v-next/outputv3/confio/proofs.ts +++ b/__fixtures__/v-next/outputv3/confio/proofs.ts @@ -1181,10 +1181,10 @@ export const LeafOp = { }, fromJSON(object: any): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -1208,10 +1208,10 @@ export const LeafOp = { }, fromSDK(object: LeafOpSDKType): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object?.prefix }; }, @@ -1226,10 +1226,10 @@ export const LeafOp = { }, fromAmino(object: LeafOpAmino): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object.prefix }; }, @@ -1304,7 +1304,7 @@ export const InnerOp = { }, fromJSON(object: any): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -1325,7 +1325,7 @@ export const InnerOp = { }, fromSDK(object: InnerOpSDKType): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object?.prefix, suffix: object?.suffix }; @@ -1339,7 +1339,7 @@ export const InnerOp = { }, fromAmino(object: InnerOpAmino): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object.prefix, suffix: object.suffix }; @@ -1571,7 +1571,7 @@ export const InnerSpec = { minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toJSON(message: InnerSpec): unknown { @@ -1605,7 +1605,7 @@ export const InnerSpec = { minPrefixLength: object?.min_prefix_length, maxPrefixLength: object?.max_prefix_length, emptyChild: object?.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toSDK(message: InnerSpec): InnerSpecSDKType { @@ -1629,7 +1629,7 @@ export const InnerSpec = { minPrefixLength: object.min_prefix_length, maxPrefixLength: object.max_prefix_length, emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toAmino(message: InnerSpec): InnerSpecAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts index 0abaa053b4..7a9d130b03 100644 --- a/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv3/cosmos/authz/v1beta1/authz.ts @@ -309,13 +309,13 @@ export const Grant = { fromAmino(object: GrantAmino): Grant { return { authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object?.expiration }; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -437,7 +437,7 @@ export const GrantAuthorization = { granter: object.granter, grantee: object.grantee, authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object.expiration }; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { @@ -445,7 +445,7 @@ export const GrantAuthorization = { obj.granter = message.granter; obj.grantee = message.grantee; obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { diff --git a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts index 4e98d7d4a1..67099b3ce0 100644 --- a/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts +++ b/__fixtures__/v-next/outputv3/cosmos/evidence/v1beta1/evidence.ts @@ -135,7 +135,7 @@ export const Equivocation = { fromAmino(object: EquivocationAmino): Equivocation { return { height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, power: Long.fromString(object.power), consensusAddress: object.consensus_address }; @@ -143,7 +143,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.power = message.power ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts index e0f2cdb343..89a823df81 100644 --- a/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/v-next/outputv3/cosmos/feegrant/v1beta1/feegrant.ts @@ -264,7 +264,7 @@ export const BasicAllowance = { fromAmino(object: BasicAllowanceAmino): BasicAllowance { return { spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - expiration: object?.expiration ? Timestamp.fromAmino(object.expiration) : undefined + expiration: object.expiration }; }, toAmino(message: BasicAllowance): BasicAllowanceAmino { @@ -274,7 +274,7 @@ export const BasicAllowance = { } else { obj.spend_limit = []; } - obj.expiration = message.expiration ? Timestamp.toAmino(message.expiration) : undefined; + obj.expiration = message.expiration; return obj; }, fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { @@ -425,7 +425,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: object?.period_reset ? Timestamp.fromAmino(object.period_reset) : undefined + periodReset: object.period_reset }; }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { @@ -442,7 +442,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = []; } - obj.period_reset = message.periodReset ? Timestamp.toAmino(message.periodReset) : undefined; + obj.period_reset = message.periodReset; return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts index e43e3910ad..61bb6de6a4 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1/gov.ts @@ -464,7 +464,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -482,7 +482,7 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, @@ -494,7 +494,7 @@ export const WeightedVoteOption = { }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object.weight }; }, @@ -752,7 +752,7 @@ export const Proposal = { return { id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -802,7 +802,7 @@ export const Proposal = { return { id: object?.id, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -838,13 +838,13 @@ export const Proposal = { return { id: Long.fromString(object.id), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, + submitTime: object.submit_time, + depositEndTime: object.deposit_end_time, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined, + votingStartTime: object.voting_start_time, + votingEndTime: object.voting_end_time, metadata: object.metadata }; }, @@ -858,15 +858,15 @@ export const Proposal = { } obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; - obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; + obj.submit_time = message.submitTime; + obj.deposit_end_time = message.depositEndTime; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; - obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; + obj.voting_start_time = message.votingStartTime; + obj.voting_end_time = message.votingEndTime; obj.metadata = message.metadata; return obj; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1/query.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1/query.ts index c55906edae..480314c459 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1/query.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1/query.ts @@ -654,7 +654,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -678,7 +678,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -694,7 +694,7 @@ export const QueryProposalsRequest = { }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object.voter, depositor: object.depositor, pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1/tx.ts index 88d0c3e521..6cb1414ad9 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1/tx.ts @@ -722,7 +722,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, @@ -746,7 +746,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata }; }, @@ -762,7 +762,7 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata }; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts index db247a2853..502dc5165f 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/gov.ts @@ -524,7 +524,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -542,7 +542,7 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, @@ -554,7 +554,7 @@ export const WeightedVoteOption = { }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object.weight }; }, @@ -907,7 +907,7 @@ export const Proposal = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -950,7 +950,7 @@ export const Proposal = { return { proposalId: object?.proposal_id, content: object.content ? Any.fromSDK(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -980,13 +980,13 @@ export const Proposal = { return { proposalId: Long.fromString(object.proposal_id), content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, - depositEndTime: object?.deposit_end_time ? Timestamp.fromAmino(object.deposit_end_time) : undefined, + submitTime: object.submit_time, + depositEndTime: object.deposit_end_time, totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object?.voting_start_time ? Timestamp.fromAmino(object.voting_start_time) : undefined, - votingEndTime: object?.voting_end_time ? Timestamp.fromAmino(object.voting_end_time) : undefined + votingStartTime: object.voting_start_time, + votingEndTime: object.voting_end_time }; }, toAmino(message: Proposal): ProposalAmino { @@ -995,15 +995,15 @@ export const Proposal = { obj.content = message.content ? ProposalContentI_ToAmino((message.content as Any)) : undefined; obj.status = message.status; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; - obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(message.depositEndTime) : undefined; + obj.submit_time = message.submitTime; + obj.deposit_end_time = message.depositEndTime; if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(message.votingStartTime) : undefined; - obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(message.votingEndTime) : undefined; + obj.voting_start_time = message.votingStartTime; + obj.voting_end_time = message.votingEndTime; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1214,7 +1214,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, @@ -1242,7 +1242,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDK(e)) : [] }; }, @@ -1262,7 +1262,7 @@ export const Vote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/query.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/query.ts index 7da6739d2c..a0a0c10c10 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/query.ts @@ -654,7 +654,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -678,7 +678,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -694,7 +694,7 @@ export const QueryProposalsRequest = { }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object.voter, depositor: object.depositor, pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/tx.ts index a03a26a824..b0c75241c8 100644 --- a/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/gov/v1beta1/tx.ts @@ -476,7 +476,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -497,7 +497,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { @@ -511,7 +511,7 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toAmino(message: MsgVote): MsgVoteAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/group/v1/events.ts b/__fixtures__/v-next/outputv3/cosmos/group/v1/events.ts index 2cb54ee0d6..22aee660c9 100644 --- a/__fixtures__/v-next/outputv3/cosmos/group/v1/events.ts +++ b/__fixtures__/v-next/outputv3/cosmos/group/v1/events.ts @@ -867,7 +867,7 @@ export const EventExec = { fromJSON(object: any): EventExec { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toJSON(message: EventExec): unknown { @@ -885,7 +885,7 @@ export const EventExec = { fromSDK(object: EventExecSDKType): EventExec { return { proposalId: object?.proposal_id, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toSDK(message: EventExec): EventExecSDKType { @@ -897,7 +897,7 @@ export const EventExec = { fromAmino(object: EventExecAmino): EventExec { return { proposalId: Long.fromString(object.proposal_id), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toAmino(message: EventExec): EventExecAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/group/v1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/group/v1/tx.ts index a83d998a58..bc85a4a998 100644 --- a/__fixtures__/v-next/outputv3/cosmos/group/v1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/group/v1/tx.ts @@ -2686,7 +2686,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgSubmitProposal): unknown { @@ -2721,7 +2721,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object?.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgSubmitProposal): MsgSubmitProposalSDKType { @@ -2747,7 +2747,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { @@ -3112,9 +3112,9 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -3139,9 +3139,9 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { @@ -3157,9 +3157,9 @@ export const MsgVote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toAmino(message: MsgVote): MsgVoteAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts index 4561ed303a..65014cd7ba 100644 --- a/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv3/cosmos/group/v1/types.ts @@ -854,7 +854,7 @@ export const Member = { address: object.address, weight: object.weight, metadata: object.metadata, - addedAt: object?.added_at ? Timestamp.fromAmino(object.added_at) : undefined + addedAt: object.added_at }; }, toAmino(message: Member): MemberAmino { @@ -862,7 +862,7 @@ export const Member = { obj.address = message.address; obj.weight = message.weight; obj.metadata = message.metadata; - obj.added_at = message.addedAt ? Timestamp.toAmino(message.addedAt) : undefined; + obj.added_at = message.addedAt; return obj; }, fromAminoMsg(object: MemberAminoMsg): Member { @@ -1416,7 +1416,7 @@ export const GroupInfo = { metadata: object.metadata, version: Long.fromString(object.version), totalWeight: object.total_weight, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined + createdAt: object.created_at }; }, toAmino(message: GroupInfo): GroupInfoAmino { @@ -1426,7 +1426,7 @@ export const GroupInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.total_weight = message.totalWeight; - obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; + obj.created_at = message.createdAt; return obj; }, fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { @@ -1689,7 +1689,7 @@ export const GroupPolicyInfo = { metadata: object.metadata, version: Long.fromString(object.version), decisionPolicy: object?.decision_policy ? DecisionPolicy_FromAmino(object.decision_policy) : undefined, - createdAt: object?.created_at ? Timestamp.fromAmino(object.created_at) : undefined + createdAt: object.created_at }; }, toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { @@ -1700,7 +1700,7 @@ export const GroupPolicyInfo = { obj.metadata = message.metadata; obj.version = message.version ? message.version.toString() : undefined; obj.decision_policy = message.decisionPolicy ? DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; - obj.created_at = message.createdAt ? Timestamp.toAmino(message.createdAt) : undefined; + obj.created_at = message.createdAt; return obj; }, fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { @@ -1849,11 +1849,11 @@ export const Proposal = { submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, groupVersion: isSet(object.groupVersion) ? Long.fromValue(object.groupVersion) : Long.UZERO, groupPolicyVersion: isSet(object.groupPolicyVersion) ? Long.fromValue(object.groupPolicyVersion) : Long.UZERO, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, votingPeriodEnd: isSet(object.votingPeriodEnd) ? new Date(object.votingPeriodEnd) : undefined, - executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : 0, + executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -1908,11 +1908,11 @@ export const Proposal = { submitTime: object.submit_time ?? undefined, groupVersion: object?.group_version, groupPolicyVersion: object?.group_policy_version, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, votingPeriodEnd: object.voting_period_end ?? undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -1947,14 +1947,14 @@ export const Proposal = { address: object.address, metadata: object.metadata, proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined, + submitTime: object.submit_time, groupVersion: Long.fromString(object.group_version), groupPolicyVersion: Long.fromString(object.group_policy_version), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + 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: object?.voting_period_end ? Timestamp.fromAmino(object.voting_period_end) : undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + votingPeriodEnd: object.voting_period_end, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] }; }, @@ -1968,13 +1968,13 @@ export const Proposal = { } else { obj.proposers = []; } - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; + obj.submit_time = message.submitTime; obj.group_version = message.groupVersion ? message.groupVersion.toString() : undefined; obj.group_policy_version = message.groupPolicyVersion ? message.groupPolicyVersion.toString() : undefined; obj.status = message.status; obj.result = message.result; obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(message.votingPeriodEnd) : undefined; + obj.voting_period_end = message.votingPeriodEnd; obj.executor_result = message.executorResult; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); @@ -2198,7 +2198,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? Long.fromValue(object.proposalId) : Long.UZERO, voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined }; @@ -2225,7 +2225,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, submitTime: object.submit_time ?? undefined }; @@ -2243,9 +2243,9 @@ export const Vote = { return { proposalId: Long.fromString(object.proposal_id), voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object.metadata, - submitTime: object?.submit_time ? Timestamp.fromAmino(object.submit_time) : undefined + submitTime: object.submit_time }; }, toAmino(message: Vote): VoteAmino { @@ -2254,7 +2254,7 @@ export const Vote = { obj.voter = message.voter; obj.option = message.option; obj.metadata = message.metadata; - obj.submit_time = message.submitTime ? Timestamp.toAmino(message.submitTime) : undefined; + obj.submit_time = message.submitTime; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { diff --git a/__fixtures__/v-next/outputv3/cosmos/orm/v1alpha1/schema.ts b/__fixtures__/v-next/outputv3/cosmos/orm/v1alpha1/schema.ts index 33590e3330..d9a4f10c54 100644 --- a/__fixtures__/v-next/outputv3/cosmos/orm/v1alpha1/schema.ts +++ b/__fixtures__/v-next/outputv3/cosmos/orm/v1alpha1/schema.ts @@ -334,7 +334,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: isSet(object.id) ? Number(object.id) : 0, protoFileName: isSet(object.protoFileName) ? String(object.protoFileName) : "", - storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : 0 + storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : -1 }; }, toJSON(message: ModuleSchemaDescriptor_FileEntry): unknown { @@ -355,7 +355,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object?.id, protoFileName: object?.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toSDK(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntrySDKType { @@ -369,7 +369,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object.id, protoFileName: object.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toAmino(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts index 21c56de3c1..3e8fb9169b 100644 --- a/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/v-next/outputv3/cosmos/slashing/v1beta1/slashing.ts @@ -230,7 +230,7 @@ export const ValidatorSigningInfo = { address: object.address, startHeight: Long.fromString(object.start_height), indexOffset: Long.fromString(object.index_offset), - jailedUntil: object?.jailed_until ? Timestamp.fromAmino(object.jailed_until) : undefined, + jailedUntil: object.jailed_until, tombstoned: object.tombstoned, missedBlocksCounter: Long.fromString(object.missed_blocks_counter) }; @@ -240,7 +240,7 @@ export const ValidatorSigningInfo = { obj.address = message.address; obj.start_height = message.startHeight ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(message.jailedUntil) : undefined; + obj.jailed_until = message.jailedUntil; obj.tombstoned = message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter ? message.missedBlocksCounter.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/authz.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/authz.ts index fe1fa42208..da59dbc969 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/authz.ts @@ -193,7 +193,7 @@ export const StakeAuthorization = { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0 + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : -1 }; }, toJSON(message: StakeAuthorization): unknown { @@ -217,7 +217,7 @@ export const StakeAuthorization = { maxTokens: object.max_tokens ? Coin.fromSDK(object.max_tokens) : undefined, allowList: object.allow_list ? StakeAuthorization_Validators.fromSDK(object.allow_list) : undefined, denyList: object.deny_list ? StakeAuthorization_Validators.fromSDK(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toSDK(message: StakeAuthorization): StakeAuthorizationSDKType { @@ -233,7 +233,7 @@ export const StakeAuthorization = { maxTokens: object?.max_tokens ? Coin.fromAmino(object.max_tokens) : undefined, allowList: object?.allow_list ? StakeAuthorization_Validators.fromAmino(object.allow_list) : undefined, denyList: object?.deny_list ? StakeAuthorization_Validators.fromAmino(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toAmino(message: StakeAuthorization): StakeAuthorizationAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts index 3ab99ecde8..950d72beda 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/staking.ts @@ -1130,13 +1130,13 @@ export const Commission = { fromAmino(object: CommissionAmino): Commission { return { commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + updateTime: object.update_time }; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1411,7 +1411,7 @@ export const Validator = { operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, @@ -1456,7 +1456,7 @@ export const Validator = { operatorAddress: object?.operator_address, consensusPubkey: object.consensus_pubkey ? Any.fromSDK(object.consensus_pubkey) : undefined, jailed: object?.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object?.tokens, delegatorShares: object?.delegator_shares, description: object.description ? Description.fromSDK(object.description) : undefined, @@ -1489,12 +1489,12 @@ export const Validator = { value: toBase64(object.consensus_pubkey.value) }, "cosmos"), jailed: object.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object.tokens, delegatorShares: object.delegator_shares, description: object?.description ? Description.fromAmino(object.description) : undefined, unbondingHeight: Long.fromString(object.unbonding_height), - unbondingTime: object?.unbonding_time ? Timestamp.fromAmino(object.unbonding_time) : undefined, + unbondingTime: object.unbonding_time, commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, minSelfDelegation: object.min_self_delegation }; @@ -1512,7 +1512,7 @@ export const Validator = { obj.delegator_shares = message.delegatorShares; obj.description = message.description ? Description.toAmino(message.description) : undefined; obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(message.unbondingTime) : undefined; + obj.unbonding_time = message.unbondingTime; obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; obj.min_self_delegation = message.minSelfDelegation; return obj; @@ -2396,7 +2396,7 @@ export const UnbondingDelegationEntry = { fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { return { creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, + completionTime: object.completion_time, initialBalance: object.initial_balance, balance: object.balance }; @@ -2404,7 +2404,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; obj.initial_balance = message.initialBalance; obj.balance = message.balance; return obj; @@ -2526,7 +2526,7 @@ export const RedelegationEntry = { fromAmino(object: RedelegationEntryAmino): RedelegationEntry { return { creationHeight: Long.fromString(object.creation_height), - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined, + completionTime: object.completion_time, initialBalance: object.initial_balance, sharesDst: object.shares_dst }; @@ -2534,7 +2534,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; return obj; diff --git a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts index 714b1bf7bc..5a4481f635 100644 --- a/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/staking/v1beta1/tx.ts @@ -1101,12 +1101,12 @@ export const MsgBeginRedelegateResponse = { }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined + completionTime: object.completion_time }; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1305,12 +1305,12 @@ export const MsgUndelegateResponse = { }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { return { - completionTime: object?.completion_time ? Timestamp.fromAmino(object.completion_time) : undefined + completionTime: object.completion_time }; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(message.completionTime) : undefined; + obj.completion_time = message.completionTime; return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { diff --git a/__fixtures__/v-next/outputv3/cosmos/tx/signing/v1beta1/signing.ts b/__fixtures__/v-next/outputv3/cosmos/tx/signing/v1beta1/signing.ts index 2555b49512..ab32cf316c 100644 --- a/__fixtures__/v-next/outputv3/cosmos/tx/signing/v1beta1/signing.ts +++ b/__fixtures__/v-next/outputv3/cosmos/tx/signing/v1beta1/signing.ts @@ -602,7 +602,7 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, @@ -620,7 +620,7 @@ export const SignatureDescriptor_Data_Single = { }, fromSDK(object: SignatureDescriptor_Data_SingleSDKType): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object?.signature }; }, @@ -632,7 +632,7 @@ export const SignatureDescriptor_Data_Single = { }, fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object.signature }; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/service.ts b/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/service.ts index d83be4ea3f..7fd71fb04a 100644 --- a/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/service.ts +++ b/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/service.ts @@ -534,7 +534,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0 + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1 }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -559,7 +559,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toSDK(message: GetTxsEventRequest): GetTxsEventRequestSDKType { @@ -577,7 +577,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { @@ -794,7 +794,7 @@ export const BroadcastTxRequest = { fromJSON(object: any): BroadcastTxRequest { return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toJSON(message: BroadcastTxRequest): unknown { @@ -812,7 +812,7 @@ export const BroadcastTxRequest = { fromSDK(object: BroadcastTxRequestSDKType): BroadcastTxRequest { return { txBytes: object?.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toSDK(message: BroadcastTxRequest): BroadcastTxRequestSDKType { @@ -824,7 +824,7 @@ export const BroadcastTxRequest = { fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { return { txBytes: object.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { diff --git a/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/tx.ts b/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/tx.ts index 706ef4c2d1..140e9cd269 100644 --- a/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv3/cosmos/tx/v1beta1/tx.ts @@ -1861,7 +1861,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1876,7 +1876,7 @@ export const ModeInfo_Single = { }, fromSDK(object: ModeInfo_SingleSDKType): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toSDK(message: ModeInfo_Single): ModeInfo_SingleSDKType { @@ -1886,7 +1886,7 @@ export const ModeInfo_Single = { }, fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { @@ -2342,7 +2342,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -2366,7 +2366,7 @@ export const AuxSignerData = { return { address: object?.address, signDoc: object.sign_doc ? SignDocDirectAux.fromSDK(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object?.sig }; }, @@ -2382,7 +2382,7 @@ export const AuxSignerData = { return { address: object.address, signDoc: object?.sign_doc ? SignDocDirectAux.fromAmino(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object.sig }; }, diff --git a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts index da8eac8345..85d55bfb35 100644 --- a/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/v-next/outputv3/cosmos/upgrade/v1beta1/upgrade.ts @@ -326,7 +326,7 @@ export const Plan = { fromAmino(object: PlanAmino): Plan { return { name: object.name, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, height: Long.fromString(object.height), info: object.info, upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined @@ -335,7 +335,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; diff --git a/__fixtures__/v-next/outputv3/cosmwasm/wasm/v1/types.ts b/__fixtures__/v-next/outputv3/cosmwasm/wasm/v1/types.ts index 44244ba8ee..ae3e9b5030 100644 --- a/__fixtures__/v-next/outputv3/cosmwasm/wasm/v1/types.ts +++ b/__fixtures__/v-next/outputv3/cosmwasm/wasm/v1/types.ts @@ -408,7 +408,7 @@ export const AccessTypeParam = { }, fromJSON(object: any): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toJSON(message: AccessTypeParam): unknown { @@ -423,7 +423,7 @@ export const AccessTypeParam = { }, fromSDK(object: AccessTypeParamSDKType): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toSDK(message: AccessTypeParam): AccessTypeParamSDKType { @@ -433,7 +433,7 @@ export const AccessTypeParam = { }, fromAmino(object: AccessTypeParamAmino): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toAmino(message: AccessTypeParam): AccessTypeParamAmino { @@ -503,7 +503,7 @@ export const AccessConfig = { }, fromJSON(object: any): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -521,7 +521,7 @@ export const AccessConfig = { }, fromSDK(object: AccessConfigSDKType): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object?.address }; }, @@ -533,7 +533,7 @@ export const AccessConfig = { }, fromAmino(object: AccessConfigAmino): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object.address }; }, @@ -613,7 +613,7 @@ export const Params = { fromJSON(object: any): Params { return { codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, - instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : 0, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : -1, maxWasmCodeSize: isSet(object.maxWasmCodeSize) ? Long.fromValue(object.maxWasmCodeSize) : Long.UZERO }; }, @@ -634,7 +634,7 @@ export const Params = { fromSDK(object: ParamsSDKType): Params { return { codeUploadAccess: object.code_upload_access ? AccessConfig.fromSDK(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: object?.max_wasm_code_size }; }, @@ -648,7 +648,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { codeUploadAccess: object?.code_upload_access ? AccessConfig.fromAmino(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: Long.fromString(object.max_wasm_code_size) }; }, @@ -1023,7 +1023,7 @@ export const ContractCodeHistoryEntry = { }, fromJSON(object: any): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: isSet(object.codeId) ? Long.fromValue(object.codeId) : Long.UZERO, updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() @@ -1047,7 +1047,7 @@ export const ContractCodeHistoryEntry = { }, fromSDK(object: ContractCodeHistoryEntrySDKType): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: object?.code_id, updated: object.updated ? AbsoluteTxPosition.fromSDK(object.updated) : undefined, msg: object?.msg @@ -1063,7 +1063,7 @@ export const ContractCodeHistoryEntry = { }, fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: Long.fromString(object.code_id), updated: object?.updated ? AbsoluteTxPosition.fromAmino(object.updated) : undefined, msg: toUtf8(JSON.stringify(object.msg)) diff --git a/__fixtures__/v-next/outputv3/evmos/claims/v1/claims.ts b/__fixtures__/v-next/outputv3/evmos/claims/v1/claims.ts index c0a88f077d..e004efb28e 100644 --- a/__fixtures__/v-next/outputv3/evmos/claims/v1/claims.ts +++ b/__fixtures__/v-next/outputv3/evmos/claims/v1/claims.ts @@ -212,7 +212,7 @@ export const Claim = { }, fromJSON(object: any): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimableAmount: isSet(object.claimableAmount) ? String(object.claimableAmount) : "" }; @@ -233,7 +233,7 @@ export const Claim = { }, fromSDK(object: ClaimSDKType): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object?.completed, claimableAmount: object?.claimable_amount }; @@ -247,7 +247,7 @@ export const Claim = { }, fromAmino(object: ClaimAmino): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object.completed, claimableAmount: object.claimable_amount }; diff --git a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts index 34fc266db9..327bc0e734 100644 --- a/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/claims/v1/genesis.ts @@ -342,7 +342,7 @@ export const Params = { fromAmino(object: ParamsAmino): Params { return { enableClaims: object.enable_claims, - airdropStartTime: object?.airdrop_start_time ? Timestamp.fromAmino(object.airdrop_start_time) : undefined, + airdropStartTime: object.airdrop_start_time, 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, @@ -353,7 +353,7 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.enable_claims = message.enableClaims; - obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(message.airdropStartTime) : undefined; + obj.airdrop_start_time = message.airdropStartTime; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claims_denom = message.claimsDenom; diff --git a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts index c15d4531f9..35958b1666 100644 --- a/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts +++ b/__fixtures__/v-next/outputv3/evmos/epochs/v1/genesis.ts @@ -188,10 +188,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: Long.fromString(object.current_epoch), - currentEpochStartTime: object?.current_epoch_start_time ? Timestamp.fromAmino(object.current_epoch_start_time) : undefined, + currentEpochStartTime: object.current_epoch_start_time, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: Long.fromString(object.current_epoch_start_height) }; @@ -199,10 +199,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(message.currentEpochStartTime) : undefined; + obj.current_epoch_start_time = message.currentEpochStartTime; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/evmos/erc20/v1/erc20.ts b/__fixtures__/v-next/outputv3/evmos/erc20/v1/erc20.ts index acc78ca745..71ff04ce36 100644 --- a/__fixtures__/v-next/outputv3/evmos/erc20/v1/erc20.ts +++ b/__fixtures__/v-next/outputv3/evmos/erc20/v1/erc20.ts @@ -275,7 +275,7 @@ export const TokenPair = { erc20Address: isSet(object.erc20Address) ? String(object.erc20Address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : 0 + contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : -1 }; }, toJSON(message: TokenPair): unknown { @@ -299,7 +299,7 @@ export const TokenPair = { erc20Address: object?.erc20_address, denom: object?.denom, enabled: object?.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toSDK(message: TokenPair): TokenPairSDKType { @@ -315,7 +315,7 @@ export const TokenPair = { erc20Address: object.erc20_address, denom: object.denom, enabled: object.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toAmino(message: TokenPair): TokenPairAmino { diff --git a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts index 862ee3706c..c828ea6dfa 100644 --- a/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/v-next/outputv3/evmos/incentives/v1/incentives.ts @@ -276,7 +276,7 @@ export const Incentive = { contract: object.contract, allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => DecCoin.fromAmino(e)) : [], epochs: object.epochs, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, totalGas: Long.fromString(object.total_gas) }; }, @@ -289,7 +289,7 @@ export const Incentive = { obj.allocations = []; } obj.epochs = message.epochs; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts index c692938e3c..1e8d7d0ab5 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/tx.ts @@ -289,7 +289,7 @@ export const MsgCreateClawbackVestingAccount = { return { fromAddress: object.from_address, toAddress: object.to_address, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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 @@ -299,7 +299,7 @@ export const MsgCreateClawbackVestingAccount = { const obj: any = {}; obj.from_address = message.fromAddress; obj.to_address = message.toAddress; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts index a95f38a78b..021cdf50da 100644 --- a/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/v-next/outputv3/evmos/vesting/v1/vesting.ts @@ -189,7 +189,7 @@ export const ClawbackVestingAccount = { return { baseVestingAccount: object?.base_vesting_account ? BaseVestingAccount.fromAmino(object.base_vesting_account) : undefined, funderAddress: object.funder_address, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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)) : [] }; @@ -198,7 +198,7 @@ export const ClawbackVestingAccount = { const obj: any = {}; obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : undefined; obj.funder_address = message.funderAddress; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; if (message.lockupPeriods) { obj.lockup_periods = message.lockupPeriods.map(e => e ? Period.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/google/api/backend.ts b/__fixtures__/v-next/outputv3/google/api/backend.ts index 3bbe90f6d5..620d5e02d3 100644 --- a/__fixtures__/v-next/outputv3/google/api/backend.ts +++ b/__fixtures__/v-next/outputv3/google/api/backend.ts @@ -500,7 +500,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, minDeadline: isSet(object.minDeadline) ? Number(object.minDeadline) : 0, operationDeadline: isSet(object.operationDeadline) ? Number(object.operationDeadline) : 0, - pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : 0, + pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : -1, jwtAudience: isSet(object.jwtAudience) ? String(object.jwtAudience) : undefined, disableAuth: isSet(object.disableAuth) ? Boolean(object.disableAuth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" @@ -539,7 +539,7 @@ export const BackendRule = { deadline: object?.deadline, minDeadline: object?.min_deadline, operationDeadline: object?.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object?.protocol @@ -565,7 +565,7 @@ export const BackendRule = { deadline: object.deadline, minDeadline: object.min_deadline, operationDeadline: object.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object.protocol diff --git a/__fixtures__/v-next/outputv3/google/api/config_change.ts b/__fixtures__/v-next/outputv3/google/api/config_change.ts index 5c221f5f68..61cb9da111 100644 --- a/__fixtures__/v-next/outputv3/google/api/config_change.ts +++ b/__fixtures__/v-next/outputv3/google/api/config_change.ts @@ -263,7 +263,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", oldValue: isSet(object.oldValue) ? String(object.oldValue) : "", newValue: isSet(object.newValue) ? String(object.newValue) : "", - changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : 0, + changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [] }; }, @@ -294,7 +294,7 @@ export const ConfigChange = { element: object?.element, oldValue: object?.old_value, newValue: object?.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDK(e)) : [] }; }, @@ -316,7 +316,7 @@ export const ConfigChange = { element: object.element, oldValue: object.old_value, newValue: object.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv3/google/api/consumer.ts b/__fixtures__/v-next/outputv3/google/api/consumer.ts index 245de23c85..1fc8feba69 100644 --- a/__fixtures__/v-next/outputv3/google/api/consumer.ts +++ b/__fixtures__/v-next/outputv3/google/api/consumer.ts @@ -335,7 +335,7 @@ export const Property = { fromJSON(object: any): Property { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -356,7 +356,7 @@ export const Property = { fromSDK(object: PropertySDKType): Property { return { name: object?.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object?.description }; }, @@ -370,7 +370,7 @@ export const Property = { fromAmino(object: PropertyAmino): Property { return { name: object.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object.description }; }, diff --git a/__fixtures__/v-next/outputv3/google/api/distribution.ts b/__fixtures__/v-next/outputv3/google/api/distribution.ts index cf5a86720d..4ab5726e0b 100644 --- a/__fixtures__/v-next/outputv3/google/api/distribution.ts +++ b/__fixtures__/v-next/outputv3/google/api/distribution.ts @@ -1359,14 +1359,14 @@ export const Distribution_Exemplar = { fromAmino(object: Distribution_ExemplarAmino): Distribution_Exemplar { return { value: object.value, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, attachments: Array.isArray(object?.attachments) ? object.attachments.map((e: any) => Any.fromAmino(e)) : [] }; }, toAmino(message: Distribution_Exemplar): Distribution_ExemplarAmino { const obj: any = {}; obj.value = message.value; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; if (message.attachments) { obj.attachments = message.attachments.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/__fixtures__/v-next/outputv3/google/api/expr/conformance/v1alpha1/conformance_service.ts b/__fixtures__/v-next/outputv3/google/api/expr/conformance/v1alpha1/conformance_service.ts index a3fd97c1a9..21904ca403 100644 --- a/__fixtures__/v-next/outputv3/google/api/expr/conformance/v1alpha1/conformance_service.ts +++ b/__fixtures__/v-next/outputv3/google/api/expr/conformance/v1alpha1/conformance_service.ts @@ -1236,7 +1236,7 @@ export const IssueDetails = { }, fromJSON(object: any): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromJSON(object.position) : undefined, id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO }; @@ -1257,7 +1257,7 @@ export const IssueDetails = { }, fromSDK(object: IssueDetailsSDKType): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object.position ? SourcePosition.fromSDK(object.position) : undefined, id: object?.id }; @@ -1271,7 +1271,7 @@ export const IssueDetails = { }, fromAmino(object: IssueDetailsAmino): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object?.position ? SourcePosition.fromAmino(object.position) : undefined, id: Long.fromString(object.id) }; diff --git a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts index a7457c5272..5588de6613 100644 --- a/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/v-next/outputv3/google/api/expr/v1alpha1/syntax.ts @@ -2131,7 +2131,7 @@ export const Constant = { stringValue: object?.string_value, bytesValue: object?.bytes_value, durationValue: object?.duration_value ? Duration.fromAmino(object.duration_value) : undefined, - timestampValue: object?.timestamp_value ? Timestamp.fromAmino(object.timestamp_value) : undefined + timestampValue: object?.timestamp_value }; }, toAmino(message: Constant): ConstantAmino { @@ -2144,7 +2144,7 @@ export const Constant = { obj.string_value = message.stringValue; obj.bytes_value = message.bytesValue; obj.duration_value = message.durationValue ? Duration.toAmino(message.durationValue) : undefined; - obj.timestamp_value = message.timestampValue ? Timestamp.toAmino(message.timestampValue) : undefined; + obj.timestamp_value = message.timestampValue; return obj; }, fromAminoMsg(object: ConstantAminoMsg): Constant { diff --git a/__fixtures__/v-next/outputv3/google/api/label.ts b/__fixtures__/v-next/outputv3/google/api/label.ts index 178db58c52..566006d8ed 100644 --- a/__fixtures__/v-next/outputv3/google/api/label.ts +++ b/__fixtures__/v-next/outputv3/google/api/label.ts @@ -122,7 +122,7 @@ export const LabelDescriptor = { fromJSON(object: any): LabelDescriptor { return { key: isSet(object.key) ? String(object.key) : "", - valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : 0, + valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -143,7 +143,7 @@ export const LabelDescriptor = { fromSDK(object: LabelDescriptorSDKType): LabelDescriptor { return { key: object?.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object?.description }; }, @@ -157,7 +157,7 @@ export const LabelDescriptor = { fromAmino(object: LabelDescriptorAmino): LabelDescriptor { return { key: object.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object.description }; }, diff --git a/__fixtures__/v-next/outputv3/google/api/metric.ts b/__fixtures__/v-next/outputv3/google/api/metric.ts index c631875a6d..f7b6e9cb31 100644 --- a/__fixtures__/v-next/outputv3/google/api/metric.ts +++ b/__fixtures__/v-next/outputv3/google/api/metric.ts @@ -727,13 +727,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : 0, - valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : 0, + metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : -1, + valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", displayName: isSet(object.displayName) ? String(object.displayName) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromJSON(object.metadata) : undefined, - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, monitoredResourceTypes: Array.isArray(object?.monitoredResourceTypes) ? object.monitoredResourceTypes.map((e: any) => String(e)) : [] }; }, @@ -780,13 +780,13 @@ export const MetricDescriptor = { name: object?.name, type: object?.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object?.unit, description: object?.description, displayName: object?.display_name, metadata: object.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromSDK(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -818,13 +818,13 @@ export const MetricDescriptor = { name: object.name, type: object.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromAmino(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object.unit, description: object.description, displayName: object.display_name, metadata: object?.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromAmino(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -913,7 +913,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromJSON(object: any): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, samplePeriod: isSet(object.samplePeriod) ? Duration.fromJSON(object.samplePeriod) : undefined, ingestDelay: isSet(object.ingestDelay) ? Duration.fromJSON(object.ingestDelay) : undefined }; @@ -934,7 +934,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromSDK(object: MetricDescriptor_MetricDescriptorMetadataSDKType): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object.sample_period ? Duration.fromSDK(object.sample_period) : undefined, ingestDelay: object.ingest_delay ? Duration.fromSDK(object.ingest_delay) : undefined }; @@ -948,7 +948,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromAmino(object: MetricDescriptor_MetricDescriptorMetadataAmino): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object?.sample_period ? Duration.fromAmino(object.sample_period) : undefined, ingestDelay: object?.ingest_delay ? Duration.fromAmino(object.ingest_delay) : undefined }; diff --git a/__fixtures__/v-next/outputv3/google/api/monitored_resource.ts b/__fixtures__/v-next/outputv3/google/api/monitored_resource.ts index f5934dd801..d71d2aaddc 100644 --- a/__fixtures__/v-next/outputv3/google/api/monitored_resource.ts +++ b/__fixtures__/v-next/outputv3/google/api/monitored_resource.ts @@ -404,7 +404,7 @@ export const MonitoredResourceDescriptor = { displayName: isSet(object.displayName) ? String(object.displayName) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0 + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1 }; }, toJSON(message: MonitoredResourceDescriptor): unknown { @@ -438,7 +438,7 @@ export const MonitoredResourceDescriptor = { displayName: object?.display_name, description: object?.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toSDK(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorSDKType { @@ -462,7 +462,7 @@ export const MonitoredResourceDescriptor = { displayName: object.display_name, description: object.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromAmino(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toAmino(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorAmino { diff --git a/__fixtures__/v-next/outputv3/google/api/resource.ts b/__fixtures__/v-next/outputv3/google/api/resource.ts index 4302a28fb5..8f44975d27 100644 --- a/__fixtures__/v-next/outputv3/google/api/resource.ts +++ b/__fixtures__/v-next/outputv3/google/api/resource.ts @@ -615,7 +615,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], nameField: isSet(object.nameField) ? String(object.nameField) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -656,7 +656,7 @@ export const ResourceDescriptor = { type: object?.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object?.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object?.plural, singular: object?.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -686,7 +686,7 @@ export const ResourceDescriptor = { type: object.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object.plural, singular: object.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/check_error.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/check_error.ts index fb36d804cb..f84fb7ac3a 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/check_error.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/check_error.ts @@ -312,7 +312,7 @@ export const CheckError = { }, fromJSON(object: any): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -336,7 +336,7 @@ export const CheckError = { }, fromSDK(object: CheckErrorSDKType): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object?.subject, detail: object?.detail, status: object.status ? Status.fromSDK(object.status) : undefined @@ -352,7 +352,7 @@ export const CheckError = { }, fromAmino(object: CheckErrorAmino): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object.subject, detail: object.detail, status: object?.status ? Status.fromAmino(object.status) : undefined diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts index a3f5abca92..488a381332 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/log_entry.ts @@ -513,7 +513,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insertId: isSet(object.insertId) ? String(object.insertId) : "", @@ -578,7 +578,7 @@ export const LogEntry = { return { name: object?.name, timestamp: object.timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, trace: object?.trace, insertId: object?.insert_id, @@ -619,8 +619,8 @@ export const LogEntry = { fromAmino(object: LogEntryAmino): LogEntry { return { name: object.name, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + timestamp: object.timestamp, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, trace: object.trace, insertId: object.insert_id, @@ -640,7 +640,7 @@ export const LogEntry = { toAmino(message: LogEntry): LogEntryAmino { const obj: any = {}; obj.name = message.name; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.severity = message.severity; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; obj.trace = message.trace; diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts index e9fa53c108..5e768157c5 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/metric_value.ts @@ -423,8 +423,8 @@ export const MetricValue = { acc[key] = String(value); return acc; }, {}) : {}, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + startTime: object.start_time, + endTime: object.end_time, boolValue: object?.bool_value, int64Value: object?.int64_value ? Long.fromString(object.int64_value) : undefined, doubleValue: object?.double_value, @@ -440,8 +440,8 @@ export const MetricValue = { obj.labels[k] = v; }); } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.bool_value = message.boolValue; obj.int64_value = message.int64Value ? message.int64Value.toString() : undefined; obj.double_value = message.doubleValue; diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts index 5c7ab64b77..efbded8db0 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/operation.ts @@ -456,7 +456,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metricValueSets) ? object.metricValueSets.map((e: any) => MetricValueSet.fromJSON(e)) : [], logEntries: Array.isArray(object?.logEntries) ? object.logEntries.map((e: any) => LogEntry.fromJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -527,7 +527,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDK(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDK(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -567,8 +567,8 @@ export const Operation = { operationId: object.operation_id, operationName: object.operation_name, consumerId: object.consumer_id, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + startTime: object.start_time, + endTime: object.end_time, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -577,7 +577,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromAmino(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromAmino(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromAmino(e)) : [] }; }, @@ -586,8 +586,8 @@ export const Operation = { obj.operation_id = message.operationId; obj.operation_name = message.operationName; obj.consumer_id = message.consumerId; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/quota_controller.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/quota_controller.ts index d206ca043d..e54ac17549 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/quota_controller.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/quota_controller.ts @@ -776,7 +776,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quotaMetrics) ? object.quotaMetrics.map((e: any) => MetricValueSet.fromJSON(e)) : [], - quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : 0 + quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : -1 }; }, toJSON(message: QuotaOperation): unknown { @@ -827,7 +827,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDK(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toSDK(message: QuotaOperation): QuotaOperationSDKType { @@ -861,7 +861,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromAmino(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toAmino(message: QuotaOperation): QuotaOperationAmino { @@ -1099,7 +1099,7 @@ export const QuotaError = { }, fromJSON(object: any): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -1123,7 +1123,7 @@ export const QuotaError = { }, fromSDK(object: QuotaErrorSDKType): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object?.subject, description: object?.description, status: object.status ? Status.fromSDK(object.status) : undefined @@ -1139,7 +1139,7 @@ export const QuotaError = { }, fromAmino(object: QuotaErrorAmino): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object.subject, description: object.description, status: object?.status ? Status.fromAmino(object.status) : undefined diff --git a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/service_controller.ts b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/service_controller.ts index 2876925def..246eaa490c 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/service_controller.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicecontrol/v1/service_controller.ts @@ -886,7 +886,7 @@ export const CheckResponse_ConsumerInfo = { fromJSON(object: any): CheckResponse_ConsumerInfo { return { projectNumber: isSet(object.projectNumber) ? Long.fromValue(object.projectNumber) : Long.ZERO, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: isSet(object.consumerNumber) ? Long.fromValue(object.consumerNumber) : Long.ZERO }; }, @@ -907,7 +907,7 @@ export const CheckResponse_ConsumerInfo = { fromSDK(object: CheckResponse_ConsumerInfoSDKType): CheckResponse_ConsumerInfo { return { projectNumber: object?.project_number, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: object?.consumer_number }; }, @@ -921,7 +921,7 @@ export const CheckResponse_ConsumerInfo = { fromAmino(object: CheckResponse_ConsumerInfoAmino): CheckResponse_ConsumerInfo { return { projectNumber: Long.fromString(object.project_number), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: Long.fromString(object.consumer_number) }; }, diff --git a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts index aceae3af52..60da79efbc 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/resources.ts @@ -1040,7 +1040,7 @@ export const OperationMetadata = { resourceNames: Array.isArray(object?.resource_names) ? object.resource_names.map((e: any) => e) : [], steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => OperationMetadata_Step.fromAmino(e)) : [], progressPercentage: object.progress_percentage, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined + startTime: object.start_time }; }, toAmino(message: OperationMetadata): OperationMetadataAmino { @@ -1056,7 +1056,7 @@ export const OperationMetadata = { obj.steps = []; } obj.progress_percentage = message.progressPercentage; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; return obj; }, fromAminoMsg(object: OperationMetadataAminoMsg): OperationMetadata { @@ -1115,7 +1115,7 @@ export const OperationMetadata_Step = { fromJSON(object: any): OperationMetadata_Step { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toJSON(message: OperationMetadata_Step): unknown { @@ -1133,7 +1133,7 @@ export const OperationMetadata_Step = { fromSDK(object: OperationMetadata_StepSDKType): OperationMetadata_Step { return { description: object?.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toSDK(message: OperationMetadata_Step): OperationMetadata_StepSDKType { @@ -1145,7 +1145,7 @@ export const OperationMetadata_Step = { fromAmino(object: OperationMetadata_StepAmino): OperationMetadata_Step { return { description: object.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toAmino(message: OperationMetadata_Step): OperationMetadata_StepAmino { @@ -1217,7 +1217,7 @@ export const Diagnostic = { fromJSON(object: any): Diagnostic { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -1238,7 +1238,7 @@ export const Diagnostic = { fromSDK(object: DiagnosticSDKType): Diagnostic { return { location: object?.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object?.message }; }, @@ -1252,7 +1252,7 @@ export const Diagnostic = { fromAmino(object: DiagnosticAmino): Diagnostic { return { location: object.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object.message }; }, @@ -1434,7 +1434,7 @@ export const ConfigFile = { return { filePath: isSet(object.filePath) ? String(object.filePath) : "", fileContents: isSet(object.fileContents) ? bytesFromBase64(object.fileContents) : new Uint8Array(), - fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : 0 + fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : -1 }; }, toJSON(message: ConfigFile): unknown { @@ -1455,7 +1455,7 @@ export const ConfigFile = { return { filePath: object?.file_path, fileContents: object?.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toSDK(message: ConfigFile): ConfigFileSDKType { @@ -1469,7 +1469,7 @@ export const ConfigFile = { return { filePath: object.file_path, fileContents: object.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toAmino(message: ConfigFile): ConfigFileAmino { @@ -1746,7 +1746,7 @@ export const Rollout = { rolloutId: isSet(object.rolloutId) ? String(object.rolloutId) : "", createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, createdBy: isSet(object.createdBy) ? String(object.createdBy) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: isSet(object.trafficPercentStrategy) ? Rollout_TrafficPercentStrategy.fromJSON(object.trafficPercentStrategy) : undefined, deleteServiceStrategy: isSet(object.deleteServiceStrategy) ? Rollout_DeleteServiceStrategy.fromJSON(object.deleteServiceStrategy) : undefined, serviceName: isSet(object.serviceName) ? String(object.serviceName) : "" @@ -1779,7 +1779,7 @@ export const Rollout = { rolloutId: object?.rollout_id, createTime: object.create_time ?? undefined, createdBy: object?.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromSDK(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromSDK(object.delete_service_strategy) : undefined, serviceName: object?.service_name @@ -1799,9 +1799,9 @@ export const Rollout = { fromAmino(object: RolloutAmino): Rollout { return { rolloutId: object.rollout_id, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, + createTime: object.create_time, createdBy: object.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object?.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromAmino(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object?.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromAmino(object.delete_service_strategy) : undefined, serviceName: object.service_name @@ -1810,7 +1810,7 @@ export const Rollout = { toAmino(message: Rollout): RolloutAmino { const obj: any = {}; obj.rollout_id = message.rolloutId; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; + obj.create_time = message.createTime; obj.created_by = message.createdBy; obj.status = message.status; obj.traffic_percent_strategy = message.trafficPercentStrategy ? Rollout_TrafficPercentStrategy.toAmino(message.trafficPercentStrategy) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/servicemanager.ts b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/servicemanager.ts index 3e7c33a525..8d8bd9f163 100644 --- a/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/servicemanager.ts +++ b/__fixtures__/v-next/outputv3/google/api/servicemanagement/v1/servicemanager.ts @@ -1433,7 +1433,7 @@ export const GetServiceConfigRequest = { return { serviceName: isSet(object.serviceName) ? String(object.serviceName) : "", configId: isSet(object.configId) ? String(object.configId) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toJSON(message: GetServiceConfigRequest): unknown { @@ -1454,7 +1454,7 @@ export const GetServiceConfigRequest = { return { serviceName: object?.service_name, configId: object?.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toSDK(message: GetServiceConfigRequest): GetServiceConfigRequestSDKType { @@ -1468,7 +1468,7 @@ export const GetServiceConfigRequest = { return { serviceName: object.service_name, configId: object.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toAmino(message: GetServiceConfigRequest): GetServiceConfigRequestAmino { diff --git a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/resources.ts b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/resources.ts index f5aae209cd..2cf5f80535 100644 --- a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/resources.ts +++ b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/resources.ts @@ -316,7 +316,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -340,7 +340,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { @@ -356,7 +356,7 @@ export const Service = { name: object.name, parent: object.parent, config: object?.config ? ServiceConfig.fromAmino(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toAmino(message: Service): ServiceAmino { diff --git a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/serviceusage.ts b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/serviceusage.ts index 86a8005949..de735e9c48 100644 --- a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/serviceusage.ts +++ b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1/serviceusage.ts @@ -781,7 +781,7 @@ export const DisableServiceRequest = { return { name: isSet(object.name) ? String(object.name) : "", disableDependentServices: isSet(object.disableDependentServices) ? Boolean(object.disableDependentServices) : false, - checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : 0 + checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : -1 }; }, toJSON(message: DisableServiceRequest): unknown { @@ -802,7 +802,7 @@ export const DisableServiceRequest = { return { name: object?.name, disableDependentServices: object?.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toSDK(message: DisableServiceRequest): DisableServiceRequestSDKType { @@ -816,7 +816,7 @@ export const DisableServiceRequest = { return { name: object.name, disableDependentServices: object.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toAmino(message: DisableServiceRequest): DisableServiceRequestAmino { diff --git a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/resources.ts b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/resources.ts index e21df986ed..9597ede05e 100644 --- a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/resources.ts +++ b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/resources.ts @@ -1130,7 +1130,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -1154,7 +1154,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { @@ -1170,7 +1170,7 @@ export const Service = { name: object.name, parent: object.parent, config: object?.config ? ServiceConfig.fromAmino(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toAmino(message: Service): ServiceAmino { diff --git a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/serviceusage.ts b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/serviceusage.ts index b5517b0c99..9de431b0cf 100644 --- a/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/serviceusage.ts +++ b/__fixtures__/v-next/outputv3/google/api/serviceusage/v1beta1/serviceusage.ts @@ -2201,7 +2201,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0, pageToken: isSet(object.pageToken) ? String(object.pageToken) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: ListConsumerQuotaMetricsRequest): unknown { @@ -2225,7 +2225,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object?.parent, pageSize: object?.page_size, pageToken: object?.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestSDKType { @@ -2241,7 +2241,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object.parent, pageSize: object.page_size, pageToken: object.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestAmino { @@ -2415,7 +2415,7 @@ export const GetConsumerQuotaMetricRequest = { fromJSON(object: any): GetConsumerQuotaMetricRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaMetricRequest): unknown { @@ -2433,7 +2433,7 @@ export const GetConsumerQuotaMetricRequest = { fromSDK(object: GetConsumerQuotaMetricRequestSDKType): GetConsumerQuotaMetricRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestSDKType { @@ -2445,7 +2445,7 @@ export const GetConsumerQuotaMetricRequest = { fromAmino(object: GetConsumerQuotaMetricRequestAmino): GetConsumerQuotaMetricRequest { return { name: object.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestAmino { @@ -2510,7 +2510,7 @@ export const GetConsumerQuotaLimitRequest = { fromJSON(object: any): GetConsumerQuotaLimitRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaLimitRequest): unknown { @@ -2528,7 +2528,7 @@ export const GetConsumerQuotaLimitRequest = { fromSDK(object: GetConsumerQuotaLimitRequestSDKType): GetConsumerQuotaLimitRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestSDKType { @@ -2540,7 +2540,7 @@ export const GetConsumerQuotaLimitRequest = { fromAmino(object: GetConsumerQuotaLimitRequestAmino): GetConsumerQuotaLimitRequest { return { name: object.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toAmino(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestAmino { @@ -5113,7 +5113,7 @@ export const GetServiceIdentityResponse = { fromJSON(object: any): GetServiceIdentityResponse { return { identity: isSet(object.identity) ? ServiceIdentity.fromJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toJSON(message: GetServiceIdentityResponse): unknown { @@ -5131,7 +5131,7 @@ export const GetServiceIdentityResponse = { fromSDK(object: GetServiceIdentityResponseSDKType): GetServiceIdentityResponse { return { identity: object.identity ? ServiceIdentity.fromSDK(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toSDK(message: GetServiceIdentityResponse): GetServiceIdentityResponseSDKType { @@ -5143,7 +5143,7 @@ export const GetServiceIdentityResponse = { fromAmino(object: GetServiceIdentityResponseAmino): GetServiceIdentityResponse { return { identity: object?.identity ? ServiceIdentity.fromAmino(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toAmino(message: GetServiceIdentityResponse): GetServiceIdentityResponseAmino { diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts index 5575c05051..774985110a 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/log_entry.ts @@ -785,7 +785,7 @@ export const LogEntry = { jsonPayload: isSet(object.jsonPayload) ? Struct.fromJSON(object.jsonPayload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receiveTimestamp: isSet(object.receiveTimestamp) ? new Date(object.receiveTimestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: isSet(object.insertId) ? String(object.insertId) : "", httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -865,7 +865,7 @@ export const LogEntry = { jsonPayload: object.json_payload ? Struct.fromSDK(object.json_payload) : undefined, timestamp: object.timestamp ?? undefined, receiveTimestamp: object.receive_timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object?.insert_id, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -915,9 +915,9 @@ export const LogEntry = { protoPayload: object?.proto_payload ? Any.fromAmino(object.proto_payload) : undefined, textPayload: object?.text_payload, jsonPayload: object?.json_payload ? Struct.fromAmino(object.json_payload) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, - receiveTimestamp: object?.receive_timestamp ? Timestamp.fromAmino(object.receive_timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + timestamp: object.timestamp, + receiveTimestamp: object.receive_timestamp, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object.insert_id, httpRequest: object?.http_request ? HttpRequest.fromAmino(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -941,8 +941,8 @@ export const LogEntry = { obj.proto_payload = message.protoPayload ? Any.toAmino(message.protoPayload) : undefined; obj.text_payload = message.textPayload; obj.json_payload = message.jsonPayload ? Struct.toAmino(message.jsonPayload) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; - obj.receive_timestamp = message.receiveTimestamp ? Timestamp.toAmino(message.receiveTimestamp) : undefined; + obj.timestamp = message.timestamp; + obj.receive_timestamp = message.receiveTimestamp; obj.severity = message.severity; obj.insert_id = message.insertId; obj.http_request = message.httpRequest ? HttpRequest.toAmino(message.httpRequest) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging.ts index 47c2a15ce7..a61c4a3326 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging.ts @@ -2580,7 +2580,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromJSON(object: any): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: isSet(object.suppressedCount) ? Number(object.suppressedCount) : 0 }; }, @@ -2598,7 +2598,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromSDK(object: TailLogEntriesResponse_SuppressionInfoSDKType): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object?.suppressed_count }; }, @@ -2610,7 +2610,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromAmino(object: TailLogEntriesResponse_SuppressionInfoAmino): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object.suppressed_count }; }, diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts index a646418cc1..ed1a207cc3 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_config.ts @@ -3127,7 +3127,7 @@ export const LogBucket = { updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, retentionDays: isSet(object.retentionDays) ? Number(object.retentionDays) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : 0, + lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : -1, restrictedFields: Array.isArray(object?.restrictedFields) ? object.restrictedFields.map((e: any) => String(e)) : [], cmekSettings: isSet(object.cmekSettings) ? CmekSettings.fromJSON(object.cmekSettings) : undefined }; @@ -3170,7 +3170,7 @@ export const LogBucket = { updateTime: object.update_time ?? undefined, retentionDays: object?.retention_days, locked: object?.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object.cmek_settings ? CmekSettings.fromSDK(object.cmek_settings) : undefined }; @@ -3196,11 +3196,11 @@ export const LogBucket = { return { name: object.name, description: object.description, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, retentionDays: object.retention_days, locked: object.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object?.cmek_settings ? CmekSettings.fromAmino(object.cmek_settings) : undefined }; @@ -3209,8 +3209,8 @@ export const LogBucket = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.retention_days = message.retentionDays; obj.locked = message.locked; obj.lifecycle_state = message.lifecycleState; @@ -3345,8 +3345,8 @@ export const LogView = { return { name: object.name, description: object.description, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, filter: object.filter }; }, @@ -3354,8 +3354,8 @@ export const LogView = { const obj: any = {}; obj.name = message.name; obj.description = message.description; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.filter = message.filter; return obj; }, @@ -3490,7 +3490,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromJSON(e)) : [], - outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : 0, + outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : -1, writerIdentity: isSet(object.writerIdentity) ? String(object.writerIdentity) : "", includeChildren: isSet(object.includeChildren) ? Boolean(object.includeChildren) : false, bigqueryOptions: isSet(object.bigqueryOptions) ? BigQueryOptions.fromJSON(object.bigqueryOptions) : undefined, @@ -3542,7 +3542,7 @@ export const LogSink = { description: object?.description, disabled: object?.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDK(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object?.writer_identity, includeChildren: object?.include_children, bigqueryOptions: object.bigquery_options ? BigQueryOptions.fromSDK(object.bigquery_options) : undefined, @@ -3578,12 +3578,12 @@ export const LogSink = { description: object.description, disabled: object.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromAmino(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object.writer_identity, includeChildren: object.include_children, bigqueryOptions: object?.bigquery_options ? BigQueryOptions.fromAmino(object.bigquery_options) : undefined, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + createTime: object.create_time, + updateTime: object.update_time }; }, toAmino(message: LogSink): LogSinkAmino { @@ -3602,8 +3602,8 @@ export const LogSink = { obj.writer_identity = message.writerIdentity; obj.include_children = message.includeChildren; obj.bigquery_options = message.bigqueryOptions ? BigQueryOptions.toAmino(message.bigqueryOptions) : undefined; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: LogSinkAminoMsg): LogSink { @@ -5721,8 +5721,8 @@ export const LogExclusion = { description: object.description, filter: object.filter, disabled: object.disabled, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined + createTime: object.create_time, + updateTime: object.update_time }; }, toAmino(message: LogExclusion): LogExclusionAmino { @@ -5731,8 +5731,8 @@ export const LogExclusion = { obj.description = message.description; obj.filter = message.filter; obj.disabled = message.disabled; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; return obj; }, fromAminoMsg(object: LogExclusionAminoMsg): LogExclusion { @@ -7144,7 +7144,7 @@ export const CopyLogEntriesMetadata = { return { startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: isSet(object.cancellationRequested) ? Boolean(object.cancellationRequested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, @@ -7177,7 +7177,7 @@ export const CopyLogEntriesMetadata = { return { startTime: object.start_time ?? undefined, endTime: object.end_time ?? undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object?.cancellation_requested, request: object.request ? CopyLogEntriesRequest.fromSDK(object.request) : undefined, progress: object?.progress, @@ -7197,9 +7197,9 @@ export const CopyLogEntriesMetadata = { }, fromAmino(object: CopyLogEntriesMetadataAmino): CopyLogEntriesMetadata { return { - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + startTime: object.start_time, + endTime: object.end_time, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object.cancellation_requested, request: object?.request ? CopyLogEntriesRequest.fromAmino(object.request) : undefined, progress: object.progress, @@ -7208,8 +7208,8 @@ export const CopyLogEntriesMetadata = { }, toAmino(message: CopyLogEntriesMetadata): CopyLogEntriesMetadataAmino { const obj: any = {}; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; obj.state = message.state; obj.cancellation_requested = message.cancellationRequested; obj.request = message.request ? CopyLogEntriesRequest.toAmino(message.request) : undefined; diff --git a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts index 51429e660e..c24dd1b999 100644 --- a/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv3/google/logging/v2/logging_metrics.ts @@ -816,7 +816,7 @@ export const LogMetric = { bucketOptions: isSet(object.bucketOptions) ? Distribution_BucketOptions.fromJSON(object.bucketOptions) : undefined, createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toJSON(message: LogMetric): unknown { @@ -878,7 +878,7 @@ export const LogMetric = { bucketOptions: object.bucket_options ? Distribution_BucketOptions.fromSDK(object.bucket_options) : undefined, createTime: object.create_time ?? undefined, updateTime: object.update_time ?? undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toSDK(message: LogMetric): LogMetricSDKType { @@ -916,9 +916,9 @@ export const LogMetric = { return acc; }, {}) : {}, bucketOptions: object?.bucket_options ? Distribution_BucketOptions.fromAmino(object.bucket_options) : undefined, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + createTime: object.create_time, + updateTime: object.update_time, + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toAmino(message: LogMetric): LogMetricAmino { @@ -936,8 +936,8 @@ export const LogMetric = { }); } obj.bucket_options = message.bucketOptions ? Distribution_BucketOptions.toAmino(message.bucketOptions) : undefined; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; obj.version = message.version; return obj; }, diff --git a/__fixtures__/v-next/outputv3/google/protobuf/api.ts b/__fixtures__/v-next/outputv3/google/protobuf/api.ts index 5dc4667c10..ef4bc49d38 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/api.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/api.ts @@ -539,7 +539,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Api): unknown { @@ -584,7 +584,7 @@ export const Api = { version: object?.version, sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Api): ApiSDKType { @@ -618,7 +618,7 @@ export const Api = { version: object.version, sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromAmino(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Api): ApiAmino { @@ -740,7 +740,7 @@ export const Method = { responseTypeUrl: isSet(object.responseTypeUrl) ? String(object.responseTypeUrl) : "", responseStreaming: isSet(object.responseStreaming) ? Boolean(object.responseStreaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Method): unknown { @@ -777,7 +777,7 @@ export const Method = { responseTypeUrl: object?.response_type_url, responseStreaming: object?.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Method): MethodSDKType { @@ -803,7 +803,7 @@ export const Method = { responseTypeUrl: object.response_type_url, responseStreaming: object.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Method): MethodAmino { diff --git a/__fixtures__/v-next/outputv3/google/protobuf/descriptor.ts b/__fixtures__/v-next/outputv3/google/protobuf/descriptor.ts index 3c691713fe..ad2f6fae8c 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/descriptor.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/descriptor.ts @@ -3324,8 +3324,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: isSet(object.typeName) ? String(object.typeName) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", @@ -3366,8 +3366,8 @@ export const FieldDescriptorProto = { return { name: object?.name, number: object?.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object?.type_name, extendee: object?.extendee, defaultValue: object?.default_value, @@ -3394,8 +3394,8 @@ export const FieldDescriptorProto = { return { name: object.name, number: object.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object.type_name, extendee: object.extendee, defaultValue: object.default_value, @@ -4355,7 +4355,7 @@ export const FileOptions = { javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 0, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : -1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, @@ -4434,7 +4434,7 @@ export const FileOptions = { javaMultipleFiles: object?.java_multiple_files, javaGenerateEqualsAndHash: object?.java_generate_equals_and_hash, javaStringCheckUtf8: object?.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object?.go_package, ccGenericServices: object?.cc_generic_services, javaGenericServices: object?.java_generic_services, @@ -4488,7 +4488,7 @@ export const FileOptions = { javaMultipleFiles: object.java_multiple_files, javaGenerateEqualsAndHash: object.java_generate_equals_and_hash, javaStringCheckUtf8: object.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object.go_package, ccGenericServices: object.cc_generic_services, javaGenericServices: object.java_generic_services, @@ -4774,9 +4774,9 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -4811,9 +4811,9 @@ export const FieldOptions = { }, fromSDK(object: FieldOptionsSDKType): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object?.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object?.lazy, deprecated: object?.deprecated, weak: object?.weak, @@ -4837,9 +4837,9 @@ export const FieldOptions = { }, fromAmino(object: FieldOptionsAmino): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object.lazy, deprecated: object.deprecated, weak: object.weak, @@ -5352,7 +5352,7 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, @@ -5377,7 +5377,7 @@ export const MethodOptions = { fromSDK(object: MethodOptionsSDKType): MethodOptions { return { deprecated: object?.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDK(e)) : [] }; }, @@ -5395,7 +5395,7 @@ export const MethodOptions = { fromAmino(object: MethodOptionsAmino): MethodOptions { return { deprecated: object.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts index 78a4175c12..b4a69e888a 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/timestamp.ts @@ -1,4 +1,4 @@ -import { Long, isSet, DeepPartial } from "../../helpers"; +import { Long, isSet, DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; /** @@ -349,16 +349,10 @@ export const Timestamp = { return obj; }, fromAmino(object: TimestampAmino): Timestamp { - return { - seconds: Long.fromString(object.seconds), - nanos: object.nanos - }; + return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - const obj: any = {}; - obj.seconds = message.seconds ? message.seconds.toString() : undefined; - obj.nanos = message.nanos; - return obj; + return fromTimestamp(message).toString(); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/__fixtures__/v-next/outputv3/google/protobuf/type.ts b/__fixtures__/v-next/outputv3/google/protobuf/type.ts index 9cd5993783..7f4554578b 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/type.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/type.ts @@ -569,7 +569,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Type): unknown { @@ -611,7 +611,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Type): TypeSDKType { @@ -643,7 +643,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Type): TypeAmino { @@ -779,8 +779,8 @@ export const Field = { }, fromJSON(object: any): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", @@ -825,8 +825,8 @@ export const Field = { }, fromSDK(object: FieldSDKType): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object?.number, name: object?.name, typeUrl: object?.type_url, @@ -857,8 +857,8 @@ export const Field = { }, fromAmino(object: FieldAmino): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object.number, name: object.name, typeUrl: object.type_url, @@ -967,7 +967,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Enum): unknown { @@ -1002,7 +1002,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDK(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Enum): EnumSDKType { @@ -1028,7 +1028,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromAmino(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromAmino(e)) : [], sourceContext: object?.source_context ? SourceContext.fromAmino(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toAmino(message: Enum): EnumAmino { diff --git a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts index 0859506a27..0d4337dafb 100644 --- a/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts +++ b/__fixtures__/v-next/outputv3/google/rpc/context/attribute_context.ts @@ -2070,7 +2070,7 @@ export const AttributeContext_Request = { host: object.host, scheme: object.scheme, query: object.query, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, size: Long.fromString(object.size), protocol: object.protocol, reason: object.reason, @@ -2091,7 +2091,7 @@ export const AttributeContext_Request = { obj.host = message.host; obj.scheme = message.scheme; obj.query = message.query; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.size = message.size ? message.size.toString() : undefined; obj.protocol = message.protocol; obj.reason = message.reason; @@ -2348,7 +2348,7 @@ export const AttributeContext_Response = { acc[key] = String(value); return acc; }, {}) : {}, - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, backendLatency: object?.backend_latency ? Duration.fromAmino(object.backend_latency) : undefined }; }, @@ -2362,7 +2362,7 @@ export const AttributeContext_Response = { obj.headers[k] = v; }); } - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.backend_latency = message.backendLatency ? Duration.toAmino(message.backendLatency) : undefined; return obj; }, @@ -2830,9 +2830,9 @@ export const AttributeContext_Resource = { return acc; }, {}) : {}, displayName: object.display_name, - createTime: object?.create_time ? Timestamp.fromAmino(object.create_time) : undefined, - updateTime: object?.update_time ? Timestamp.fromAmino(object.update_time) : undefined, - deleteTime: object?.delete_time ? Timestamp.fromAmino(object.delete_time) : undefined, + createTime: object.create_time, + updateTime: object.update_time, + deleteTime: object.delete_time, etag: object.etag, location: object.location }; @@ -2856,9 +2856,9 @@ export const AttributeContext_Resource = { }); } obj.display_name = message.displayName; - obj.create_time = message.createTime ? Timestamp.toAmino(message.createTime) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(message.updateTime) : undefined; - obj.delete_time = message.deleteTime ? Timestamp.toAmino(message.deleteTime) : undefined; + obj.create_time = message.createTime; + obj.update_time = message.updateTime; + obj.delete_time = message.deleteTime; obj.etag = message.etag; obj.location = message.location; return obj; diff --git a/__fixtures__/v-next/outputv3/ibc/core/channel/v1/channel.ts b/__fixtures__/v-next/outputv3/ibc/core/channel/v1/channel.ts index 290b0681d0..e4dc135ae2 100644 --- a/__fixtures__/v-next/outputv3/ibc/core/channel/v1/channel.ts +++ b/__fixtures__/v-next/outputv3/ibc/core/channel/v1/channel.ts @@ -491,8 +491,8 @@ export const Channel = { }, fromJSON(object: any): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -522,8 +522,8 @@ export const Channel = { }, fromSDK(object: ChannelSDKType): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version @@ -544,8 +544,8 @@ export const Channel = { }, fromAmino(object: ChannelAmino): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object.version @@ -661,8 +661,8 @@ export const IdentifiedChannel = { }, fromJSON(object: any): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", @@ -698,8 +698,8 @@ export const IdentifiedChannel = { }, fromSDK(object: IdentifiedChannelSDKType): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version, @@ -724,8 +724,8 @@ export const IdentifiedChannel = { }, fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object.version, diff --git a/__fixtures__/v-next/outputv3/ibc/core/connection/v1/connection.ts b/__fixtures__/v-next/outputv3/ibc/core/connection/v1/connection.ts index 799c26cd2f..cbc16e00ce 100644 --- a/__fixtures__/v-next/outputv3/ibc/core/connection/v1/connection.ts +++ b/__fixtures__/v-next/outputv3/ibc/core/connection/v1/connection.ts @@ -412,7 +412,7 @@ export const ConnectionEnd = { return { clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? Long.fromValue(object.delayPeriod) : Long.UZERO }; @@ -443,7 +443,7 @@ export const ConnectionEnd = { return { clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -465,7 +465,7 @@ export const ConnectionEnd = { return { clientId: object.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, delayPeriod: Long.fromString(object.delay_period) }; @@ -576,7 +576,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? Long.fromValue(object.delayPeriod) : Long.UZERO }; @@ -610,7 +610,7 @@ export const IdentifiedConnection = { id: object?.id, clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -634,7 +634,7 @@ export const IdentifiedConnection = { id: object.id, clientId: object.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, delayPeriod: Long.fromString(object.delay_period) }; diff --git a/__fixtures__/v-next/outputv3/ibc/core/port/v1/query.ts b/__fixtures__/v-next/outputv3/ibc/core/port/v1/query.ts index b62ae50e2d..c1033322f2 100644 --- a/__fixtures__/v-next/outputv3/ibc/core/port/v1/query.ts +++ b/__fixtures__/v-next/outputv3/ibc/core/port/v1/query.ts @@ -134,7 +134,7 @@ export const QueryAppVersionRequest = { return { portId: isSet(object.portId) ? String(object.portId) : "", connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, proposedVersion: isSet(object.proposedVersion) ? String(object.proposedVersion) : "" }; @@ -161,7 +161,7 @@ export const QueryAppVersionRequest = { return { portId: object?.port_id, connectionId: object?.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, proposedVersion: object?.proposed_version }; @@ -179,7 +179,7 @@ export const QueryAppVersionRequest = { return { portId: object.port_id, connectionId: object.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, proposedVersion: object.proposed_version }; diff --git a/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v1/solomachine.ts b/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v1/solomachine.ts index 64d7da471f..6bb0d23e72 100644 --- a/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v1/solomachine.ts @@ -1222,7 +1222,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO }; @@ -1246,7 +1246,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -1262,7 +1262,7 @@ export const SignatureAndData = { fromAmino(object: SignatureAndDataAmino): SignatureAndData { return { signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data, timestamp: Long.fromString(object.timestamp) }; @@ -1463,7 +1463,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO, diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1490,7 +1490,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1508,7 +1508,7 @@ export const SignBytes = { sequence: Long.fromString(object.sequence), timestamp: Long.fromString(object.timestamp), diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data }; }, diff --git a/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v2/solomachine.ts b/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v2/solomachine.ts index 61aaa00601..08979b32d9 100644 --- a/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/__fixtures__/v-next/outputv3/ibc/lightclients/solomachine/v2/solomachine.ts @@ -1222,7 +1222,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO }; @@ -1246,7 +1246,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -1262,7 +1262,7 @@ export const SignatureAndData = { fromAmino(object: SignatureAndDataAmino): SignatureAndData { return { signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data, timestamp: Long.fromString(object.timestamp) }; @@ -1463,7 +1463,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO, timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO, diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1490,7 +1490,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1508,7 +1508,7 @@ export const SignBytes = { sequence: Long.fromString(object.sequence), timestamp: Long.fromString(object.timestamp), diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object.data }; }, diff --git a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts index 6d3c9d3af9..d87cfa511a 100644 --- a/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/v-next/outputv3/ibc/lightclients/tendermint/v1/tendermint.ts @@ -624,14 +624,14 @@ export const ConsensusState = { }, fromAmino(object: ConsensusStateAmino): ConsensusState { return { - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, nextValidatorsHash: object.next_validators_hash }; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; obj.next_validators_hash = message.nextValidatorsHash; return obj; diff --git a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts index 6da524e57f..26cd049c85 100644 --- a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/params.ts @@ -128,7 +128,7 @@ export const Params = { }, fromAmino(object: ParamsAmino): Params { return { - airdropStartTime: object?.airdrop_start_time ? Timestamp.fromAmino(object.airdrop_start_time) : undefined, + airdropStartTime: object.airdrop_start_time, 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 @@ -136,7 +136,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.airdrop_start_time = message.airdropStartTime ? Timestamp.toAmino(message.airdropStartTime) : undefined; + obj.airdrop_start_time = message.airdropStartTime; obj.duration_until_decay = message.durationUntilDecay ? Duration.toAmino(message.durationUntilDecay) : undefined; obj.duration_of_decay = message.durationOfDecay ? Duration.toAmino(message.durationOfDecay) : undefined; obj.claim_denom = message.claimDenom; diff --git a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/query.ts b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/query.ts index ce9baa6cf4..b81026e3ab 100644 --- a/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/claim/v1beta1/query.ts @@ -726,7 +726,7 @@ export const QueryClaimableForActionRequest = { fromJSON(object: any): QueryClaimableForActionRequest { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toJSON(message: QueryClaimableForActionRequest): unknown { @@ -744,7 +744,7 @@ export const QueryClaimableForActionRequest = { fromSDK(object: QueryClaimableForActionRequestSDKType): QueryClaimableForActionRequest { return { address: object?.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toSDK(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestSDKType { @@ -756,7 +756,7 @@ export const QueryClaimableForActionRequest = { fromAmino(object: QueryClaimableForActionRequestAmino): QueryClaimableForActionRequest { return { address: object.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toAmino(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestAmino { diff --git a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts index a79a17c1b6..3de09395ad 100644 --- a/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts +++ b/__fixtures__/v-next/outputv3/osmosis/epochs/genesis.ts @@ -291,10 +291,10 @@ export const EpochInfo = { fromAmino(object: EpochInfoAmino): EpochInfo { return { identifier: object.identifier, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, currentEpoch: Long.fromString(object.current_epoch), - currentEpochStartTime: object?.current_epoch_start_time ? Timestamp.fromAmino(object.current_epoch_start_time) : undefined, + currentEpochStartTime: object.current_epoch_start_time, epochCountingStarted: object.epoch_counting_started, currentEpochStartHeight: Long.fromString(object.current_epoch_start_height) }; @@ -302,10 +302,10 @@ export const EpochInfo = { toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(message.currentEpochStartTime) : undefined; + obj.current_epoch_start_time = message.currentEpochStartTime; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; diff --git a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts index 50fc6a6bdd..79635aa6e4 100644 --- a/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/v-next/outputv3/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -375,7 +375,7 @@ export const SmoothWeightChangeParams = { }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { return { - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, 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)) : [] @@ -383,7 +383,7 @@ export const SmoothWeightChangeParams = { }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts index 2f1990aafe..b0ffd44b1f 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/gauge.ts @@ -291,7 +291,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: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, numEpochsPaidOver: Long.fromString(object.num_epochs_paid_over), filledEpochs: Long.fromString(object.filled_epochs), distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] @@ -307,7 +307,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { diff --git a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts index db97d3df74..0a591ef965 100644 --- a/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts +++ b/__fixtures__/v-next/outputv3/osmosis/incentives/tx.ts @@ -259,7 +259,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: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, + startTime: object.start_time, numEpochsPaidOver: Long.fromString(object.num_epochs_paid_over) }; }, @@ -273,7 +273,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts index 53cf4429db..8d94785325 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/lock.ts @@ -386,7 +386,7 @@ export const PeriodLock = { ID: Long.fromString(object.ID), owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + endTime: object.end_time, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, @@ -395,7 +395,7 @@ export const PeriodLock = { obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.end_time = message.endTime; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -479,7 +479,7 @@ export const QueryCondition = { }, fromJSON(object: any): QueryCondition { return { - lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : 0, + lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined @@ -503,7 +503,7 @@ export const QueryCondition = { }, fromSDK(object: QueryConditionSDKType): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object?.denom, duration: object.duration ? Duration.fromSDK(object.duration) : undefined, timestamp: object.timestamp ?? undefined @@ -519,10 +519,10 @@ export const QueryCondition = { }, fromAmino(object: QueryConditionAmino): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object.denom, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: QueryCondition): QueryConditionAmino { @@ -530,7 +530,7 @@ export const QueryCondition = { obj.lock_query_type = message.lockQueryType; obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -651,7 +651,7 @@ export const SyntheticLock = { return { underlyingLockId: Long.fromString(object.underlying_lock_id), synthDenom: object.synth_denom, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined, + endTime: object.end_time, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined }; }, @@ -659,7 +659,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.end_time = message.endTime; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts index dc2e585910..32c96af9d9 100644 --- a/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/lockup/query.ts @@ -1574,13 +1574,13 @@ export const AccountLockedPastTimeRequest = { fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1776,13 +1776,13 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1978,13 +1978,13 @@ export const AccountUnlockedBeforeTimeRequest = { fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -2192,14 +2192,14 @@ export const AccountLockedPastTimeDenomRequest = { fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { return { owner: object.owner, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, denom: object.denom }; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.denom = message.denom; return obj; }, diff --git a/__fixtures__/v-next/outputv3/osmosis/superfluid/query.ts b/__fixtures__/v-next/outputv3/osmosis/superfluid/query.ts index d7e4383931..aa070481d8 100644 --- a/__fixtures__/v-next/outputv3/osmosis/superfluid/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/superfluid/query.ts @@ -862,7 +862,7 @@ export const AssetTypeResponse = { }, fromJSON(object: any): AssetTypeResponse { return { - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: AssetTypeResponse): unknown { @@ -877,7 +877,7 @@ export const AssetTypeResponse = { }, fromSDK(object: AssetTypeResponseSDKType): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: AssetTypeResponse): AssetTypeResponseSDKType { @@ -887,7 +887,7 @@ export const AssetTypeResponse = { }, fromAmino(object: AssetTypeResponseAmino): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toAmino(message: AssetTypeResponse): AssetTypeResponseAmino { diff --git a/__fixtures__/v-next/outputv3/osmosis/superfluid/superfluid.ts b/__fixtures__/v-next/outputv3/osmosis/superfluid/superfluid.ts index fb4b0b7857..fdf2ce1188 100644 --- a/__fixtures__/v-next/outputv3/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/v-next/outputv3/osmosis/superfluid/superfluid.ts @@ -294,7 +294,7 @@ export const SuperfluidAsset = { fromJSON(object: any): SuperfluidAsset { return { denom: isSet(object.denom) ? String(object.denom) : "", - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: SuperfluidAsset): unknown { @@ -312,7 +312,7 @@ export const SuperfluidAsset = { fromSDK(object: SuperfluidAssetSDKType): SuperfluidAsset { return { denom: object?.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: SuperfluidAsset): SuperfluidAssetSDKType { @@ -324,7 +324,7 @@ export const SuperfluidAsset = { fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { return { denom: object.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts index 600ea215c2..54c302b71b 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/query.ts @@ -229,8 +229,8 @@ export const ArithmeticTwapRequest = { poolId: Long.fromString(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined, - endTime: object?.end_time ? Timestamp.fromAmino(object.end_time) : undefined + startTime: object.start_time, + endTime: object?.end_time }; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { @@ -238,8 +238,8 @@ export const ArithmeticTwapRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; - obj.end_time = message.endTime ? Timestamp.toAmino(message.endTime) : undefined; + obj.start_time = message.startTime; + obj.end_time = message.endTime; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -449,7 +449,7 @@ export const ArithmeticTwapToNowRequest = { poolId: Long.fromString(object.pool_id), baseAsset: object.base_asset, quoteAsset: object.quote_asset, - startTime: object?.start_time ? Timestamp.fromAmino(object.start_time) : undefined + startTime: object.start_time }; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { @@ -457,7 +457,7 @@ export const ArithmeticTwapToNowRequest = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime ? Timestamp.toAmino(message.startTime) : undefined; + obj.start_time = message.startTime; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { diff --git a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts index 29d7211001..8085dad53c 100644 --- a/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/v-next/outputv3/osmosis/twap/v1beta1/twap_record.ts @@ -275,12 +275,12 @@ export const TwapRecord = { asset0Denom: object.asset0_denom, asset1Denom: object.asset1_denom, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, p0LastSpotPrice: object.p0_last_spot_price, p1LastSpotPrice: object.p1_last_spot_price, p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - lastErrorTime: object?.last_error_time ? Timestamp.fromAmino(object.last_error_time) : undefined + lastErrorTime: object.last_error_time }; }, toAmino(message: TwapRecord): TwapRecordAmino { @@ -289,12 +289,12 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; - obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(message.lastErrorTime) : undefined; + obj.last_error_time = message.lastErrorTime; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts index cb92d65f6f..8ac0e95f12 100644 --- a/__fixtures__/v-next/outputv3/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/abci/types.ts @@ -2136,7 +2136,7 @@ export const RequestInitChain = { }, fromAmino(object: RequestInitChainAmino): RequestInitChain { return { - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, chainId: object.chain_id, consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], @@ -2146,7 +2146,7 @@ export const RequestInitChain = { }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -2472,7 +2472,7 @@ export const RequestCheckTx = { fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toJSON(message: RequestCheckTx): unknown { @@ -2490,7 +2490,7 @@ export const RequestCheckTx = { fromSDK(object: RequestCheckTxSDKType): RequestCheckTx { return { tx: object?.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toSDK(message: RequestCheckTx): RequestCheckTxSDKType { @@ -2502,7 +2502,7 @@ export const RequestCheckTx = { fromAmino(object: RequestCheckTxAmino): RequestCheckTx { return { tx: object.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { @@ -5032,7 +5032,7 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toJSON(message: ResponseOfferSnapshot): unknown { @@ -5047,7 +5047,7 @@ export const ResponseOfferSnapshot = { }, fromSDK(object: ResponseOfferSnapshotSDKType): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toSDK(message: ResponseOfferSnapshot): ResponseOfferSnapshotSDKType { @@ -5057,7 +5057,7 @@ export const ResponseOfferSnapshot = { }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { @@ -5217,7 +5217,7 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [] }; @@ -5246,7 +5246,7 @@ export const ResponseApplySnapshotChunk = { }, fromSDK(object: ResponseApplySnapshotChunkSDKType): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; @@ -5268,7 +5268,7 @@ export const ResponseApplySnapshotChunk = { }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; @@ -6313,7 +6313,7 @@ export const Evidence = { }, fromJSON(object: any): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, time: isSet(object.time) ? new Date(object.time) : undefined, @@ -6340,7 +6340,7 @@ export const Evidence = { }, fromSDK(object: EvidenceSDKType): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object.validator ? Validator.fromSDK(object.validator) : undefined, height: object?.height, time: object.time ?? undefined, @@ -6358,10 +6358,10 @@ export const Evidence = { }, fromAmino(object: EvidenceAmino): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, totalVotingPower: Long.fromString(object.total_voting_power) }; }, @@ -6370,7 +6370,7 @@ export const Evidence = { obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, diff --git a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts index ed2cfd138b..b08e7e625b 100644 --- a/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/p2p/types.ts @@ -606,7 +606,7 @@ export const PeerInfo = { return { id: object.id, addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object?.last_connected ? Timestamp.fromAmino(object.last_connected) : undefined + lastConnected: object.last_connected }; }, toAmino(message: PeerInfo): PeerInfoAmino { @@ -617,7 +617,7 @@ export const PeerInfo = { } else { obj.address_info = []; } - obj.last_connected = message.lastConnected ? Timestamp.toAmino(message.lastConnected) : undefined; + obj.last_connected = message.lastConnected; return obj; }, fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { @@ -730,16 +730,16 @@ export const PeerAddressInfo = { fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { return { address: object.address, - lastDialSuccess: object?.last_dial_success ? Timestamp.fromAmino(object.last_dial_success) : undefined, - lastDialFailure: object?.last_dial_failure ? Timestamp.fromAmino(object.last_dial_failure) : undefined, + lastDialSuccess: object.last_dial_success, + lastDialFailure: object.last_dial_failure, dialFailures: object.dial_failures }; }, toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { const obj: any = {}; obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess ? Timestamp.toAmino(message.lastDialSuccess) : undefined; - obj.last_dial_failure = message.lastDialFailure ? Timestamp.toAmino(message.lastDialFailure) : undefined; + obj.last_dial_success = message.lastDialSuccess; + obj.last_dial_failure = message.lastDialFailure; obj.dial_failures = message.dialFailures; return obj; }, diff --git a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts index c68b233a36..90ebfa2a6a 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/evidence.ts @@ -309,7 +309,7 @@ export const DuplicateVoteEvidence = { voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, totalVotingPower: Long.fromString(object.total_voting_power), validatorPower: Long.fromString(object.validator_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { @@ -318,7 +318,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -454,7 +454,7 @@ export const LightClientAttackEvidence = { commonHeight: Long.fromString(object.common_height), byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], totalVotingPower: Long.fromString(object.total_voting_power), - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined + timestamp: object.timestamp }; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { @@ -467,7 +467,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { diff --git a/__fixtures__/v-next/outputv3/tendermint/types/types.ts b/__fixtures__/v-next/outputv3/tendermint/types/types.ts index 8d9c5cd6d6..b509ebe2c9 100644 --- a/__fixtures__/v-next/outputv3/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv3/tendermint/types/types.ts @@ -1025,7 +1025,7 @@ export const Header = { version: object?.version ? Consensus.fromAmino(object.version) : undefined, chainId: object.chain_id, height: Long.fromString(object.height), - time: object?.time ? Timestamp.fromAmino(object.time) : undefined, + time: object.time, lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, lastCommitHash: object.last_commit_hash, dataHash: object.data_hash, @@ -1043,7 +1043,7 @@ export const Header = { obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(message.time) : undefined; + obj.time = message.time; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; obj.last_commit_hash = message.lastCommitHash; obj.data_hash = message.dataHash; @@ -1246,7 +1246,7 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, @@ -1282,7 +1282,7 @@ export const Vote = { }, fromSDK(object: VoteSDKType): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, blockId: object.block_id ? BlockID.fromSDK(object.block_id) : undefined, @@ -1306,11 +1306,11 @@ export const Vote = { }, fromAmino(object: VoteAmino): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: Long.fromString(object.height), round: object.round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, validatorAddress: object.validator_address, validatorIndex: object.validator_index, signature: object.signature @@ -1322,7 +1322,7 @@ export const Vote = { obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.validator_address = message.validatorAddress; obj.validator_index = message.validatorIndex; obj.signature = message.signature; @@ -1532,7 +1532,7 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1556,7 +1556,7 @@ export const CommitSig = { }, fromSDK(object: CommitSigSDKType): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object?.validator_address, timestamp: object.timestamp ?? undefined, signature: object?.signature @@ -1572,9 +1572,9 @@ export const CommitSig = { }, fromAmino(object: CommitSigAmino): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object.validator_address, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, signature: object.signature }; }, @@ -1582,7 +1582,7 @@ export const CommitSig = { const obj: any = {}; obj.block_id_flag = message.blockIdFlag; obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.signature = message.signature; return obj; }, @@ -1676,7 +1676,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, @@ -1709,7 +1709,7 @@ export const Proposal = { }, fromSDK(object: ProposalSDKType): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, polRound: object?.pol_round, @@ -1731,12 +1731,12 @@ export const Proposal = { }, fromAmino(object: ProposalAmino): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: Long.fromString(object.height), round: object.round, polRound: object.pol_round, blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object?.timestamp ? Timestamp.fromAmino(object.timestamp) : undefined, + timestamp: object.timestamp, signature: object.signature }; }, @@ -1747,7 +1747,7 @@ export const Proposal = { obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp ? Timestamp.toAmino(message.timestamp) : undefined; + obj.timestamp = message.timestamp; obj.signature = message.signature; return obj; }, diff --git a/__fixtures__/v-next/outputv4/akash/base/v1beta1/endpoint.ts b/__fixtures__/v-next/outputv4/akash/base/v1beta1/endpoint.ts index aaa5d7db30..700e373d2a 100644 --- a/__fixtures__/v-next/outputv4/akash/base/v1beta1/endpoint.ts +++ b/__fixtures__/v-next/outputv4/akash/base/v1beta1/endpoint.ts @@ -74,7 +74,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toJSON(message: Endpoint): unknown { @@ -89,12 +89,12 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, fromSDKJSON(object: any): EndpointSDKType { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0 + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1 }; }, toSDK(message: Endpoint): EndpointSDKType { diff --git a/__fixtures__/v-next/outputv4/akash/base/v1beta2/endpoint.ts b/__fixtures__/v-next/outputv4/akash/base/v1beta2/endpoint.ts index 960e3d48a2..e2c6055434 100644 --- a/__fixtures__/v-next/outputv4/akash/base/v1beta2/endpoint.ts +++ b/__fixtures__/v-next/outputv4/akash/base/v1beta2/endpoint.ts @@ -90,7 +90,7 @@ export const Endpoint = { }, fromJSON(object: any): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: isSet(object.sequenceNumber) ? Number(object.sequenceNumber) : 0 }; }, @@ -108,13 +108,13 @@ export const Endpoint = { }, fromSDK(object: EndpointSDKType): Endpoint { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequenceNumber: object?.sequence_number }; }, fromSDKJSON(object: any): EndpointSDKType { return { - kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? endpoint_KindFromJSON(object.kind) : -1, sequence_number: isSet(object.sequence_number) ? Number(object.sequence_number) : 0 }; }, diff --git a/__fixtures__/v-next/outputv4/akash/cert/v1beta2/cert.ts b/__fixtures__/v-next/outputv4/akash/cert/v1beta2/cert.ts index 478c214600..939f8895aa 100644 --- a/__fixtures__/v-next/outputv4/akash/cert/v1beta2/cert.ts +++ b/__fixtures__/v-next/outputv4/akash/cert/v1beta2/cert.ts @@ -222,7 +222,7 @@ export const Certificate = { }, fromJSON(object: any): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; @@ -243,14 +243,14 @@ export const Certificate = { }, fromSDK(object: CertificateSDKType): Certificate { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: object?.cert, pubkey: object?.pubkey }; }, fromSDKJSON(object: any): CertificateSDKType { return { - state: isSet(object.state) ? certificate_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? certificate_StateFromJSON(object.state) : -1, cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(), pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array() }; diff --git a/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/deployment.ts b/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/deployment.ts index 66f680215e..1e2788448e 100644 --- a/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/deployment.ts +++ b/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/deployment.ts @@ -774,7 +774,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -798,7 +798,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -806,7 +806,7 @@ export const Deployment = { fromSDKJSON(object: any): DeploymentSDKType { return { deployment_id: isSet(object.deployment_id) ? DeploymentID.fromSDKJSON(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/group.ts b/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/group.ts index b1e43e7547..68940ef266 100644 --- a/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/group.ts +++ b/__fixtures__/v-next/outputv4/akash/deployment/v1beta1/group.ts @@ -687,7 +687,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -711,7 +711,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -719,7 +719,7 @@ export const Group = { fromSDKJSON(object: any): GroupSDKType { return { group_id: isSet(object.group_id) ? GroupID.fromSDKJSON(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, group_spec: isSet(object.group_spec) ? GroupSpec.fromSDKJSON(object.group_spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/deployment.ts b/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/deployment.ts index 8b803fa97f..3f81143d6f 100644 --- a/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/deployment.ts +++ b/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/deployment.ts @@ -204,7 +204,7 @@ export const Deployment = { fromJSON(object: any): Deployment { return { deploymentId: isSet(object.deploymentId) ? DeploymentID.fromJSON(object.deploymentId) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -228,7 +228,7 @@ export const Deployment = { fromSDK(object: DeploymentSDKType): Deployment { return { deploymentId: object.deployment_id ? DeploymentID.fromSDK(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: object?.version, createdAt: object?.created_at }; @@ -236,7 +236,7 @@ export const Deployment = { fromSDKJSON(object: any): DeploymentSDKType { return { deployment_id: isSet(object.deployment_id) ? DeploymentID.fromSDKJSON(object.deployment_id) : undefined, - state: isSet(object.state) ? deployment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? deployment_StateFromJSON(object.state) : -1, version: isSet(object.version) ? bytesFromBase64(object.version) : new Uint8Array(), created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/group.ts b/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/group.ts index 69ceec779f..e39732dc5c 100644 --- a/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/group.ts +++ b/__fixtures__/v-next/outputv4/akash/deployment/v1beta2/group.ts @@ -125,7 +125,7 @@ export const Group = { fromJSON(object: any): Group { return { groupId: isSet(object.groupId) ? GroupID.fromJSON(object.groupId) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: isSet(object.groupSpec) ? GroupSpec.fromJSON(object.groupSpec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -149,7 +149,7 @@ export const Group = { fromSDK(object: GroupSDKType): Group { return { groupId: object.group_id ? GroupID.fromSDK(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, groupSpec: object.group_spec ? GroupSpec.fromSDK(object.group_spec) : undefined, createdAt: object?.created_at }; @@ -157,7 +157,7 @@ export const Group = { fromSDKJSON(object: any): GroupSDKType { return { group_id: isSet(object.group_id) ? GroupID.fromSDKJSON(object.group_id) : undefined, - state: isSet(object.state) ? group_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? group_StateFromJSON(object.state) : -1, group_spec: isSet(object.group_spec) ? GroupSpec.fromSDKJSON(object.group_spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/akash/escrow/v1beta1/types.ts b/__fixtures__/v-next/outputv4/akash/escrow/v1beta1/types.ts index 9c8d1eda49..8a1fe43409 100644 --- a/__fixtures__/v-next/outputv4/akash/escrow/v1beta1/types.ts +++ b/__fixtures__/v-next/outputv4/akash/escrow/v1beta1/types.ts @@ -293,7 +293,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? BigInt(object.settledAt.toString()) : BigInt(0) @@ -323,7 +323,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, transferred: object.transferred ? Coin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at @@ -333,7 +333,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromSDKJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? Coin.fromSDKJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? Coin.fromSDKJSON(object.transferred) : undefined, settled_at: isSet(object.settled_at) ? BigInt(object.settled_at.toString()) : BigInt(0) @@ -426,7 +426,7 @@ export const Payment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -459,7 +459,7 @@ export const Payment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: object.rate ? Coin.fromSDK(object.rate) : undefined, balance: object.balance ? Coin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -470,7 +470,7 @@ export const Payment = { account_id: isSet(object.account_id) ? AccountID.fromSDKJSON(object.account_id) : undefined, payment_id: isSet(object.payment_id) ? String(object.payment_id) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? payment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? payment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? Coin.fromSDKJSON(object.rate) : undefined, balance: isSet(object.balance) ? Coin.fromSDKJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromSDKJSON(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv4/akash/escrow/v1beta2/types.ts b/__fixtures__/v-next/outputv4/akash/escrow/v1beta2/types.ts index d61ee4ef79..bd9d151e39 100644 --- a/__fixtures__/v-next/outputv4/akash/escrow/v1beta2/types.ts +++ b/__fixtures__/v-next/outputv4/akash/escrow/v1beta2/types.ts @@ -320,7 +320,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromJSON(object.transferred) : undefined, settledAt: isSet(object.settledAt) ? BigInt(object.settledAt.toString()) : BigInt(0), @@ -356,7 +356,7 @@ export const Account = { return { id: object.id ? AccountID.fromSDK(object.id) : undefined, owner: object?.owner, - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, transferred: object.transferred ? DecCoin.fromSDK(object.transferred) : undefined, settledAt: object?.settled_at, @@ -368,7 +368,7 @@ export const Account = { return { id: isSet(object.id) ? AccountID.fromSDKJSON(object.id) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? account_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? account_StateFromJSON(object.state) : -1, balance: isSet(object.balance) ? DecCoin.fromSDKJSON(object.balance) : undefined, transferred: isSet(object.transferred) ? DecCoin.fromSDKJSON(object.transferred) : undefined, settled_at: isSet(object.settled_at) ? BigInt(object.settled_at.toString()) : BigInt(0), @@ -465,7 +465,7 @@ export const FractionalPayment = { accountId: isSet(object.accountId) ? AccountID.fromJSON(object.accountId) : undefined, paymentId: isSet(object.paymentId) ? String(object.paymentId) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromJSON(object.withdrawn) : undefined @@ -498,7 +498,7 @@ export const FractionalPayment = { accountId: object.account_id ? AccountID.fromSDK(object.account_id) : undefined, paymentId: object?.payment_id, owner: object?.owner, - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: object.rate ? DecCoin.fromSDK(object.rate) : undefined, balance: object.balance ? DecCoin.fromSDK(object.balance) : undefined, withdrawn: object.withdrawn ? Coin.fromSDK(object.withdrawn) : undefined @@ -509,7 +509,7 @@ export const FractionalPayment = { account_id: isSet(object.account_id) ? AccountID.fromSDKJSON(object.account_id) : undefined, payment_id: isSet(object.payment_id) ? String(object.payment_id) : "", owner: isSet(object.owner) ? String(object.owner) : "", - state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? fractionalPayment_StateFromJSON(object.state) : -1, rate: isSet(object.rate) ? DecCoin.fromSDKJSON(object.rate) : undefined, balance: isSet(object.balance) ? DecCoin.fromSDKJSON(object.balance) : undefined, withdrawn: isSet(object.withdrawn) ? Coin.fromSDKJSON(object.withdrawn) : undefined diff --git a/__fixtures__/v-next/outputv4/akash/market/v1beta2/bid.ts b/__fixtures__/v-next/outputv4/akash/market/v1beta2/bid.ts index b7a85d5b5a..0d795924e4 100644 --- a/__fixtures__/v-next/outputv4/akash/market/v1beta2/bid.ts +++ b/__fixtures__/v-next/outputv4/akash/market/v1beta2/bid.ts @@ -552,7 +552,7 @@ export const Bid = { fromJSON(object: any): Bid { return { bidId: isSet(object.bidId) ? BidID.fromJSON(object.bidId) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -576,7 +576,7 @@ export const Bid = { fromSDK(object: BidSDKType): Bid { return { bidId: object.bid_id ? BidID.fromSDK(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at }; @@ -584,7 +584,7 @@ export const Bid = { fromSDKJSON(object: any): BidSDKType { return { bid_id: isSet(object.bid_id) ? BidID.fromSDKJSON(object.bid_id) : undefined, - state: isSet(object.state) ? bid_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? bid_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromSDKJSON(object.price) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/akash/market/v1beta2/lease.ts b/__fixtures__/v-next/outputv4/akash/market/v1beta2/lease.ts index a172482379..539a98c90d 100644 --- a/__fixtures__/v-next/outputv4/akash/market/v1beta2/lease.ts +++ b/__fixtures__/v-next/outputv4/akash/market/v1beta2/lease.ts @@ -309,7 +309,7 @@ export const Lease = { fromJSON(object: any): Lease { return { leaseId: isSet(object.leaseId) ? LeaseID.fromJSON(object.leaseId) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0), closedOn: isSet(object.closedOn) ? BigInt(object.closedOn.toString()) : BigInt(0) @@ -336,7 +336,7 @@ export const Lease = { fromSDK(object: LeaseSDKType): Lease { return { leaseId: object.lease_id ? LeaseID.fromSDK(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: object.price ? DecCoin.fromSDK(object.price) : undefined, createdAt: object?.created_at, closedOn: object?.closed_on @@ -345,7 +345,7 @@ export const Lease = { fromSDKJSON(object: any): LeaseSDKType { return { lease_id: isSet(object.lease_id) ? LeaseID.fromSDKJSON(object.lease_id) : undefined, - state: isSet(object.state) ? lease_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? lease_StateFromJSON(object.state) : -1, price: isSet(object.price) ? DecCoin.fromSDKJSON(object.price) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0), closed_on: isSet(object.closed_on) ? BigInt(object.closed_on.toString()) : BigInt(0) diff --git a/__fixtures__/v-next/outputv4/akash/market/v1beta2/order.ts b/__fixtures__/v-next/outputv4/akash/market/v1beta2/order.ts index 84be24faf4..ffee5afb38 100644 --- a/__fixtures__/v-next/outputv4/akash/market/v1beta2/order.ts +++ b/__fixtures__/v-next/outputv4/akash/market/v1beta2/order.ts @@ -246,7 +246,7 @@ export const Order = { fromJSON(object: any): Order { return { orderId: isSet(object.orderId) ? OrderID.fromJSON(object.orderId) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromJSON(object.spec) : undefined, createdAt: isSet(object.createdAt) ? BigInt(object.createdAt.toString()) : BigInt(0) }; @@ -270,7 +270,7 @@ export const Order = { fromSDK(object: OrderSDKType): Order { return { orderId: object.order_id ? OrderID.fromSDK(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: object.spec ? GroupSpec.fromSDK(object.spec) : undefined, createdAt: object?.created_at }; @@ -278,7 +278,7 @@ export const Order = { fromSDKJSON(object: any): OrderSDKType { return { order_id: isSet(object.order_id) ? OrderID.fromSDKJSON(object.order_id) : undefined, - state: isSet(object.state) ? order_StateFromJSON(object.state) : 0, + state: isSet(object.state) ? order_StateFromJSON(object.state) : -1, spec: isSet(object.spec) ? GroupSpec.fromSDKJSON(object.spec) : undefined, created_at: isSet(object.created_at) ? BigInt(object.created_at.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/binary.ts b/__fixtures__/v-next/outputv4/binary.ts index a353b1190f..3e8b563b9c 100644 --- a/__fixtures__/v-next/outputv4/binary.ts +++ b/__fixtures__/v-next/outputv4/binary.ts @@ -189,11 +189,11 @@ export class BinaryReader { return BigInt(int64ToString(lo, hi)); } - float() { + float(): number { throw new Error("float not supported"); } - double() { + double(): number { throw new Error("double not supported"); } diff --git a/__fixtures__/v-next/outputv4/confio/proofs.ts b/__fixtures__/v-next/outputv4/confio/proofs.ts index 3963319dae..3e71846403 100644 --- a/__fixtures__/v-next/outputv4/confio/proofs.ts +++ b/__fixtures__/v-next/outputv4/confio/proofs.ts @@ -825,10 +825,10 @@ export const LeafOp = { }, fromJSON(object: any): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : 0, - prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -852,19 +852,19 @@ export const LeafOp = { }, fromSDK(object: LeafOpSDKType): LeafOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: object?.prefix }; }, fromSDKJSON(object: any): LeafOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, - prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : 0, - prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : 0, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehash_key: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, + prehash_value: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array() }; }, @@ -923,7 +923,7 @@ export const InnerOp = { }, fromJSON(object: any): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -944,14 +944,14 @@ export const InnerOp = { }, fromSDK(object: InnerOpSDKType): InnerOp { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: object?.prefix, suffix: object?.suffix }; }, fromSDKJSON(object: any): InnerOpSDKType { return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0, + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, prefix: isSet(object.prefix) ? bytesFromBase64(object.prefix) : new Uint8Array(), suffix: isSet(object.suffix) ? bytesFromBase64(object.suffix) : new Uint8Array() }; @@ -1143,7 +1143,7 @@ export const InnerSpec = { minPrefixLength: isSet(object.minPrefixLength) ? Number(object.minPrefixLength) : 0, maxPrefixLength: isSet(object.maxPrefixLength) ? Number(object.maxPrefixLength) : 0, emptyChild: isSet(object.emptyChild) ? bytesFromBase64(object.emptyChild) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toJSON(message: InnerSpec): unknown { @@ -1177,7 +1177,7 @@ export const InnerSpec = { minPrefixLength: object?.min_prefix_length, maxPrefixLength: object?.max_prefix_length, emptyChild: object?.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, fromSDKJSON(object: any): InnerSpecSDKType { @@ -1187,7 +1187,7 @@ export const InnerSpec = { min_prefix_length: isSet(object.min_prefix_length) ? Number(object.min_prefix_length) : 0, max_prefix_length: isSet(object.max_prefix_length) ? Number(object.max_prefix_length) : 0, empty_child: isSet(object.empty_child) ? bytesFromBase64(object.empty_child) : new Uint8Array(), - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : 0 + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 }; }, toSDK(message: InnerSpec): InnerSpecSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts index b3f6175c43..04067f5d0b 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1/gov.ts @@ -315,7 +315,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -333,13 +333,13 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, fromSDKJSON(object: any): WeightedVoteOptionSDKType { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -540,7 +540,7 @@ export const Proposal = { return { id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -590,7 +590,7 @@ export const Proposal = { return { id: object?.id, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -604,7 +604,7 @@ export const Proposal = { return { id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [], - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, deposit_end_time: isSet(object.deposit_end_time) ? new Date(object.deposit_end_time) : undefined, diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1/query.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1/query.ts index 9b39caef35..3d9254839a 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1/query.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1/query.ts @@ -361,7 +361,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -385,7 +385,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -393,7 +393,7 @@ export const QueryProposalsRequest = { }, fromSDKJSON(object: any): QueryProposalsRequestSDKType { return { - proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1/tx.ts index 263faa6862..4d635671bb 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1/tx.ts @@ -452,7 +452,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, @@ -476,7 +476,7 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata }; }, @@ -484,7 +484,7 @@ export const MsgVote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "" }; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts index 6a78917039..7ae991416a 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/gov.ts @@ -344,7 +344,7 @@ export const WeightedVoteOption = { }, fromJSON(object: any): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -362,13 +362,13 @@ export const WeightedVoteOption = { }, fromSDK(object: WeightedVoteOptionSDKType): WeightedVoteOption { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: object?.weight }; }, fromSDKJSON(object: any): WeightedVoteOptionSDKType { return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, weight: isSet(object.weight) ? String(object.weight) : "" }; }, @@ -635,7 +635,7 @@ export const Proposal = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, @@ -678,7 +678,7 @@ export const Proposal = { return { proposalId: object?.proposal_id, content: object.content ? Any.fromSDK(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, submitTime: object.submit_time ?? undefined, depositEndTime: object.deposit_end_time ?? undefined, @@ -691,7 +691,7 @@ export const Proposal = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), content: isSet(object.content) ? Any.fromSDKJSON(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, deposit_end_time: isSet(object.deposit_end_time) ? new Date(object.deposit_end_time) : undefined, @@ -871,7 +871,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromJSON(e)) : [] }; }, @@ -899,7 +899,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDK(e)) : [] }; }, @@ -907,7 +907,7 @@ export const Vote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/query.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/query.ts index 037b103884..2bb9446bf7 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/query.ts @@ -361,7 +361,7 @@ export const QueryProposalsRequest = { }, fromJSON(object: any): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : 0, + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined @@ -385,7 +385,7 @@ export const QueryProposalsRequest = { }, fromSDK(object: QueryProposalsRequestSDKType): QueryProposalsRequest { return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: object?.voter, depositor: object?.depositor, pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined @@ -393,7 +393,7 @@ export const QueryProposalsRequest = { }, fromSDKJSON(object: any): QueryProposalsRequestSDKType { return { - proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : 0, + proposal_status: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, voter: isSet(object.voter) ? String(object.voter) : "", depositor: isSet(object.depositor) ? String(object.depositor) : "", pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined diff --git a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/tx.ts index 6079d5f664..4ae682fedf 100644 --- a/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/gov/v1beta1/tx.ts @@ -295,7 +295,7 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -316,14 +316,14 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, fromSDKJSON(object: any): MsgVoteSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0 + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/events.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/events.ts index 91cabe9f6a..d7da5ab741 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/events.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/events.ts @@ -548,7 +548,7 @@ export const EventExec = { fromJSON(object: any): EventExec { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toJSON(message: EventExec): unknown { @@ -566,13 +566,13 @@ export const EventExec = { fromSDK(object: EventExecSDKType): EventExec { return { proposalId: object?.proposal_id, - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, fromSDKJSON(object: any): EventExecSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), - result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : 0 + result: isSet(object.result) ? proposalExecutorResultFromJSON(object.result) : -1 }; }, toSDK(message: EventExec): EventExecSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.ts index ee5d73a3fe..8f349a50c0 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/tx.ts @@ -1726,7 +1726,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgSubmitProposal): unknown { @@ -1761,7 +1761,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => e) : [], metadata: object?.metadata, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, fromSDKJSON(object: any): MsgSubmitProposalSDKType { @@ -1770,7 +1770,7 @@ export const MsgSubmitProposal = { proposers: Array.isArray(object?.proposers) ? object.proposers.map((e: any) => String(e)) : [], metadata: isSet(object.metadata) ? String(object.metadata) : "", messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [], - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgSubmitProposal): MsgSubmitProposalSDKType { @@ -2028,9 +2028,9 @@ export const MsgVote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toJSON(message: MsgVote): unknown { @@ -2055,18 +2055,18 @@ export const MsgVote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, fromSDKJSON(object: any): MsgVoteSDKType { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", - exec: isSet(object.exec) ? execFromJSON(object.exec) : 0 + exec: isSet(object.exec) ? execFromJSON(object.exec) : -1 }; }, toSDK(message: MsgVote): MsgVoteSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts index 271c37086b..037fc691c7 100644 --- a/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts +++ b/__fixtures__/v-next/outputv4/cosmos/group/v1/types.ts @@ -1326,11 +1326,11 @@ export const Proposal = { submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, groupVersion: isSet(object.groupVersion) ? BigInt(object.groupVersion.toString()) : BigInt(0), groupPolicyVersion: isSet(object.groupPolicyVersion) ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, votingPeriodEnd: isSet(object.votingPeriodEnd) ? new Date(object.votingPeriodEnd) : undefined, - executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : 0, + executorResult: isSet(object.executorResult) ? proposalExecutorResultFromJSON(object.executorResult) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -1385,11 +1385,11 @@ export const Proposal = { submitTime: object.submit_time ?? undefined, groupVersion: object?.group_version, groupPolicyVersion: object?.group_policy_version, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, finalTallyResult: object.final_tally_result ? TallyResult.fromSDK(object.final_tally_result) : undefined, votingPeriodEnd: object.voting_period_end ?? undefined, - executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executorResult: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -1402,11 +1402,11 @@ export const Proposal = { submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined, group_version: isSet(object.group_version) ? BigInt(object.group_version.toString()) : BigInt(0), group_policy_version: isSet(object.group_policy_version) ? BigInt(object.group_policy_version.toString()) : BigInt(0), - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - result: isSet(object.result) ? proposalResultFromJSON(object.result) : 0, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + result: isSet(object.result) ? proposalResultFromJSON(object.result) : -1, final_tally_result: isSet(object.final_tally_result) ? TallyResult.fromSDKJSON(object.final_tally_result) : undefined, voting_period_end: isSet(object.voting_period_end) ? new Date(object.voting_period_end) : undefined, - executor_result: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : 0, + executor_result: isSet(object.executor_result) ? proposalExecutorResultFromJSON(object.executor_result) : -1, messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromSDKJSON(e)) : [] }; }, @@ -1596,7 +1596,7 @@ export const Vote = { return { proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined }; @@ -1623,7 +1623,7 @@ export const Vote = { return { proposalId: object?.proposal_id, voter: object?.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: object?.metadata, submitTime: object.submit_time ?? undefined }; @@ -1632,7 +1632,7 @@ export const Vote = { return { proposal_id: isSet(object.proposal_id) ? BigInt(object.proposal_id.toString()) : BigInt(0), voter: isSet(object.voter) ? String(object.voter) : "", - option: isSet(object.option) ? voteOptionFromJSON(object.option) : 0, + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, metadata: isSet(object.metadata) ? String(object.metadata) : "", submit_time: isSet(object.submit_time) ? new Date(object.submit_time) : undefined }; diff --git a/__fixtures__/v-next/outputv4/cosmos/orm/v1alpha1/schema.ts b/__fixtures__/v-next/outputv4/cosmos/orm/v1alpha1/schema.ts index 6fbd0c826a..d12f9e52d3 100644 --- a/__fixtures__/v-next/outputv4/cosmos/orm/v1alpha1/schema.ts +++ b/__fixtures__/v-next/outputv4/cosmos/orm/v1alpha1/schema.ts @@ -253,7 +253,7 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: isSet(object.id) ? Number(object.id) : 0, protoFileName: isSet(object.protoFileName) ? String(object.protoFileName) : "", - storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : 0 + storageType: isSet(object.storageType) ? storageTypeFromJSON(object.storageType) : -1 }; }, toJSON(message: ModuleSchemaDescriptor_FileEntry): unknown { @@ -274,14 +274,14 @@ export const ModuleSchemaDescriptor_FileEntry = { return { id: object?.id, protoFileName: object?.proto_file_name, - storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storageType: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, fromSDKJSON(object: any): ModuleSchemaDescriptor_FileEntrySDKType { return { id: isSet(object.id) ? Number(object.id) : 0, proto_file_name: isSet(object.proto_file_name) ? String(object.proto_file_name) : "", - storage_type: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : 0 + storage_type: isSet(object.storage_type) ? storageTypeFromJSON(object.storage_type) : -1 }; }, toSDK(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntrySDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/authz.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/authz.ts index b63cf705e2..2696c554a4 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/authz.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/authz.ts @@ -149,7 +149,7 @@ export const StakeAuthorization = { maxTokens: isSet(object.maxTokens) ? Coin.fromJSON(object.maxTokens) : undefined, allowList: isSet(object.allowList) ? StakeAuthorization_Validators.fromJSON(object.allowList) : undefined, denyList: isSet(object.denyList) ? StakeAuthorization_Validators.fromJSON(object.denyList) : undefined, - authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : 0 + authorizationType: isSet(object.authorizationType) ? authorizationTypeFromJSON(object.authorizationType) : -1 }; }, toJSON(message: StakeAuthorization): unknown { @@ -173,7 +173,7 @@ export const StakeAuthorization = { maxTokens: object.max_tokens ? Coin.fromSDK(object.max_tokens) : undefined, allowList: object.allow_list ? StakeAuthorization_Validators.fromSDK(object.allow_list) : undefined, denyList: object.deny_list ? StakeAuthorization_Validators.fromSDK(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, fromSDKJSON(object: any): StakeAuthorizationSDKType { @@ -181,7 +181,7 @@ export const StakeAuthorization = { max_tokens: isSet(object.max_tokens) ? Coin.fromSDKJSON(object.max_tokens) : undefined, allow_list: isSet(object.allow_list) ? StakeAuthorization_Validators.fromSDKJSON(object.allow_list) : undefined, deny_list: isSet(object.deny_list) ? StakeAuthorization_Validators.fromSDKJSON(object.deny_list) : undefined, - authorization_type: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : 0 + authorization_type: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 }; }, toSDK(message: StakeAuthorization): StakeAuthorizationSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts index bd24265dd6..7231686ced 100644 --- a/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/v-next/outputv4/cosmos/staking/v1beta1/staking.ts @@ -902,7 +902,7 @@ export const Validator = { operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegatorShares: isSet(object.delegatorShares) ? String(object.delegatorShares) : "", description: isSet(object.description) ? Description.fromJSON(object.description) : undefined, @@ -947,7 +947,7 @@ export const Validator = { operatorAddress: object?.operator_address, consensusPubkey: object.consensus_pubkey ? Any.fromSDK(object.consensus_pubkey) : undefined, jailed: object?.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: object?.tokens, delegatorShares: object?.delegator_shares, description: object.description ? Description.fromSDK(object.description) : undefined, @@ -962,7 +962,7 @@ export const Validator = { operator_address: isSet(object.operator_address) ? String(object.operator_address) : "", consensus_pubkey: isSet(object.consensus_pubkey) ? Any.fromSDKJSON(object.consensus_pubkey) : undefined, jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, tokens: isSet(object.tokens) ? String(object.tokens) : "", delegator_shares: isSet(object.delegator_shares) ? String(object.delegator_shares) : "", description: isSet(object.description) ? Description.fromSDKJSON(object.description) : undefined, diff --git a/__fixtures__/v-next/outputv4/cosmos/tx/signing/v1beta1/signing.ts b/__fixtures__/v-next/outputv4/cosmos/tx/signing/v1beta1/signing.ts index fd7d3c1d1a..05c03b7d16 100644 --- a/__fixtures__/v-next/outputv4/cosmos/tx/signing/v1beta1/signing.ts +++ b/__fixtures__/v-next/outputv4/cosmos/tx/signing/v1beta1/signing.ts @@ -425,7 +425,7 @@ export const SignatureDescriptor_Data_Single = { }, fromJSON(object: any): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, @@ -443,13 +443,13 @@ export const SignatureDescriptor_Data_Single = { }, fromSDK(object: SignatureDescriptor_Data_SingleSDKType): SignatureDescriptor_Data_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: object?.signature }; }, fromSDKJSON(object: any): SignatureDescriptor_Data_SingleSDKType { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/service.ts b/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/service.ts index a87dba815c..e936a7b2c2 100644 --- a/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/service.ts +++ b/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/service.ts @@ -342,7 +342,7 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : 0 + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1 }; }, toJSON(message: GetTxsEventRequest): unknown { @@ -367,14 +367,14 @@ export const GetTxsEventRequest = { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, fromSDKJSON(object: any): GetTxsEventRequestSDKType { return { events: Array.isArray(object?.events) ? object.events.map((e: any) => String(e)) : [], pagination: isSet(object.pagination) ? PageRequest.fromSDKJSON(object.pagination) : undefined, - order_by: isSet(object.order_by) ? orderByFromJSON(object.order_by) : 0 + order_by: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 }; }, toSDK(message: GetTxsEventRequest): GetTxsEventRequestSDKType { @@ -530,7 +530,7 @@ export const BroadcastTxRequest = { fromJSON(object: any): BroadcastTxRequest { return { txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toJSON(message: BroadcastTxRequest): unknown { @@ -548,13 +548,13 @@ export const BroadcastTxRequest = { fromSDK(object: BroadcastTxRequestSDKType): BroadcastTxRequest { return { txBytes: object?.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, fromSDKJSON(object: any): BroadcastTxRequestSDKType { return { tx_bytes: isSet(object.tx_bytes) ? bytesFromBase64(object.tx_bytes) : new Uint8Array(), - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 }; }, toSDK(message: BroadcastTxRequest): BroadcastTxRequestSDKType { diff --git a/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/tx.ts b/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/tx.ts index de0d250b18..8351e9a4d6 100644 --- a/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/tx.ts +++ b/__fixtures__/v-next/outputv4/cosmos/tx/v1beta1/tx.ts @@ -1220,7 +1220,7 @@ export const ModeInfo_Single = { }, fromJSON(object: any): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toJSON(message: ModeInfo_Single): unknown { @@ -1235,12 +1235,12 @@ export const ModeInfo_Single = { }, fromSDK(object: ModeInfo_SingleSDKType): ModeInfo_Single { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, fromSDKJSON(object: any): ModeInfo_SingleSDKType { return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 }; }, toSDK(message: ModeInfo_Single): ModeInfo_SingleSDKType { @@ -1572,7 +1572,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -1596,7 +1596,7 @@ export const AuxSignerData = { return { address: object?.address, signDoc: object.sign_doc ? SignDocDirectAux.fromSDK(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object?.sig }; }, @@ -1604,7 +1604,7 @@ export const AuxSignerData = { return { address: isSet(object.address) ? String(object.address) : "", sign_doc: isSet(object.sign_doc) ? SignDocDirectAux.fromSDKJSON(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputv4/cosmwasm/wasm/v1/types.ts b/__fixtures__/v-next/outputv4/cosmwasm/wasm/v1/types.ts index ff8e7d6425..2caf5d92bb 100644 --- a/__fixtures__/v-next/outputv4/cosmwasm/wasm/v1/types.ts +++ b/__fixtures__/v-next/outputv4/cosmwasm/wasm/v1/types.ts @@ -256,7 +256,7 @@ export const AccessTypeParam = { }, fromJSON(object: any): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toJSON(message: AccessTypeParam): unknown { @@ -271,12 +271,12 @@ export const AccessTypeParam = { }, fromSDK(object: AccessTypeParamSDKType): AccessTypeParam { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, fromSDKJSON(object: any): AccessTypeParamSDKType { return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : 0 + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 }; }, toSDK(message: AccessTypeParam): AccessTypeParamSDKType { @@ -323,7 +323,7 @@ export const AccessConfig = { }, fromJSON(object: any): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -341,13 +341,13 @@ export const AccessConfig = { }, fromSDK(object: AccessConfigSDKType): AccessConfig { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: object?.address }; }, fromSDKJSON(object: any): AccessConfigSDKType { return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : 0, + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, address: isSet(object.address) ? String(object.address) : "" }; }, @@ -404,7 +404,7 @@ export const Params = { fromJSON(object: any): Params { return { codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, - instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : 0, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : -1, maxWasmCodeSize: isSet(object.maxWasmCodeSize) ? BigInt(object.maxWasmCodeSize.toString()) : BigInt(0) }; }, @@ -425,14 +425,14 @@ export const Params = { fromSDK(object: ParamsSDKType): Params { return { codeUploadAccess: object.code_upload_access ? AccessConfig.fromSDK(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, maxWasmCodeSize: object?.max_wasm_code_size }; }, fromSDKJSON(object: any): ParamsSDKType { return { code_upload_access: isSet(object.code_upload_access) ? AccessConfig.fromSDKJSON(object.code_upload_access) : undefined, - instantiate_default_permission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : 0, + instantiate_default_permission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1, max_wasm_code_size: isSet(object.max_wasm_code_size) ? BigInt(object.max_wasm_code_size.toString()) : BigInt(0) }; }, @@ -720,7 +720,7 @@ export const ContractCodeHistoryEntry = { }, fromJSON(object: any): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() @@ -744,7 +744,7 @@ export const ContractCodeHistoryEntry = { }, fromSDK(object: ContractCodeHistoryEntrySDKType): ContractCodeHistoryEntry { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, codeId: object?.code_id, updated: object.updated ? AbsoluteTxPosition.fromSDK(object.updated) : undefined, msg: object?.msg @@ -752,7 +752,7 @@ export const ContractCodeHistoryEntry = { }, fromSDKJSON(object: any): ContractCodeHistoryEntrySDKType { return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : 0, + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, code_id: isSet(object.code_id) ? BigInt(object.code_id.toString()) : BigInt(0), updated: isSet(object.updated) ? AbsoluteTxPosition.fromSDKJSON(object.updated) : undefined, msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() diff --git a/__fixtures__/v-next/outputv4/evmos/claims/v1/claims.ts b/__fixtures__/v-next/outputv4/evmos/claims/v1/claims.ts index e240949024..768b5ceac5 100644 --- a/__fixtures__/v-next/outputv4/evmos/claims/v1/claims.ts +++ b/__fixtures__/v-next/outputv4/evmos/claims/v1/claims.ts @@ -155,7 +155,7 @@ export const Claim = { }, fromJSON(object: any): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimableAmount: isSet(object.claimableAmount) ? String(object.claimableAmount) : "" }; @@ -176,14 +176,14 @@ export const Claim = { }, fromSDK(object: ClaimSDKType): Claim { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: object?.completed, claimableAmount: object?.claimable_amount }; }, fromSDKJSON(object: any): ClaimSDKType { return { - action: isSet(object.action) ? actionFromJSON(object.action) : 0, + action: isSet(object.action) ? actionFromJSON(object.action) : -1, completed: isSet(object.completed) ? Boolean(object.completed) : false, claimable_amount: isSet(object.claimable_amount) ? String(object.claimable_amount) : "" }; diff --git a/__fixtures__/v-next/outputv4/evmos/erc20/v1/erc20.ts b/__fixtures__/v-next/outputv4/evmos/erc20/v1/erc20.ts index e3360111ff..bb45f83756 100644 --- a/__fixtures__/v-next/outputv4/evmos/erc20/v1/erc20.ts +++ b/__fixtures__/v-next/outputv4/evmos/erc20/v1/erc20.ts @@ -188,7 +188,7 @@ export const TokenPair = { erc20Address: isSet(object.erc20Address) ? String(object.erc20Address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : 0 + contractOwner: isSet(object.contractOwner) ? ownerFromJSON(object.contractOwner) : -1 }; }, toJSON(message: TokenPair): unknown { @@ -212,7 +212,7 @@ export const TokenPair = { erc20Address: object?.erc20_address, denom: object?.denom, enabled: object?.enabled, - contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contractOwner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, fromSDKJSON(object: any): TokenPairSDKType { @@ -220,7 +220,7 @@ export const TokenPair = { erc20_address: isSet(object.erc20_address) ? String(object.erc20_address) : "", denom: isSet(object.denom) ? String(object.denom) : "", enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, - contract_owner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : 0 + contract_owner: isSet(object.contract_owner) ? ownerFromJSON(object.contract_owner) : -1 }; }, toSDK(message: TokenPair): TokenPairSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/backend.ts b/__fixtures__/v-next/outputv4/google/api/backend.ts index 7acb38019e..ce44b73e80 100644 --- a/__fixtures__/v-next/outputv4/google/api/backend.ts +++ b/__fixtures__/v-next/outputv4/google/api/backend.ts @@ -363,7 +363,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, minDeadline: isSet(object.minDeadline) ? Number(object.minDeadline) : 0, operationDeadline: isSet(object.operationDeadline) ? Number(object.operationDeadline) : 0, - pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : 0, + pathTranslation: isSet(object.pathTranslation) ? backendRule_PathTranslationFromJSON(object.pathTranslation) : -1, jwtAudience: isSet(object.jwtAudience) ? String(object.jwtAudience) : undefined, disableAuth: isSet(object.disableAuth) ? Boolean(object.disableAuth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" @@ -402,7 +402,7 @@ export const BackendRule = { deadline: object?.deadline, minDeadline: object?.min_deadline, operationDeadline: object?.operation_deadline, - pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + pathTranslation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwtAudience: object?.jwt_audience, disableAuth: object?.disable_auth, protocol: object?.protocol @@ -415,7 +415,7 @@ export const BackendRule = { deadline: isSet(object.deadline) ? Number(object.deadline) : 0, min_deadline: isSet(object.min_deadline) ? Number(object.min_deadline) : 0, operation_deadline: isSet(object.operation_deadline) ? Number(object.operation_deadline) : 0, - path_translation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : 0, + path_translation: isSet(object.path_translation) ? backendRule_PathTranslationFromJSON(object.path_translation) : -1, jwt_audience: isSet(object.jwt_audience) ? String(object.jwt_audience) : undefined, disable_auth: isSet(object.disable_auth) ? Boolean(object.disable_auth) : undefined, protocol: isSet(object.protocol) ? String(object.protocol) : "" diff --git a/__fixtures__/v-next/outputv4/google/api/config_change.ts b/__fixtures__/v-next/outputv4/google/api/config_change.ts index bfaa34eb7f..6d357c1e96 100644 --- a/__fixtures__/v-next/outputv4/google/api/config_change.ts +++ b/__fixtures__/v-next/outputv4/google/api/config_change.ts @@ -195,7 +195,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", oldValue: isSet(object.oldValue) ? String(object.oldValue) : "", newValue: isSet(object.newValue) ? String(object.newValue) : "", - changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : 0, + changeType: isSet(object.changeType) ? changeTypeFromJSON(object.changeType) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromJSON(e)) : [] }; }, @@ -226,7 +226,7 @@ export const ConfigChange = { element: object?.element, oldValue: object?.old_value, newValue: object?.new_value, - changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + changeType: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDK(e)) : [] }; }, @@ -235,7 +235,7 @@ export const ConfigChange = { element: isSet(object.element) ? String(object.element) : "", old_value: isSet(object.old_value) ? String(object.old_value) : "", new_value: isSet(object.new_value) ? String(object.new_value) : "", - change_type: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : 0, + change_type: isSet(object.change_type) ? changeTypeFromJSON(object.change_type) : -1, advices: Array.isArray(object?.advices) ? object.advices.map((e: any) => Advice.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv4/google/api/consumer.ts b/__fixtures__/v-next/outputv4/google/api/consumer.ts index e8c056734d..3d94885cde 100644 --- a/__fixtures__/v-next/outputv4/google/api/consumer.ts +++ b/__fixtures__/v-next/outputv4/google/api/consumer.ts @@ -250,7 +250,7 @@ export const Property = { fromJSON(object: any): Property { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -271,14 +271,14 @@ export const Property = { fromSDK(object: PropertySDKType): Property { return { name: object?.name, - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: object?.description }; }, fromSDKJSON(object: any): PropertySDKType { return { name: isSet(object.name) ? String(object.name) : "", - type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? property_PropertyTypeFromJSON(object.type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, diff --git a/__fixtures__/v-next/outputv4/google/api/expr/conformance/v1alpha1/conformance_service.ts b/__fixtures__/v-next/outputv4/google/api/expr/conformance/v1alpha1/conformance_service.ts index 25bdfdc506..001cdec128 100644 --- a/__fixtures__/v-next/outputv4/google/api/expr/conformance/v1alpha1/conformance_service.ts +++ b/__fixtures__/v-next/outputv4/google/api/expr/conformance/v1alpha1/conformance_service.ts @@ -904,7 +904,7 @@ export const IssueDetails = { }, fromJSON(object: any): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromJSON(object.position) : undefined, id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; @@ -925,14 +925,14 @@ export const IssueDetails = { }, fromSDK(object: IssueDetailsSDKType): IssueDetails { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: object.position ? SourcePosition.fromSDK(object.position) : undefined, id: object?.id }; }, fromSDKJSON(object: any): IssueDetailsSDKType { return { - severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? issueDetails_SeverityFromJSON(object.severity) : -1, position: isSet(object.position) ? SourcePosition.fromSDKJSON(object.position) : undefined, id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/google/api/label.ts b/__fixtures__/v-next/outputv4/google/api/label.ts index 42bce266ea..1533ff6361 100644 --- a/__fixtures__/v-next/outputv4/google/api/label.ts +++ b/__fixtures__/v-next/outputv4/google/api/label.ts @@ -103,7 +103,7 @@ export const LabelDescriptor = { fromJSON(object: any): LabelDescriptor { return { key: isSet(object.key) ? String(object.key) : "", - valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : 0, + valueType: isSet(object.valueType) ? labelDescriptor_ValueTypeFromJSON(object.valueType) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, @@ -124,14 +124,14 @@ export const LabelDescriptor = { fromSDK(object: LabelDescriptorSDKType): LabelDescriptor { return { key: object?.key, - valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + valueType: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: object?.description }; }, fromSDKJSON(object: any): LabelDescriptorSDKType { return { key: isSet(object.key) ? String(object.key) : "", - value_type: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : 0, + value_type: isSet(object.value_type) ? labelDescriptor_ValueTypeFromJSON(object.value_type) : -1, description: isSet(object.description) ? String(object.description) : "" }; }, diff --git a/__fixtures__/v-next/outputv4/google/api/metric.ts b/__fixtures__/v-next/outputv4/google/api/metric.ts index c696302c15..caa058c0a2 100644 --- a/__fixtures__/v-next/outputv4/google/api/metric.ts +++ b/__fixtures__/v-next/outputv4/google/api/metric.ts @@ -486,13 +486,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : 0, - valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : 0, + metricKind: isSet(object.metricKind) ? metricDescriptor_MetricKindFromJSON(object.metricKind) : -1, + valueType: isSet(object.valueType) ? metricDescriptor_ValueTypeFromJSON(object.valueType) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", displayName: isSet(object.displayName) ? String(object.displayName) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromJSON(object.metadata) : undefined, - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, monitoredResourceTypes: Array.isArray(object?.monitoredResourceTypes) ? object.monitoredResourceTypes.map((e: any) => String(e)) : [] }; }, @@ -539,13 +539,13 @@ export const MetricDescriptor = { name: object?.name, type: object?.type, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metricKind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + valueType: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: object?.unit, description: object?.description, displayName: object?.display_name, metadata: object.metadata ? MetricDescriptor_MetricDescriptorMetadata.fromSDK(object.metadata) : undefined, - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitoredResourceTypes: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => e) : [] }; }, @@ -554,13 +554,13 @@ export const MetricDescriptor = { name: isSet(object.name) ? String(object.name) : "", type: isSet(object.type) ? String(object.type) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDKJSON(e)) : [], - metric_kind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : 0, - value_type: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : 0, + metric_kind: isSet(object.metric_kind) ? metricDescriptor_MetricKindFromJSON(object.metric_kind) : -1, + value_type: isSet(object.value_type) ? metricDescriptor_ValueTypeFromJSON(object.value_type) : -1, unit: isSet(object.unit) ? String(object.unit) : "", description: isSet(object.description) ? String(object.description) : "", display_name: isSet(object.display_name) ? String(object.display_name) : "", metadata: isSet(object.metadata) ? MetricDescriptor_MetricDescriptorMetadata.fromSDKJSON(object.metadata) : undefined, - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, monitored_resource_types: Array.isArray(object?.monitored_resource_types) ? object.monitored_resource_types.map((e: any) => String(e)) : [] }; }, @@ -633,7 +633,7 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromJSON(object: any): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0, + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1, samplePeriod: isSet(object.samplePeriod) ? Duration.fromJSON(object.samplePeriod) : undefined, ingestDelay: isSet(object.ingestDelay) ? Duration.fromJSON(object.ingestDelay) : undefined }; @@ -654,14 +654,14 @@ export const MetricDescriptor_MetricDescriptorMetadata = { }, fromSDK(object: MetricDescriptor_MetricDescriptorMetadataSDKType): MetricDescriptor_MetricDescriptorMetadata { return { - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, samplePeriod: object.sample_period ? Duration.fromSDK(object.sample_period) : undefined, ingestDelay: object.ingest_delay ? Duration.fromSDK(object.ingest_delay) : undefined }; }, fromSDKJSON(object: any): MetricDescriptor_MetricDescriptorMetadataSDKType { return { - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0, + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1, sample_period: isSet(object.sample_period) ? Duration.fromSDKJSON(object.sample_period) : undefined, ingest_delay: isSet(object.ingest_delay) ? Duration.fromSDKJSON(object.ingest_delay) : undefined }; diff --git a/__fixtures__/v-next/outputv4/google/api/monitored_resource.ts b/__fixtures__/v-next/outputv4/google/api/monitored_resource.ts index a192c56627..5596f88706 100644 --- a/__fixtures__/v-next/outputv4/google/api/monitored_resource.ts +++ b/__fixtures__/v-next/outputv4/google/api/monitored_resource.ts @@ -250,7 +250,7 @@ export const MonitoredResourceDescriptor = { displayName: isSet(object.displayName) ? String(object.displayName) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromJSON(e)) : [], - launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : 0 + launchStage: isSet(object.launchStage) ? launchStageFromJSON(object.launchStage) : -1 }; }, toJSON(message: MonitoredResourceDescriptor): unknown { @@ -284,7 +284,7 @@ export const MonitoredResourceDescriptor = { displayName: object?.display_name, description: object?.description, labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDK(e)) : [], - launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launchStage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, fromSDKJSON(object: any): MonitoredResourceDescriptorSDKType { @@ -294,7 +294,7 @@ export const MonitoredResourceDescriptor = { display_name: isSet(object.display_name) ? String(object.display_name) : "", description: isSet(object.description) ? String(object.description) : "", labels: Array.isArray(object?.labels) ? object.labels.map((e: any) => LabelDescriptor.fromSDKJSON(e)) : [], - launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : 0 + launch_stage: isSet(object.launch_stage) ? launchStageFromJSON(object.launch_stage) : -1 }; }, toSDK(message: MonitoredResourceDescriptor): MonitoredResourceDescriptorSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/resource.ts b/__fixtures__/v-next/outputv4/google/api/resource.ts index 44ebe80d46..9ea5dba2ee 100644 --- a/__fixtures__/v-next/outputv4/google/api/resource.ts +++ b/__fixtures__/v-next/outputv4/google/api/resource.ts @@ -421,7 +421,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], nameField: isSet(object.nameField) ? String(object.nameField) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -462,7 +462,7 @@ export const ResourceDescriptor = { type: object?.type, pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => e) : [], nameField: object?.name_field, - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: object?.plural, singular: object?.singular, style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] @@ -473,7 +473,7 @@ export const ResourceDescriptor = { type: isSet(object.type) ? String(object.type) : "", pattern: Array.isArray(object?.pattern) ? object.pattern.map((e: any) => String(e)) : [], name_field: isSet(object.name_field) ? String(object.name_field) : "", - history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : 0, + history: isSet(object.history) ? resourceDescriptor_HistoryFromJSON(object.history) : -1, plural: isSet(object.plural) ? String(object.plural) : "", singular: isSet(object.singular) ? String(object.singular) : "", style: Array.isArray(object?.style) ? object.style.map((e: any) => resourceDescriptor_StyleFromJSON(e)) : [] diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/check_error.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/check_error.ts index 8f893fbd4a..7fa3932f0c 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/check_error.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/check_error.ts @@ -277,7 +277,7 @@ export const CheckError = { }, fromJSON(object: any): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -301,7 +301,7 @@ export const CheckError = { }, fromSDK(object: CheckErrorSDKType): CheckError { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: object?.subject, detail: object?.detail, status: object.status ? Status.fromSDK(object.status) : undefined @@ -309,7 +309,7 @@ export const CheckError = { }, fromSDKJSON(object: any): CheckErrorSDKType { return { - code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? checkError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", detail: isSet(object.detail) ? String(object.detail) : "", status: isSet(object.status) ? Status.fromSDKJSON(object.status) : undefined diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts index 5a500cd7e8..d38dd286d7 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/log_entry.ts @@ -350,7 +350,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insertId: isSet(object.insertId) ? String(object.insertId) : "", @@ -415,7 +415,7 @@ export const LogEntry = { return { name: object?.name, timestamp: object.timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, trace: object?.trace, insertId: object?.insert_id, @@ -436,7 +436,7 @@ export const LogEntry = { return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, http_request: isSet(object.http_request) ? HttpRequest.fromSDKJSON(object.http_request) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insert_id: isSet(object.insert_id) ? String(object.insert_id) : "", diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts index b96a38378a..084222782c 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/operation.ts @@ -337,7 +337,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metricValueSets) ? object.metricValueSets.map((e: any) => MetricValueSet.fromJSON(e)) : [], logEntries: Array.isArray(object?.logEntries) ? object.logEntries.map((e: any) => LogEntry.fromJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : [] }; }, @@ -408,7 +408,7 @@ export const Operation = { }, {}) : {}, metricValueSets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDK(e)) : [], logEntries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDK(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDK(e)) : [] }; }, @@ -427,7 +427,7 @@ export const Operation = { }, {}) : {}, metric_value_sets: Array.isArray(object?.metric_value_sets) ? object.metric_value_sets.map((e: any) => MetricValueSet.fromSDKJSON(e)) : [], log_entries: Array.isArray(object?.log_entries) ? object.log_entries.map((e: any) => LogEntry.fromSDKJSON(e)) : [], - importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : 0, + importance: isSet(object.importance) ? operation_ImportanceFromJSON(object.importance) : -1, extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/quota_controller.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/quota_controller.ts index f2b9947165..0e4de23507 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/quota_controller.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/quota_controller.ts @@ -571,7 +571,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quotaMetrics) ? object.quotaMetrics.map((e: any) => MetricValueSet.fromJSON(e)) : [], - quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : 0 + quotaMode: isSet(object.quotaMode) ? quotaOperation_QuotaModeFromJSON(object.quotaMode) : -1 }; }, toJSON(message: QuotaOperation): unknown { @@ -622,7 +622,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quotaMetrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDK(e)) : [], - quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quotaMode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, fromSDKJSON(object: any): QuotaOperationSDKType { @@ -637,7 +637,7 @@ export const QuotaOperation = { return acc; }, {}) : {}, quota_metrics: Array.isArray(object?.quota_metrics) ? object.quota_metrics.map((e: any) => MetricValueSet.fromSDKJSON(e)) : [], - quota_mode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : 0 + quota_mode: isSet(object.quota_mode) ? quotaOperation_QuotaModeFromJSON(object.quota_mode) : -1 }; }, toSDK(message: QuotaOperation): QuotaOperationSDKType { @@ -827,7 +827,7 @@ export const QuotaError = { }, fromJSON(object: any): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromJSON(object.status) : undefined @@ -851,7 +851,7 @@ export const QuotaError = { }, fromSDK(object: QuotaErrorSDKType): QuotaError { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: object?.subject, description: object?.description, status: object.status ? Status.fromSDK(object.status) : undefined @@ -859,7 +859,7 @@ export const QuotaError = { }, fromSDKJSON(object: any): QuotaErrorSDKType { return { - code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : 0, + code: isSet(object.code) ? quotaError_CodeFromJSON(object.code) : -1, subject: isSet(object.subject) ? String(object.subject) : "", description: isSet(object.description) ? String(object.description) : "", status: isSet(object.status) ? Status.fromSDKJSON(object.status) : undefined diff --git a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/service_controller.ts b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/service_controller.ts index b471cf2fe5..a0230167f3 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/service_controller.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicecontrol/v1/service_controller.ts @@ -597,7 +597,7 @@ export const CheckResponse_ConsumerInfo = { fromJSON(object: any): CheckResponse_ConsumerInfo { return { projectNumber: isSet(object.projectNumber) ? BigInt(object.projectNumber.toString()) : BigInt(0), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: isSet(object.consumerNumber) ? BigInt(object.consumerNumber.toString()) : BigInt(0) }; }, @@ -618,14 +618,14 @@ export const CheckResponse_ConsumerInfo = { fromSDK(object: CheckResponse_ConsumerInfoSDKType): CheckResponse_ConsumerInfo { return { projectNumber: object?.project_number, - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumerNumber: object?.consumer_number }; }, fromSDKJSON(object: any): CheckResponse_ConsumerInfoSDKType { return { project_number: isSet(object.project_number) ? BigInt(object.project_number.toString()) : BigInt(0), - type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? checkResponse_ConsumerInfo_ConsumerTypeFromJSON(object.type) : -1, consumer_number: isSet(object.consumer_number) ? BigInt(object.consumer_number.toString()) : BigInt(0) }; }, diff --git a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts index 83c7332b44..576c088563 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/resources.ts @@ -776,7 +776,7 @@ export const OperationMetadata_Step = { fromJSON(object: any): OperationMetadata_Step { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toJSON(message: OperationMetadata_Step): unknown { @@ -794,13 +794,13 @@ export const OperationMetadata_Step = { fromSDK(object: OperationMetadata_StepSDKType): OperationMetadata_Step { return { description: object?.description, - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, fromSDKJSON(object: any): OperationMetadata_StepSDKType { return { description: isSet(object.description) ? String(object.description) : "", - status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : 0 + status: isSet(object.status) ? operationMetadata_StatusFromJSON(object.status) : -1 }; }, toSDK(message: OperationMetadata_Step): OperationMetadata_StepSDKType { @@ -856,7 +856,7 @@ export const Diagnostic = { fromJSON(object: any): Diagnostic { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -877,14 +877,14 @@ export const Diagnostic = { fromSDK(object: DiagnosticSDKType): Diagnostic { return { location: object?.location, - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: object?.message }; }, fromSDKJSON(object: any): DiagnosticSDKType { return { location: isSet(object.location) ? String(object.location) : "", - kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : 0, + kind: isSet(object.kind) ? diagnostic_KindFromJSON(object.kind) : -1, message: isSet(object.message) ? String(object.message) : "" }; }, @@ -1024,7 +1024,7 @@ export const ConfigFile = { return { filePath: isSet(object.filePath) ? String(object.filePath) : "", fileContents: isSet(object.fileContents) ? bytesFromBase64(object.fileContents) : new Uint8Array(), - fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : 0 + fileType: isSet(object.fileType) ? configFile_FileTypeFromJSON(object.fileType) : -1 }; }, toJSON(message: ConfigFile): unknown { @@ -1045,14 +1045,14 @@ export const ConfigFile = { return { filePath: object?.file_path, fileContents: object?.file_contents, - fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + fileType: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, fromSDKJSON(object: any): ConfigFileSDKType { return { file_path: isSet(object.file_path) ? String(object.file_path) : "", file_contents: isSet(object.file_contents) ? bytesFromBase64(object.file_contents) : new Uint8Array(), - file_type: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : 0 + file_type: isSet(object.file_type) ? configFile_FileTypeFromJSON(object.file_type) : -1 }; }, toSDK(message: ConfigFile): ConfigFileSDKType { @@ -1267,7 +1267,7 @@ export const Rollout = { rolloutId: isSet(object.rolloutId) ? String(object.rolloutId) : "", createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, createdBy: isSet(object.createdBy) ? String(object.createdBy) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: isSet(object.trafficPercentStrategy) ? Rollout_TrafficPercentStrategy.fromJSON(object.trafficPercentStrategy) : undefined, deleteServiceStrategy: isSet(object.deleteServiceStrategy) ? Rollout_DeleteServiceStrategy.fromJSON(object.deleteServiceStrategy) : undefined, serviceName: isSet(object.serviceName) ? String(object.serviceName) : "" @@ -1300,7 +1300,7 @@ export const Rollout = { rolloutId: object?.rollout_id, createTime: object.create_time ?? undefined, createdBy: object?.created_by, - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, trafficPercentStrategy: object.traffic_percent_strategy ? Rollout_TrafficPercentStrategy.fromSDK(object.traffic_percent_strategy) : undefined, deleteServiceStrategy: object.delete_service_strategy ? Rollout_DeleteServiceStrategy.fromSDK(object.delete_service_strategy) : undefined, serviceName: object?.service_name @@ -1311,7 +1311,7 @@ export const Rollout = { rollout_id: isSet(object.rollout_id) ? String(object.rollout_id) : "", create_time: isSet(object.create_time) ? new Date(object.create_time) : undefined, created_by: isSet(object.created_by) ? String(object.created_by) : "", - status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : 0, + status: isSet(object.status) ? rollout_RolloutStatusFromJSON(object.status) : -1, traffic_percent_strategy: isSet(object.traffic_percent_strategy) ? Rollout_TrafficPercentStrategy.fromSDKJSON(object.traffic_percent_strategy) : undefined, delete_service_strategy: isSet(object.delete_service_strategy) ? Rollout_DeleteServiceStrategy.fromSDKJSON(object.delete_service_strategy) : undefined, service_name: isSet(object.service_name) ? String(object.service_name) : "" diff --git a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/servicemanager.ts b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/servicemanager.ts index 4a103dadaf..baae5982c6 100644 --- a/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/servicemanager.ts +++ b/__fixtures__/v-next/outputv4/google/api/servicemanagement/v1/servicemanager.ts @@ -896,7 +896,7 @@ export const GetServiceConfigRequest = { return { serviceName: isSet(object.serviceName) ? String(object.serviceName) : "", configId: isSet(object.configId) ? String(object.configId) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toJSON(message: GetServiceConfigRequest): unknown { @@ -917,14 +917,14 @@ export const GetServiceConfigRequest = { return { serviceName: object?.service_name, configId: object?.config_id, - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetServiceConfigRequestSDKType { return { service_name: isSet(object.service_name) ? String(object.service_name) : "", config_id: isSet(object.config_id) ? String(object.config_id) : "", - view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : 0 + view: isSet(object.view) ? getServiceConfigRequest_ConfigViewFromJSON(object.view) : -1 }; }, toSDK(message: GetServiceConfigRequest): GetServiceConfigRequestSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/resources.ts b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/resources.ts index 061d1e4c12..853cfc4062 100644 --- a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/resources.ts +++ b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/resources.ts @@ -213,7 +213,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -237,7 +237,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): ServiceSDKType { @@ -245,7 +245,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromSDKJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/serviceusage.ts b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/serviceusage.ts index f4bf88e677..5a75eaaf4b 100644 --- a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/serviceusage.ts +++ b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1/serviceusage.ts @@ -464,7 +464,7 @@ export const DisableServiceRequest = { return { name: isSet(object.name) ? String(object.name) : "", disableDependentServices: isSet(object.disableDependentServices) ? Boolean(object.disableDependentServices) : false, - checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : 0 + checkIfServiceHasUsage: isSet(object.checkIfServiceHasUsage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.checkIfServiceHasUsage) : -1 }; }, toJSON(message: DisableServiceRequest): unknown { @@ -485,14 +485,14 @@ export const DisableServiceRequest = { return { name: object?.name, disableDependentServices: object?.disable_dependent_services, - checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + checkIfServiceHasUsage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, fromSDKJSON(object: any): DisableServiceRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", disable_dependent_services: isSet(object.disable_dependent_services) ? Boolean(object.disable_dependent_services) : false, - check_if_service_has_usage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : 0 + check_if_service_has_usage: isSet(object.check_if_service_has_usage) ? disableServiceRequest_CheckIfServiceHasUsageFromJSON(object.check_if_service_has_usage) : -1 }; }, toSDK(message: DisableServiceRequest): DisableServiceRequestSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/resources.ts b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/resources.ts index 5719e27b9b..29e9096801 100644 --- a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/resources.ts +++ b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/resources.ts @@ -667,7 +667,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toJSON(message: Service): unknown { @@ -691,7 +691,7 @@ export const Service = { name: object?.name, parent: object?.parent, config: object.config ? ServiceConfig.fromSDK(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): ServiceSDKType { @@ -699,7 +699,7 @@ export const Service = { name: isSet(object.name) ? String(object.name) : "", parent: isSet(object.parent) ? String(object.parent) : "", config: isSet(object.config) ? ServiceConfig.fromSDKJSON(object.config) : undefined, - state: isSet(object.state) ? stateFromJSON(object.state) : 0 + state: isSet(object.state) ? stateFromJSON(object.state) : -1 }; }, toSDK(message: Service): ServiceSDKType { diff --git a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/serviceusage.ts b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/serviceusage.ts index 1f7f009613..46315c0306 100644 --- a/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/serviceusage.ts +++ b/__fixtures__/v-next/outputv4/google/api/serviceusage/v1beta1/serviceusage.ts @@ -1252,7 +1252,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0, pageToken: isSet(object.pageToken) ? String(object.pageToken) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: ListConsumerQuotaMetricsRequest): unknown { @@ -1276,7 +1276,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: object?.parent, pageSize: object?.page_size, pageToken: object?.page_token, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): ListConsumerQuotaMetricsRequestSDKType { @@ -1284,7 +1284,7 @@ export const ListConsumerQuotaMetricsRequest = { parent: isSet(object.parent) ? String(object.parent) : "", page_size: isSet(object.page_size) ? Number(object.page_size) : 0, page_token: isSet(object.page_token) ? String(object.page_token) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: ListConsumerQuotaMetricsRequest): ListConsumerQuotaMetricsRequestSDKType { @@ -1416,7 +1416,7 @@ export const GetConsumerQuotaMetricRequest = { fromJSON(object: any): GetConsumerQuotaMetricRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaMetricRequest): unknown { @@ -1434,13 +1434,13 @@ export const GetConsumerQuotaMetricRequest = { fromSDK(object: GetConsumerQuotaMetricRequestSDKType): GetConsumerQuotaMetricRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetConsumerQuotaMetricRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaMetricRequest): GetConsumerQuotaMetricRequestSDKType { @@ -1489,7 +1489,7 @@ export const GetConsumerQuotaLimitRequest = { fromJSON(object: any): GetConsumerQuotaLimitRequest { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toJSON(message: GetConsumerQuotaLimitRequest): unknown { @@ -1507,13 +1507,13 @@ export const GetConsumerQuotaLimitRequest = { fromSDK(object: GetConsumerQuotaLimitRequestSDKType): GetConsumerQuotaLimitRequest { return { name: object?.name, - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, fromSDKJSON(object: any): GetConsumerQuotaLimitRequestSDKType { return { name: isSet(object.name) ? String(object.name) : "", - view: isSet(object.view) ? quotaViewFromJSON(object.view) : 0 + view: isSet(object.view) ? quotaViewFromJSON(object.view) : -1 }; }, toSDK(message: GetConsumerQuotaLimitRequest): GetConsumerQuotaLimitRequestSDKType { @@ -3482,7 +3482,7 @@ export const GetServiceIdentityResponse = { fromJSON(object: any): GetServiceIdentityResponse { return { identity: isSet(object.identity) ? ServiceIdentity.fromJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toJSON(message: GetServiceIdentityResponse): unknown { @@ -3500,13 +3500,13 @@ export const GetServiceIdentityResponse = { fromSDK(object: GetServiceIdentityResponseSDKType): GetServiceIdentityResponse { return { identity: object.identity ? ServiceIdentity.fromSDK(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, fromSDKJSON(object: any): GetServiceIdentityResponseSDKType { return { identity: isSet(object.identity) ? ServiceIdentity.fromSDKJSON(object.identity) : undefined, - state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : 0 + state: isSet(object.state) ? getServiceIdentityResponse_IdentityStateFromJSON(object.state) : -1 }; }, toSDK(message: GetServiceIdentityResponse): GetServiceIdentityResponseSDKType { diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts b/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts index 6dbf0ddb14..326c1009cf 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/log_entry.ts @@ -510,7 +510,7 @@ export const LogEntry = { jsonPayload: isSet(object.jsonPayload) ? Struct.fromJSON(object.jsonPayload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receiveTimestamp: isSet(object.receiveTimestamp) ? new Date(object.receiveTimestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: isSet(object.insertId) ? String(object.insertId) : "", httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -590,7 +590,7 @@ export const LogEntry = { jsonPayload: object.json_payload ? Struct.fromSDK(object.json_payload) : undefined, timestamp: object.timestamp ?? undefined, receiveTimestamp: object.receive_timestamp ?? undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insertId: object?.insert_id, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -616,7 +616,7 @@ export const LogEntry = { json_payload: isSet(object.json_payload) ? Struct.fromSDKJSON(object.json_payload) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, receive_timestamp: isSet(object.receive_timestamp) ? new Date(object.receive_timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, insert_id: isSet(object.insert_id) ? String(object.insert_id) : "", http_request: isSet(object.http_request) ? HttpRequest.fromSDKJSON(object.http_request) : undefined, labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/logging.ts b/__fixtures__/v-next/outputv4/google/logging/v2/logging.ts index 4f40963774..a954001c40 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/logging.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/logging.ts @@ -1765,7 +1765,7 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromJSON(object: any): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: isSet(object.suppressedCount) ? Number(object.suppressedCount) : 0 }; }, @@ -1783,13 +1783,13 @@ export const TailLogEntriesResponse_SuppressionInfo = { }, fromSDK(object: TailLogEntriesResponse_SuppressionInfoSDKType): TailLogEntriesResponse_SuppressionInfo { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressedCount: object?.suppressed_count }; }, fromSDKJSON(object: any): TailLogEntriesResponse_SuppressionInfoSDKType { return { - reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : 0, + reason: isSet(object.reason) ? tailLogEntriesResponse_SuppressionInfo_ReasonFromJSON(object.reason) : -1, suppressed_count: isSet(object.suppressed_count) ? Number(object.suppressed_count) : 0 }; }, diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts b/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts index 39f8f31f1a..23601f47b4 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/logging_config.ts @@ -1678,7 +1678,7 @@ export const LogBucket = { updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, retentionDays: isSet(object.retentionDays) ? Number(object.retentionDays) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : 0, + lifecycleState: isSet(object.lifecycleState) ? lifecycleStateFromJSON(object.lifecycleState) : -1, restrictedFields: Array.isArray(object?.restrictedFields) ? object.restrictedFields.map((e: any) => String(e)) : [], cmekSettings: isSet(object.cmekSettings) ? CmekSettings.fromJSON(object.cmekSettings) : undefined }; @@ -1721,7 +1721,7 @@ export const LogBucket = { updateTime: object.update_time ?? undefined, retentionDays: object?.retention_days, locked: object?.locked, - lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycleState: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restrictedFields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => e) : [], cmekSettings: object.cmek_settings ? CmekSettings.fromSDK(object.cmek_settings) : undefined }; @@ -1734,7 +1734,7 @@ export const LogBucket = { update_time: isSet(object.update_time) ? new Date(object.update_time) : undefined, retention_days: isSet(object.retention_days) ? Number(object.retention_days) : 0, locked: isSet(object.locked) ? Boolean(object.locked) : false, - lifecycle_state: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : 0, + lifecycle_state: isSet(object.lifecycle_state) ? lifecycleStateFromJSON(object.lifecycle_state) : -1, restricted_fields: Array.isArray(object?.restricted_fields) ? object.restricted_fields.map((e: any) => String(e)) : [], cmek_settings: isSet(object.cmek_settings) ? CmekSettings.fromSDKJSON(object.cmek_settings) : undefined }; @@ -1983,7 +1983,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromJSON(e)) : [], - outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : 0, + outputVersionFormat: isSet(object.outputVersionFormat) ? logSink_VersionFormatFromJSON(object.outputVersionFormat) : -1, writerIdentity: isSet(object.writerIdentity) ? String(object.writerIdentity) : "", includeChildren: isSet(object.includeChildren) ? Boolean(object.includeChildren) : false, bigqueryOptions: isSet(object.bigqueryOptions) ? BigQueryOptions.fromJSON(object.bigqueryOptions) : undefined, @@ -2035,7 +2035,7 @@ export const LogSink = { description: object?.description, disabled: object?.disabled, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDK(e)) : [], - outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + outputVersionFormat: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writerIdentity: object?.writer_identity, includeChildren: object?.include_children, bigqueryOptions: object.bigquery_options ? BigQueryOptions.fromSDK(object.bigquery_options) : undefined, @@ -2051,7 +2051,7 @@ export const LogSink = { description: isSet(object.description) ? String(object.description) : "", disabled: isSet(object.disabled) ? Boolean(object.disabled) : false, exclusions: Array.isArray(object?.exclusions) ? object.exclusions.map((e: any) => LogExclusion.fromSDKJSON(e)) : [], - output_version_format: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : 0, + output_version_format: isSet(object.output_version_format) ? logSink_VersionFormatFromJSON(object.output_version_format) : -1, writer_identity: isSet(object.writer_identity) ? String(object.writer_identity) : "", include_children: isSet(object.include_children) ? Boolean(object.include_children) : false, bigquery_options: isSet(object.bigquery_options) ? BigQueryOptions.fromSDKJSON(object.bigquery_options) : undefined, @@ -4825,7 +4825,7 @@ export const CopyLogEntriesMetadata = { return { startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: isSet(object.cancellationRequested) ? Boolean(object.cancellationRequested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, @@ -4858,7 +4858,7 @@ export const CopyLogEntriesMetadata = { return { startTime: object.start_time ?? undefined, endTime: object.end_time ?? undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellationRequested: object?.cancellation_requested, request: object.request ? CopyLogEntriesRequest.fromSDK(object.request) : undefined, progress: object?.progress, @@ -4869,7 +4869,7 @@ export const CopyLogEntriesMetadata = { return { start_time: isSet(object.start_time) ? new Date(object.start_time) : undefined, end_time: isSet(object.end_time) ? new Date(object.end_time) : undefined, - state: isSet(object.state) ? operationStateFromJSON(object.state) : 0, + state: isSet(object.state) ? operationStateFromJSON(object.state) : -1, cancellation_requested: isSet(object.cancellation_requested) ? Boolean(object.cancellation_requested) : false, request: isSet(object.request) ? CopyLogEntriesRequest.fromSDKJSON(object.request) : undefined, progress: isSet(object.progress) ? Number(object.progress) : 0, diff --git a/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts b/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts index 684ef5e255..386fed9a88 100644 --- a/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts +++ b/__fixtures__/v-next/outputv4/google/logging/v2/logging_metrics.ts @@ -513,7 +513,7 @@ export const LogMetric = { bucketOptions: isSet(object.bucketOptions) ? Distribution_BucketOptions.fromJSON(object.bucketOptions) : undefined, createTime: isSet(object.createTime) ? new Date(object.createTime) : undefined, updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toJSON(message: LogMetric): unknown { @@ -575,7 +575,7 @@ export const LogMetric = { bucketOptions: object.bucket_options ? Distribution_BucketOptions.fromSDK(object.bucket_options) : undefined, createTime: object.create_time ?? undefined, updateTime: object.update_time ?? undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, fromSDKJSON(object: any): LogMetricSDKType { @@ -595,7 +595,7 @@ export const LogMetric = { bucket_options: isSet(object.bucket_options) ? Distribution_BucketOptions.fromSDKJSON(object.bucket_options) : undefined, create_time: isSet(object.create_time) ? new Date(object.create_time) : undefined, update_time: isSet(object.update_time) ? new Date(object.update_time) : undefined, - version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : 0 + version: isSet(object.version) ? logMetric_ApiVersionFromJSON(object.version) : -1 }; }, toSDK(message: LogMetric): LogMetricSDKType { diff --git a/__fixtures__/v-next/outputv4/google/protobuf/api.ts b/__fixtures__/v-next/outputv4/google/protobuf/api.ts index 0764f6874e..d846ab44e3 100644 --- a/__fixtures__/v-next/outputv4/google/protobuf/api.ts +++ b/__fixtures__/v-next/outputv4/google/protobuf/api.ts @@ -355,7 +355,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Api): unknown { @@ -400,7 +400,7 @@ export const Api = { version: object?.version, sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): ApiSDKType { @@ -411,7 +411,7 @@ export const Api = { version: isSet(object.version) ? String(object.version) : "", source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, mixins: Array.isArray(object?.mixins) ? object.mixins.map((e: any) => Mixin.fromSDKJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Api): ApiSDKType { @@ -517,7 +517,7 @@ export const Method = { responseTypeUrl: isSet(object.responseTypeUrl) ? String(object.responseTypeUrl) : "", responseStreaming: isSet(object.responseStreaming) ? Boolean(object.responseStreaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Method): unknown { @@ -554,7 +554,7 @@ export const Method = { responseTypeUrl: object?.response_type_url, responseStreaming: object?.response_streaming, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): MethodSDKType { @@ -565,7 +565,7 @@ export const Method = { response_type_url: isSet(object.response_type_url) ? String(object.response_type_url) : "", response_streaming: isSet(object.response_streaming) ? Boolean(object.response_streaming) : false, options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Method): MethodSDKType { diff --git a/__fixtures__/v-next/outputv4/google/protobuf/descriptor.ts b/__fixtures__/v-next/outputv4/google/protobuf/descriptor.ts index afea9e2978..041e2bc5ab 100644 --- a/__fixtures__/v-next/outputv4/google/protobuf/descriptor.ts +++ b/__fixtures__/v-next/outputv4/google/protobuf/descriptor.ts @@ -2187,8 +2187,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: isSet(object.typeName) ? String(object.typeName) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? String(object.defaultValue) : "", @@ -2229,8 +2229,8 @@ export const FieldDescriptorProto = { return { name: object?.name, number: object?.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, typeName: object?.type_name, extendee: object?.extendee, defaultValue: object?.default_value, @@ -2243,8 +2243,8 @@ export const FieldDescriptorProto = { return { name: isSet(object.name) ? String(object.name) : "", number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 0, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, type_name: isSet(object.type_name) ? String(object.type_name) : "", extendee: isSet(object.extendee) ? String(object.extendee) : "", default_value: isSet(object.default_value) ? String(object.default_value) : "", @@ -3031,7 +3031,7 @@ export const FileOptions = { javaMultipleFiles: isSet(object.javaMultipleFiles) ? Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? Boolean(object.javaStringCheckUtf8) : false, - optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 0, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : -1, goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? Boolean(object.javaGenericServices) : false, @@ -3110,7 +3110,7 @@ export const FileOptions = { javaMultipleFiles: object?.java_multiple_files, javaGenerateEqualsAndHash: object?.java_generate_equals_and_hash, javaStringCheckUtf8: object?.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, goPackage: object?.go_package, ccGenericServices: object?.cc_generic_services, javaGenericServices: object?.java_generic_services, @@ -3135,7 +3135,7 @@ export const FileOptions = { java_multiple_files: isSet(object.java_multiple_files) ? Boolean(object.java_multiple_files) : false, java_generate_equals_and_hash: isSet(object.java_generate_equals_and_hash) ? Boolean(object.java_generate_equals_and_hash) : false, java_string_check_utf8: isSet(object.java_string_check_utf8) ? Boolean(object.java_string_check_utf8) : false, - optimize_for: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : 0, + optimize_for: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, go_package: isSet(object.go_package) ? String(object.go_package) : "", cc_generic_services: isSet(object.cc_generic_services) ? Boolean(object.cc_generic_services) : false, java_generic_services: isSet(object.java_generic_services) ? Boolean(object.java_generic_services) : false, @@ -3376,9 +3376,9 @@ export const FieldOptions = { }, fromJSON(object: any): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -3413,9 +3413,9 @@ export const FieldOptions = { }, fromSDK(object: FieldOptionsSDKType): FieldOptions { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: object?.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: object?.lazy, deprecated: object?.deprecated, weak: object?.weak, @@ -3424,9 +3424,9 @@ export const FieldOptions = { }, fromSDKJSON(object: any): FieldOptionsSDKType { return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, @@ -3819,7 +3819,7 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, @@ -3844,14 +3844,14 @@ export const MethodOptions = { fromSDK(object: MethodOptionsSDKType): MethodOptions { return { deprecated: object?.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDK(e)) : [] }; }, fromSDKJSON(object: any): MethodOptionsSDKType { return { deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotency_level: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : 0, + idempotency_level: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, uninterpreted_option: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromSDKJSON(e)) : [] }; }, diff --git a/__fixtures__/v-next/outputv4/google/protobuf/type.ts b/__fixtures__/v-next/outputv4/google/protobuf/type.ts index fed71f6fe9..c127b5152c 100644 --- a/__fixtures__/v-next/outputv4/google/protobuf/type.ts +++ b/__fixtures__/v-next/outputv4/google/protobuf/type.ts @@ -439,7 +439,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Type): unknown { @@ -481,7 +481,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => e) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): TypeSDKType { @@ -491,7 +491,7 @@ export const Type = { oneofs: Array.isArray(object?.oneofs) ? object.oneofs.map((e: any) => String(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Type): TypeSDKType { @@ -611,8 +611,8 @@ export const Field = { }, fromJSON(object: any): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", @@ -657,8 +657,8 @@ export const Field = { }, fromSDK(object: FieldSDKType): Field { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: object?.number, name: object?.name, typeUrl: object?.type_url, @@ -671,8 +671,8 @@ export const Field = { }, fromSDKJSON(object: any): FieldSDKType { return { - kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : 0, - cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : 0, + kind: isSet(object.kind) ? field_KindFromJSON(object.kind) : -1, + cardinality: isSet(object.cardinality) ? field_CardinalityFromJSON(object.cardinality) : -1, number: isSet(object.number) ? Number(object.number) : 0, name: isSet(object.name) ? String(object.name) : "", type_url: isSet(object.type_url) ? String(object.type_url) : "", @@ -765,7 +765,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromJSON(e)) : [], sourceContext: isSet(object.sourceContext) ? SourceContext.fromJSON(object.sourceContext) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toJSON(message: Enum): unknown { @@ -800,7 +800,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDK(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDK(e)) : [], sourceContext: object.source_context ? SourceContext.fromSDK(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, fromSDKJSON(object: any): EnumSDKType { @@ -809,7 +809,7 @@ export const Enum = { enumvalue: Array.isArray(object?.enumvalue) ? object.enumvalue.map((e: any) => EnumValue.fromSDKJSON(e)) : [], options: Array.isArray(object?.options) ? object.options.map((e: any) => Option.fromSDKJSON(e)) : [], source_context: isSet(object.source_context) ? SourceContext.fromSDKJSON(object.source_context) : undefined, - syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : 0 + syntax: isSet(object.syntax) ? syntaxFromJSON(object.syntax) : -1 }; }, toSDK(message: Enum): EnumSDKType { diff --git a/__fixtures__/v-next/outputv4/ibc/applications/transfer/v1/tx.amino.ts b/__fixtures__/v-next/outputv4/ibc/applications/transfer/v1/tx.amino.ts index eb26603d66..a03ccde6de 100644 --- a/__fixtures__/v-next/outputv4/ibc/applications/transfer/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/ibc/applications/transfer/v1/tx.amino.ts @@ -65,8 +65,8 @@ export const AminoConverter = { sender, receiver, timeoutHeight: timeout_height ? { - revisionHeight: BigInt(timeout_height.revision_height || "0", true), - revisionNumber: BigInt(timeout_height.revision_number || "0", true) + revisionHeight: BigInt(timeout_height.revision_height || "0"), + revisionNumber: BigInt(timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(timeout_timestamp) }; diff --git a/__fixtures__/v-next/outputv4/ibc/core/channel/v1/channel.ts b/__fixtures__/v-next/outputv4/ibc/core/channel/v1/channel.ts index d786bfd493..dc19060387 100644 --- a/__fixtures__/v-next/outputv4/ibc/core/channel/v1/channel.ts +++ b/__fixtures__/v-next/outputv4/ibc/core/channel/v1/channel.ts @@ -337,8 +337,8 @@ export const Channel = { }, fromJSON(object: any): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -368,8 +368,8 @@ export const Channel = { }, fromSDK(object: ChannelSDKType): Channel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version @@ -377,8 +377,8 @@ export const Channel = { }, fromSDKJSON(object: any): ChannelSDKType { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, connection_hops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "" @@ -471,8 +471,8 @@ export const IdentifiedChannel = { }, fromJSON(object: any): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", @@ -508,8 +508,8 @@ export const IdentifiedChannel = { }, fromSDK(object: IdentifiedChannelSDKType): IdentifiedChannel { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], version: object?.version, @@ -519,8 +519,8 @@ export const IdentifiedChannel = { }, fromSDKJSON(object: any): IdentifiedChannelSDKType { return { - state: isSet(object.state) ? stateFromJSON(object.state) : 0, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, connection_hops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => String(e)) : [], version: isSet(object.version) ? String(object.version) : "", diff --git a/__fixtures__/v-next/outputv4/ibc/core/channel/v1/tx.amino.ts b/__fixtures__/v-next/outputv4/ibc/core/channel/v1/tx.amino.ts index faf969e232..a2055c9569 100644 --- a/__fixtures__/v-next/outputv4/ibc/core/channel/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/ibc/core/channel/v1/tx.amino.ts @@ -259,8 +259,8 @@ export const AminoConverter = { counterpartyVersion: counterparty_version, proofInit: proof_init, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -306,8 +306,8 @@ export const AminoConverter = { counterpartyVersion: counterparty_version, proofTry: proof_try, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -345,8 +345,8 @@ export const AminoConverter = { channelId: channel_id, proofAck: proof_ack, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -409,8 +409,8 @@ export const AminoConverter = { channelId: channel_id, proofInit: proof_init, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -461,15 +461,15 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofCommitment: proof_commitment, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; @@ -523,15 +523,15 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofUnreceived: proof_unreceived, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, nextSequenceRecv: BigInt(next_sequence_recv), signer @@ -589,16 +589,16 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, proofUnreceived: proof_unreceived, proofClose: proof_close, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, nextSequenceRecv: BigInt(next_sequence_recv), signer @@ -653,16 +653,16 @@ export const AminoConverter = { destinationChannel: packet.destination_channel, data: packet.data, timeoutHeight: packet.timeout_height ? { - revisionHeight: BigInt(packet.timeout_height.revision_height || "0", true), - revisionNumber: BigInt(packet.timeout_height.revision_number || "0", true) + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0") } : undefined, timeoutTimestamp: BigInt(packet.timeout_timestamp) }, acknowledgement, proofAcked: proof_acked, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; diff --git a/__fixtures__/v-next/outputv4/ibc/core/connection/v1/connection.ts b/__fixtures__/v-next/outputv4/ibc/core/connection/v1/connection.ts index 141b94f753..8b0782a361 100644 --- a/__fixtures__/v-next/outputv4/ibc/core/connection/v1/connection.ts +++ b/__fixtures__/v-next/outputv4/ibc/core/connection/v1/connection.ts @@ -261,7 +261,7 @@ export const ConnectionEnd = { return { clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) }; @@ -292,7 +292,7 @@ export const ConnectionEnd = { return { clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -301,7 +301,7 @@ export const ConnectionEnd = { return { client_id: isSet(object.client_id) ? String(object.client_id) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDKJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, delay_period: isSet(object.delay_period) ? BigInt(object.delay_period.toString()) : BigInt(0) }; @@ -389,7 +389,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", clientId: isSet(object.clientId) ? String(object.clientId) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) }; @@ -423,7 +423,7 @@ export const IdentifiedConnection = { id: object?.id, clientId: object?.client_id, versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDK(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, delayPeriod: object?.delay_period }; @@ -433,7 +433,7 @@ export const IdentifiedConnection = { id: isSet(object.id) ? String(object.id) : "", client_id: isSet(object.client_id) ? String(object.client_id) : "", versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromSDKJSON(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : 0, + state: isSet(object.state) ? stateFromJSON(object.state) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, delay_period: isSet(object.delay_period) ? BigInt(object.delay_period.toString()) : BigInt(0) }; diff --git a/__fixtures__/v-next/outputv4/ibc/core/connection/v1/tx.amino.ts b/__fixtures__/v-next/outputv4/ibc/core/connection/v1/tx.amino.ts index 6b18245ea7..53e0a3765c 100644 --- a/__fixtures__/v-next/outputv4/ibc/core/connection/v1/tx.amino.ts +++ b/__fixtures__/v-next/outputv4/ibc/core/connection/v1/tx.amino.ts @@ -218,15 +218,15 @@ export const AminoConverter = { features: el0.features })), proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, proofInit: proof_init, proofClient: proof_client, proofConsensus: proof_consensus, consensusHeight: consensus_height ? { - revisionHeight: BigInt(consensus_height.revision_height || "0", true), - revisionNumber: BigInt(consensus_height.revision_number || "0", true) + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0") } : undefined, signer }; @@ -295,15 +295,15 @@ export const AminoConverter = { value: client_state.value }, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, proofTry: proof_try, proofClient: proof_client, proofConsensus: proof_consensus, consensusHeight: consensus_height ? { - revisionHeight: BigInt(consensus_height.revision_height || "0", true), - revisionNumber: BigInt(consensus_height.revision_number || "0", true) + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0") } : undefined, signer }; @@ -337,8 +337,8 @@ export const AminoConverter = { connectionId: connection_id, proofAck: proof_ack, proofHeight: proof_height ? { - revisionHeight: BigInt(proof_height.revision_height || "0", true), - revisionNumber: BigInt(proof_height.revision_number || "0", true) + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0") } : undefined, signer }; diff --git a/__fixtures__/v-next/outputv4/ibc/core/port/v1/query.ts b/__fixtures__/v-next/outputv4/ibc/core/port/v1/query.ts index b835988f45..1665018f6e 100644 --- a/__fixtures__/v-next/outputv4/ibc/core/port/v1/query.ts +++ b/__fixtures__/v-next/outputv4/ibc/core/port/v1/query.ts @@ -96,7 +96,7 @@ export const QueryAppVersionRequest = { return { portId: isSet(object.portId) ? String(object.portId) : "", connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, proposedVersion: isSet(object.proposedVersion) ? String(object.proposedVersion) : "" }; @@ -123,7 +123,7 @@ export const QueryAppVersionRequest = { return { portId: object?.port_id, connectionId: object?.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, proposedVersion: object?.proposed_version }; @@ -132,7 +132,7 @@ export const QueryAppVersionRequest = { return { port_id: isSet(object.port_id) ? String(object.port_id) : "", connection_id: isSet(object.connection_id) ? String(object.connection_id) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromSDKJSON(object.counterparty) : undefined, proposed_version: isSet(object.proposed_version) ? String(object.proposed_version) : "" }; diff --git a/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v1/solomachine.ts b/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v1/solomachine.ts index 08c6572e5f..40bdcdcb1e 100644 --- a/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v1/solomachine.ts @@ -821,7 +821,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -845,7 +845,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -853,7 +853,7 @@ export const SignatureAndData = { fromSDKJSON(object: any): SignatureAndDataSDKType { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -1002,7 +1002,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1029,7 +1029,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1038,7 +1038,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v2/solomachine.ts b/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v2/solomachine.ts index 0114583a2e..c422514345 100644 --- a/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/__fixtures__/v-next/outputv4/ibc/lightclients/solomachine/v2/solomachine.ts @@ -821,7 +821,7 @@ export const SignatureAndData = { fromJSON(object: any): SignatureAndData { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -845,7 +845,7 @@ export const SignatureAndData = { fromSDK(object: SignatureAndDataSDKType): SignatureAndData { return { signature: object?.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data, timestamp: object?.timestamp }; @@ -853,7 +853,7 @@ export const SignatureAndData = { fromSDKJSON(object: any): SignatureAndDataSDKType { return { signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) }; @@ -1002,7 +1002,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : 0, + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, @@ -1029,7 +1029,7 @@ export const SignBytes = { sequence: object?.sequence, timestamp: object?.timestamp, diversifier: object?.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: object?.data }; }, @@ -1038,7 +1038,7 @@ export const SignBytes = { sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", - data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : 0, + data_type: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() }; }, diff --git a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/query.ts b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/query.ts index 27f8c77a33..5155543c80 100644 --- a/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/claim/v1beta1/query.ts @@ -441,7 +441,7 @@ export const QueryClaimableForActionRequest = { fromJSON(object: any): QueryClaimableForActionRequest { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toJSON(message: QueryClaimableForActionRequest): unknown { @@ -459,13 +459,13 @@ export const QueryClaimableForActionRequest = { fromSDK(object: QueryClaimableForActionRequestSDKType): QueryClaimableForActionRequest { return { address: object?.address, - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, fromSDKJSON(object: any): QueryClaimableForActionRequestSDKType { return { address: isSet(object.address) ? String(object.address) : "", - action: isSet(object.action) ? actionFromJSON(object.action) : 0 + action: isSet(object.action) ? actionFromJSON(object.action) : -1 }; }, toSDK(message: QueryClaimableForActionRequest): QueryClaimableForActionRequestSDKType { diff --git a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts index 31ea1413de..200072bec9 100644 --- a/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts +++ b/__fixtures__/v-next/outputv4/osmosis/lockup/lock.ts @@ -332,7 +332,7 @@ export const QueryCondition = { }, fromJSON(object: any): QueryCondition { return { - lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : 0, + lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined @@ -356,7 +356,7 @@ export const QueryCondition = { }, fromSDK(object: QueryConditionSDKType): QueryCondition { return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: object?.denom, duration: object.duration ? Duration.fromSDK(object.duration) : undefined, timestamp: object.timestamp ?? undefined @@ -364,7 +364,7 @@ export const QueryCondition = { }, fromSDKJSON(object: any): QueryConditionSDKType { return { - lock_query_type: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : 0, + lock_query_type: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, denom: isSet(object.denom) ? String(object.denom) : "", duration: isSet(object.duration) ? Duration.fromSDKJSON(object.duration) : undefined, timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined diff --git a/__fixtures__/v-next/outputv4/osmosis/superfluid/query.ts b/__fixtures__/v-next/outputv4/osmosis/superfluid/query.ts index 46b9027db1..2dfc4455ca 100644 --- a/__fixtures__/v-next/outputv4/osmosis/superfluid/query.ts +++ b/__fixtures__/v-next/outputv4/osmosis/superfluid/query.ts @@ -414,7 +414,7 @@ export const AssetTypeResponse = { }, fromJSON(object: any): AssetTypeResponse { return { - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: AssetTypeResponse): unknown { @@ -429,12 +429,12 @@ export const AssetTypeResponse = { }, fromSDK(object: AssetTypeResponseSDKType): AssetTypeResponse { return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, fromSDKJSON(object: any): AssetTypeResponseSDKType { return { - asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: AssetTypeResponse): AssetTypeResponseSDKType { diff --git a/__fixtures__/v-next/outputv4/osmosis/superfluid/superfluid.ts b/__fixtures__/v-next/outputv4/osmosis/superfluid/superfluid.ts index 2383859b6b..d5ddc42ead 100644 --- a/__fixtures__/v-next/outputv4/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/v-next/outputv4/osmosis/superfluid/superfluid.ts @@ -186,7 +186,7 @@ export const SuperfluidAsset = { fromJSON(object: any): SuperfluidAsset { return { denom: isSet(object.denom) ? String(object.denom) : "", - assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : 0 + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 }; }, toJSON(message: SuperfluidAsset): unknown { @@ -204,13 +204,13 @@ export const SuperfluidAsset = { fromSDK(object: SuperfluidAssetSDKType): SuperfluidAsset { return { denom: object?.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, fromSDKJSON(object: any): SuperfluidAssetSDKType { return { denom: isSet(object.denom) ? String(object.denom) : "", - asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : 0 + asset_type: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 }; }, toSDK(message: SuperfluidAsset): SuperfluidAssetSDKType { diff --git a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts index 8ca768d27d..371fe174b1 100644 --- a/__fixtures__/v-next/outputv4/tendermint/abci/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/abci/types.ts @@ -1623,7 +1623,7 @@ export const RequestCheckTx = { fromJSON(object: any): RequestCheckTx { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toJSON(message: RequestCheckTx): unknown { @@ -1641,13 +1641,13 @@ export const RequestCheckTx = { fromSDK(object: RequestCheckTxSDKType): RequestCheckTx { return { tx: object?.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, fromSDKJSON(object: any): RequestCheckTxSDKType { return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0 + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 }; }, toSDK(message: RequestCheckTx): RequestCheckTxSDKType { @@ -3642,7 +3642,7 @@ export const ResponseOfferSnapshot = { }, fromJSON(object: any): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toJSON(message: ResponseOfferSnapshot): unknown { @@ -3657,12 +3657,12 @@ export const ResponseOfferSnapshot = { }, fromSDK(object: ResponseOfferSnapshotSDKType): ResponseOfferSnapshot { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, fromSDKJSON(object: any): ResponseOfferSnapshotSDKType { return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 }; }, toSDK(message: ResponseOfferSnapshot): ResponseOfferSnapshotSDKType { @@ -3785,7 +3785,7 @@ export const ResponseApplySnapshotChunk = { }, fromJSON(object: any): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [], rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [] }; @@ -3814,14 +3814,14 @@ export const ResponseApplySnapshotChunk = { }, fromSDK(object: ResponseApplySnapshotChunkSDKType): ResponseApplySnapshotChunk { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] }; }, fromSDKJSON(object: any): ResponseApplySnapshotChunkSDKType { return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0, + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, refetch_chunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => Number(e)) : [], reject_senders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => String(e)) : [] }; @@ -4639,7 +4639,7 @@ export const Evidence = { }, fromJSON(object: any): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? new Date(object.time) : undefined, @@ -4666,7 +4666,7 @@ export const Evidence = { }, fromSDK(object: EvidenceSDKType): Evidence { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: object.validator ? Validator.fromSDK(object.validator) : undefined, height: object?.height, time: object.time ?? undefined, @@ -4675,7 +4675,7 @@ export const Evidence = { }, fromSDKJSON(object: any): EvidenceSDKType { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, validator: isSet(object.validator) ? Validator.fromSDKJSON(object.validator) : undefined, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), time: isSet(object.time) ? new Date(object.time) : undefined, diff --git a/__fixtures__/v-next/outputv4/tendermint/types/types.ts b/__fixtures__/v-next/outputv4/tendermint/types/types.ts index 1e8ea1d1cc..c70f63302a 100644 --- a/__fixtures__/v-next/outputv4/tendermint/types/types.ts +++ b/__fixtures__/v-next/outputv4/tendermint/types/types.ts @@ -905,7 +905,7 @@ export const Vote = { }, fromJSON(object: any): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, @@ -941,7 +941,7 @@ export const Vote = { }, fromSDK(object: VoteSDKType): Vote { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, blockId: object.block_id ? BlockID.fromSDK(object.block_id) : undefined, @@ -953,7 +953,7 @@ export const Vote = { }, fromSDKJSON(object: any): VoteSDKType { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, block_id: isSet(object.block_id) ? BlockID.fromSDKJSON(object.block_id) : undefined, @@ -1135,7 +1135,7 @@ export const CommitSig = { }, fromJSON(object: any): CommitSig { return { - blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : 0, + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1159,7 +1159,7 @@ export const CommitSig = { }, fromSDK(object: CommitSigSDKType): CommitSig { return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validatorAddress: object?.validator_address, timestamp: object.timestamp ?? undefined, signature: object?.signature @@ -1167,7 +1167,7 @@ export const CommitSig = { }, fromSDKJSON(object: any): CommitSigSDKType { return { - block_id_flag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : 0, + block_id_flag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, validator_address: isSet(object.validator_address) ? bytesFromBase64(object.validator_address) : new Uint8Array(), timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array() @@ -1255,7 +1255,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, polRound: isSet(object.polRound) ? Number(object.polRound) : 0, @@ -1288,7 +1288,7 @@ export const Proposal = { }, fromSDK(object: ProposalSDKType): Proposal { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: object?.height, round: object?.round, polRound: object?.pol_round, @@ -1299,7 +1299,7 @@ export const Proposal = { }, fromSDKJSON(object: any): ProposalSDKType { return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : 0, + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), round: isSet(object.round) ? Number(object.round) : 0, pol_round: isSet(object.pol_round) ? Number(object.pol_round) : 0, diff --git a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap index 0ec1188c9c..49b4e7c95b 100644 --- a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap +++ b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap @@ -258,7 +258,7 @@ exports[`cosmos/tx/v1beta1/tx AuxSignerData 1`] = ` return { address: isSet(object.address) ? String(object.address) : "", signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() }; }, @@ -282,7 +282,7 @@ exports[`cosmos/tx/v1beta1/tx AuxSignerData 1`] = ` return { address: object?.address, signDoc: object.sign_doc ? SignDocDirectAux.fromSDK(object.sign_doc) : undefined, - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, sig: object?.sig }; }, @@ -1929,7 +1929,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` return { name: isSet(object.name) ? String(object.name) : "", timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: isSet(object.httpRequest) ? HttpRequest.fromJSON(object.httpRequest) : undefined, trace: isSet(object.trace) ? String(object.trace) : "", insertId: isSet(object.insertId) ? String(object.insertId) : "", @@ -1994,7 +1994,7 @@ exports[`google/api/servicecontrol/v1/log_entry LogEntry 1`] = ` return { name: object?.name, timestamp: object.timestamp ? Timestamp.fromSDK(object.timestamp) : undefined, - severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : 0, + severity: isSet(object.severity) ? logSeverityFromJSON(object.severity) : -1, httpRequest: object.http_request ? HttpRequest.fromSDK(object.http_request) : undefined, trace: object?.trace, insertId: object?.insert_id, @@ -2163,7 +2163,7 @@ exports[`ibc/core/port/v1/query 1`] = ` return { portId: isSet(object.portId) ? String(object.portId) : "", connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, proposedVersion: isSet(object.proposedVersion) ? String(object.proposedVersion) : "" }; @@ -2190,7 +2190,7 @@ exports[`ibc/core/port/v1/query 1`] = ` return { portId: object?.port_id, connectionId: object?.connection_id, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, counterparty: object.counterparty ? Counterparty.fromSDK(object.counterparty) : undefined, proposedVersion: object?.proposed_version }; diff --git a/packages/ast/src/encoding/amino/from-amino-json/utils.ts b/packages/ast/src/encoding/amino/from-amino-json/utils.ts index d9928dcaa3..ee23dabf75 100644 --- a/packages/ast/src/encoding/amino/from-amino-json/utils.ts +++ b/packages/ast/src/encoding/amino/from-amino-json/utils.ts @@ -135,6 +135,34 @@ export const fromAmino = { height(args: FromAminoParseField) { TypeLong.addUtil(args.context); + const longType = TypeLong.getType(args.context); + + let revisionHeightArgs: t.Expression[] = [ + t.logicalExpression( + '||', + t.memberExpression( + memberExpressionOrIdentifierAminoCaseField(args.fieldPath, args.context.aminoCaseField), + t.identifier(args.context.aminoCasingFn('revision_height')) + ), + t.stringLiteral('0') + ) + ]; + + let revisionNumberArgs: t.Expression[] = [ + t.logicalExpression( + '||', + t.memberExpression( + memberExpressionOrIdentifierAminoCaseField(args.fieldPath, args.context.aminoCaseField), + t.identifier(args.context.aminoCasingFn('revision_number')) + ), + t.stringLiteral('0') + ) + ]; + + if(longType == 'Long') { + revisionHeightArgs.push(t.booleanLiteral(true)) + revisionNumberArgs.push(t.booleanLiteral(true)) + } return t.objectProperty( t.identifier(args.field.name), @@ -144,33 +172,14 @@ export const fromAmino = { t.objectProperty(t.identifier('revisionHeight'), t.callExpression( TypeLong.getFromString(args.context), - [ - t.logicalExpression( - '||', - t.memberExpression( - memberExpressionOrIdentifierAminoCaseField(args.fieldPath, args.context.aminoCaseField), - t.identifier(args.context.aminoCasingFn('revision_height')) - ), - t.stringLiteral('0') - ), - t.booleanLiteral(true) - ]) + revisionHeightArgs + ) ), - // t.objectProperty(t.identifier('revisionNumber'), t.callExpression( TypeLong.getFromString(args.context), - [ - t.logicalExpression( - '||', - t.memberExpression( - memberExpressionOrIdentifierAminoCaseField(args.fieldPath, args.context.aminoCaseField), - t.identifier(args.context.aminoCasingFn('revision_number')) - ), - t.stringLiteral('0') - ), - t.booleanLiteral(true) - ]) + revisionNumberArgs + ) ) ]), t.identifier('undefined') diff --git a/packages/ast/src/encoding/proto/from-amino/index.ts b/packages/ast/src/encoding/proto/from-amino/index.ts index e1f65ac600..80740a0374 100644 --- a/packages/ast/src/encoding/proto/from-amino/index.ts +++ b/packages/ast/src/encoding/proto/from-amino/index.ts @@ -194,13 +194,10 @@ export const fromAminoJSONMethod = (context: ProtoParseContext, name: string, pr } break; } - // case 'Timestamp': - // case 'google.protobuf.Timestamp': - // body.push(t.returnStatement( - // t.objectExpression([ - // ]) - // )) - // break; + case 'Timestamp': + case 'google.protobuf.Timestamp': + [].push.apply(body, fromAminoMessages.timestamp(context, name, proto)); + break; default: } } diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index 4c04555583..c2a4d286ee 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -324,7 +324,7 @@ export const fromAminoJSON = { ) ] ), - args.isOptional ? t.identifier('undefined') : t.numericLiteral(0) + args.isOptional ? t.identifier('undefined') : t.numericLiteral(-1) ) ); }, @@ -338,7 +338,7 @@ export const fromAminoJSON = { }, timestamp(args: FromAminoJSONMethod) { - return fromAminoJSON.type(args); + return fromAminoJSON.scalar(args); }, // labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ @@ -704,28 +704,53 @@ export const arrayTypes = { export const fromAminoMessages = { + timestamp(context: ProtoParseContext, name: string, proto: ProtoType) { + context.addUtil('fromJsonTimestamp'); + + return [ + t.returnStatement( + t.callExpression( + t.identifier('fromJsonTimestamp'), + [ + t.identifier('object') + ] + ) + ) + ] + }, height(context: ProtoParseContext, name: string, proto: ProtoType) { TypeLong.addUtil(context); const keepCase = context.options.prototypes.parser.keepCase; const casing = keepCase ? (str) => str : camel; + const makeArgs = (fieldName: string) => { + let args: t.Expression[] = [ + t.logicalExpression( + '||', + t.memberExpression( + t.identifier('object'), + t.identifier(fieldName) + ), + t.stringLiteral('0') + ), + ]; + + const longType = TypeLong.getType(context); + + if(longType == 'Long') { + args.push(t.booleanLiteral(true)) + } + + return args; + }; + const makeField = (fieldName: string) => t.objectProperty( t.identifier(casing(fieldName)), t.callExpression( TypeLong.getFromString(context), - [ - t.logicalExpression( - '||', - t.memberExpression( - t.identifier('object'), - t.identifier(fieldName) - ), - t.stringLiteral('0') - ), - t.booleanLiteral(true) - ] + makeArgs(fieldName) ) ); @@ -742,56 +767,90 @@ export const fromAminoMessages = { }, duration(context: ProtoParseContext, name: string, proto: ProtoType) { TypeLong.addUtil(context); - return [ - t.variableDeclaration('const', [ + + const longType = TypeLong.getType(context); + + switch (longType) { + case 'BigInt': + return [ + t.variableDeclaration('const', [ t.variableDeclarator( - t.identifier('value'), - t.callExpression( - t.identifier('parseInt'), - [ - t.identifier('object') - ] - ) + t.identifier('value'), + t.callExpression( + t.identifier('BigInt'), + [t.identifier('object')] + ) ) - ]), - // return - t.returnStatement( + ]), + t.returnStatement( t.objectExpression([ - - // seconds - t.objectProperty( - t.identifier('seconds'), - t.callExpression( - TypeLong.getFromNumber(context), - [ - t.callExpression( - t.memberExpression( - t.identifier('Math'), - t.identifier('floor') - ), - [ - t.binaryExpression( - '/', - t.identifier('value'), - BILLION - ) - ] - ) - ] - ) - ), - - // nanos - t.objectProperty( - t.identifier('nanos'), + t.objectProperty( + t.identifier('seconds'), + t.binaryExpression( + '/', + t.identifier('value'), + t.callExpression( + t.identifier('BigInt'), + [t.stringLiteral("1000000000")] + ) + ) + ), + t.objectProperty( + t.identifier('nanos'), + t.callExpression( + t.identifier('Number'), + [ t.binaryExpression( - '%', - t.identifier('value'), - BILLION + '%', + t.identifier('value'), + t.callExpression( + t.identifier('BigInt'), + [t.stringLiteral("1000000000")] + ) ) + ] ) + ) ]) - ) - ]; + ) + ] + + case 'Long': + default: + return [ + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier('value'), + t.callExpression(t.identifier('parseInt'), [ + t.identifier('object') + ]) + ) + ]), + // return + t.returnStatement( + t.objectExpression([ + // seconds + t.objectProperty( + t.identifier('seconds'), + t.callExpression(TypeLong.getFromNumber(context), [ + t.callExpression( + t.memberExpression( + t.identifier('Math'), + t.identifier('floor') + ), + [t.binaryExpression('/', t.identifier('value'), BILLION)] + ) + ]) + ), + + // nanos + t.objectProperty( + t.identifier('nanos'), + t.binaryExpression('%', t.identifier('value'), BILLION) + ) + ]) + ) + ]; + } } } \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/from-json/utils.ts b/packages/ast/src/encoding/proto/from-json/utils.ts index 81ba4f78c7..7cfb8703c6 100644 --- a/packages/ast/src/encoding/proto/from-json/utils.ts +++ b/packages/ast/src/encoding/proto/from-json/utils.ts @@ -239,7 +239,7 @@ export const fromJSON = { ) ] ), - args.isOptional ? t.identifier('undefined') : t.numericLiteral(0) + args.isOptional ? t.identifier('undefined') : t.numericLiteral(-1) ) ); }, diff --git a/packages/ast/src/encoding/proto/from-sdk-json/utils.ts b/packages/ast/src/encoding/proto/from-sdk-json/utils.ts index 51c645491a..bd87f4eec6 100644 --- a/packages/ast/src/encoding/proto/from-sdk-json/utils.ts +++ b/packages/ast/src/encoding/proto/from-sdk-json/utils.ts @@ -160,7 +160,7 @@ export const fromSDKJSON = { t.callExpression(t.identifier(fromSDKJSONFuncName), [ t.memberExpression(t.identifier('object'), t.identifier(origName)) ]), - args.isOptional ? t.identifier('undefined') : t.numericLiteral(0) + args.isOptional ? t.identifier('undefined') : t.numericLiteral(-1) ) ); }, diff --git a/packages/ast/src/encoding/proto/from-sdk/utils.ts b/packages/ast/src/encoding/proto/from-sdk/utils.ts index 1082893d8c..5efbb93867 100644 --- a/packages/ast/src/encoding/proto/from-sdk/utils.ts +++ b/packages/ast/src/encoding/proto/from-sdk/utils.ts @@ -132,7 +132,7 @@ export const fromSDK = { ) ] ), - args.isOptional ? t.identifier('undefined') : t.numericLiteral(0) + args.isOptional ? t.identifier('undefined') : t.numericLiteral(-1) ) ); }, diff --git a/packages/ast/src/encoding/proto/to-amino/index.ts b/packages/ast/src/encoding/proto/to-amino/index.ts index b6f1df220f..646b627455 100644 --- a/packages/ast/src/encoding/proto/to-amino/index.ts +++ b/packages/ast/src/encoding/proto/to-amino/index.ts @@ -190,13 +190,10 @@ export const toAminoJSONMethod = (context: ProtoParseContext, name: string, prot body.push(toAminoMessages.duration(context, name, proto)); break; } - // case 'Timestamp': - // case 'google.protobuf.Timestamp': - // body.push(t.returnStatement( - // t.objectExpression([ - // ]) - // )) - // break; + case 'Timestamp': + case 'google.protobuf.Timestamp': + body.push(toAminoMessages.timestamp(context, name, proto)); + break; default: } } @@ -217,7 +214,7 @@ export const toAminoJSONMethod = (context: ProtoParseContext, name: string, prot ...fields, - // RETURN + // RETURN t.returnStatement(t.identifier('obj')) ]); } diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index f05a35ca9c..9864d3ac60 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -1,6 +1,6 @@ import * as t from '@babel/types'; import { ProtoType } from '@osmonauts/types'; -import { BILLION } from '../../../utils'; +import { BILLION, TypeLong } from '../../../utils'; import { ProtoParseContext } from '../../context'; import { getFieldNames } from '../../types'; import { getInterfaceToAminoName } from '../implements'; @@ -238,7 +238,7 @@ export const toAminoJSON = { }, timestamp(args: ToAminoJSONMethod) { - return toAminoJSON.type(args); + return toAminoJSON.scalar(args); }, pubkey(args: ToAminoJSONMethod) { @@ -661,35 +661,90 @@ export const arrayTypes = { export const toAminoMessages = { - duration(context: ProtoParseContext, name: string, proto: ProtoType) { - return t.returnStatement( + timestamp(context: ProtoParseContext, name: string, proto: ProtoType) { + context.addUtil('fromTimestamp'); + + return t.returnStatement( + t.callExpression( + t.memberExpression( t.callExpression( + t.identifier('fromTimestamp'), + [t.identifier('message')] + ), + t.identifier('toString') + ), + [] + ) + ) + }, + duration(context: ProtoParseContext, name: string, proto: ProtoType) { + const longType = TypeLong.getType(context); + + switch (longType) { + case 'BigInt': + return t.returnStatement( + t.callExpression( t.memberExpression( + t.parenthesizedExpression( t.binaryExpression( - '+', - t.binaryExpression( - '*', - t.callExpression( - t.memberExpression( - t.memberExpression( - t.identifier('message'), - t.identifier('seconds') - ), - t.identifier('toInt') - ), - [] - ), - BILLION + '+', + t.binaryExpression( + '*', + t.memberExpression( + t.identifier('message'), + t.identifier('seconds'), ), + t.callExpression( + t.identifier('BigInt'), + [t.stringLiteral("1000000000")], + ), + ), + t.callExpression( + t.identifier('BigInt'), + [t.memberExpression( + t.identifier('message'), + t.identifier('nanos'), + )], + ), + ), + ), + t.identifier('toString'), + ), + [], + ) + ) + case 'Long': + default: + return t.returnStatement( + t.callExpression( + t.memberExpression( + t.binaryExpression( + '+', + t.binaryExpression( + '*', + t.callExpression( t.memberExpression( + t.memberExpression( t.identifier('message'), - t.identifier('nanos') - ) + t.identifier('seconds') + ), + t.identifier('toInt') + ), + [] + ), + BILLION ), - t.identifier('toString') + t.memberExpression( + t.identifier('message'), + t.identifier('nanos') + ) + ), + t.identifier('toString') ), [] - ) - ) + ) + ); + } + } } \ No newline at end of file diff --git a/packages/telescope/src/helpers/binary-coder.ts b/packages/telescope/src/helpers/binary-coder.ts index 3496884d3c..a5ad8cd1d3 100644 --- a/packages/telescope/src/helpers/binary-coder.ts +++ b/packages/telescope/src/helpers/binary-coder.ts @@ -183,11 +183,11 @@ export class BinaryReader { return BigInt(int64ToString(lo, hi)); } - float() { + float(): number { throw new Error("float not supported"); } - double() { + double(): number { throw new Error("double not supported"); } diff --git a/packages/telescope/types/helpers/binary-coder.d.ts b/packages/telescope/types/helpers/binary-coder.d.ts index 7c631f907c..8a965d442c 100644 --- a/packages/telescope/types/helpers/binary-coder.d.ts +++ b/packages/telescope/types/helpers/binary-coder.d.ts @@ -1 +1 @@ -export declare const binary = "\n// Copyright (c) 2016, Daniel Wirtz All rights reserved.\n\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of its author, nor the names of its contributors\n// may be used to endorse or promote products derived from this software\n// without specific prior written permission.\n\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ---\n\n// Code generated by the command line utilities is owned by the owner\n// of the input file used when generating it. This code is not\n// standalone and requires a support library to be linked with it. This\n// support library is itself covered by the above license.\n\nimport { utf8Length, utf8Read, utf8Write } from \"./utf8\";\nimport {\n int64ToString,\n readInt32,\n readUInt32,\n uInt64ToString,\n varint32read,\n varint64read,\n writeVarint32,\n writeVarint64,\n int64FromString,\n int64Length,\n writeFixed32,\n writeByte,\n zzDecode,\n zzEncode,\n} from \"./varint\";\n\nexport enum WireType {\n Varint = 0,\n\n Fixed64 = 1,\n\n Bytes = 2,\n\n Fixed32 = 5,\n}\n\n// Reader\n\nexport class BinaryReader {\n buf: Uint8Array;\n pos: number;\n type: number;\n len: number;\n\n protected assertBounds(): void {\n if (this.pos > this.len) throw new RangeError(\"premature EOF\");\n }\n\n constructor(buf?: ArrayLike) {\n this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0);\n this.pos = 0;\n this.type = 0;\n this.len = this.buf.length;\n }\n\n tag(): [number, WireType, number] {\n const tag = this.uint32(),\n fieldNo = tag >>> 3,\n wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\n \"illegal tag: field no \" + fieldNo + \" wire type \" + wireType\n );\n return [fieldNo, wireType, tag];\n }\n\n skip(length?: number) {\n if (typeof length === \"number\") {\n if (this.pos + length > this.len) throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n if (this.pos >= this.len) throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n }\n\n skipType(wireType: number) {\n switch (wireType) {\n case WireType.Varint:\n this.skip();\n break;\n case WireType.Fixed64:\n this.skip(8);\n break;\n case WireType.Bytes:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case WireType.Fixed32:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n }\n\n uint32(): number {\n return varint32read.bind(this)();\n }\n\n int32(): number {\n return this.uint32() | 0;\n }\n\n sint32(): number {\n const num = this.uint32();\n return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n }\n\n fixed32(): number {\n const val = readUInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n }\n\n sfixed32(): number {\n const val = readInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n }\n\n int64(): bigint {\n const [lo, hi] = varint64read.bind(this)();\n return BigInt(int64ToString(lo, hi));\n }\n\n uint64(): bigint {\n const [lo, hi] = varint64read.bind(this)();\n return BigInt(uInt64ToString(lo, hi));\n }\n\n sint64(): bigint {\n let [lo, hi] = varint64read.bind(this)();\n // zig zag\n [lo, hi] = zzDecode(lo, hi);\n return BigInt(int64ToString(lo, hi));\n }\n\n fixed64(): bigint {\n const lo = this.sfixed32();\n const hi = this.sfixed32();\n return BigInt(uInt64ToString(lo, hi));\n }\n sfixed64(): bigint {\n const lo = this.sfixed32();\n const hi = this.sfixed32();\n return BigInt(int64ToString(lo, hi));\n }\n\n float() {\n throw new Error(\"float not supported\");\n }\n\n double() {\n throw new Error(\"double not supported\");\n }\n\n bool(): boolean {\n const [lo, hi] = varint64read.bind(this)();\n return lo !== 0 || hi !== 0;\n }\n\n bytes(): Uint8Array {\n const len = this.uint32(),\n start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n\n string(): string {\n const bytes = this.bytes();\n return utf8Read(bytes, 0, bytes.length);\n }\n}\n\n// Writer\n\ntype OpVal = string | number | object | Uint8Array;\n\nclass Op {\n fn?: (val: OpVal, buf: Uint8Array | number[], pos: number) => void;\n len: number;\n val: OpVal;\n next?: Op;\n\n constructor(\n fn: (\n val: OpVal,\n buf: Uint8Array | number[],\n pos: number\n ) => void | undefined,\n len: number,\n val: OpVal\n ) {\n this.fn = fn;\n this.len = len;\n this.val = val;\n }\n}\n\nclass State {\n head: Op;\n tail: Op;\n len: number;\n next: State;\n\n constructor(writer: BinaryWriter) {\n this.head = writer.head;\n this.tail = writer.tail;\n this.len = writer.len;\n this.next = writer.states;\n }\n}\n\nexport class BinaryWriter {\n len = 0;\n head: Op;\n tail: Op;\n states: State;\n\n constructor() {\n this.head = new Op(null, 0, 0);\n this.tail = this.head;\n this.states = null;\n }\n\n static create() {\n return new BinaryWriter();\n }\n\n static alloc(size: number): Uint8Array | number[] {\n if (typeof Uint8Array !== \"undefined\") {\n return pool(\n (size) => new Uint8Array(size),\n Uint8Array.prototype.subarray\n )(size);\n } else {\n return new Array(size);\n }\n }\n\n private _push(\n fn: (val: OpVal, buf: Uint8Array | number[], pos: number) => void,\n len: number,\n val: OpVal\n ) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n }\n\n finish(): Uint8Array {\n let head = this.head.next,\n pos = 0;\n const buf = BinaryWriter.alloc(this.len);\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n return buf as Uint8Array;\n }\n\n fork(): BinaryWriter {\n this.states = new State(this);\n this.head = this.tail = new Op(null, 0, 0);\n this.len = 0;\n return this;\n }\n\n reset(): BinaryWriter {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(null, 0, 0);\n this.len = 0;\n }\n return this;\n }\n\n ldelim(): BinaryWriter {\n const head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n }\n\n tag(fieldNo: number, type: WireType): BinaryWriter {\n return this.uint32(((fieldNo << 3) | type) >>> 0);\n }\n\n uint32(value: number): BinaryWriter {\n this.len += (this.tail = this.tail.next =\n new Op(\n writeVarint32,\n (value = value >>> 0) < 128\n ? 1\n : value < 16384\n ? 2\n : value < 2097152\n ? 3\n : value < 268435456\n ? 4\n : 5,\n value\n )).len;\n return this;\n }\n\n int32(value: number): BinaryWriter {\n return value < 0\n ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec\n : this.uint32(value);\n }\n\n sint32(value: number): BinaryWriter {\n return this.uint32(((value << 1) ^ (value >> 31)) >>> 0);\n }\n\n int64(value: string | number | bigint): BinaryWriter {\n const { lo, hi } = int64FromString(value.toString());\n return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });\n }\n\n // uint64 is the same with int64\n uint64 = BinaryWriter.prototype.int64;\n\n sint64(value: string | number | bigint): BinaryWriter {\n let { lo, hi } = int64FromString(value.toString());\n // zig zag\n [lo, hi] = zzEncode(lo, hi);\n return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });\n }\n\n fixed64(value: string | number | bigint): BinaryWriter {\n const { lo, hi } = int64FromString(value.toString());\n return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi);\n }\n\n // sfixed64 is the same with fixed64\n sfixed64 = BinaryWriter.prototype.fixed64;\n\n bool(value: boolean): BinaryWriter {\n return this._push(writeByte, 1, value ? 1 : 0);\n }\n\n fixed32(value: number): BinaryWriter {\n return this._push(writeFixed32, 4, value >>> 0);\n }\n\n // sfixed32 is the same with fixed32\n sfixed32 = BinaryWriter.prototype.fixed32;\n\n float(value: number): BinaryWriter {\n throw new Error(\"float not supported\" + value);\n }\n\n double(value: number): BinaryWriter {\n throw new Error(\"double not supported\" + value);\n }\n\n bytes(value: Uint8Array): BinaryWriter {\n const len = value.length >>> 0;\n if (!len) return this._push(writeByte, 1, 0);\n return this.uint32(len)._push(writeBytes, len, value);\n }\n\n string(value: string): BinaryWriter {\n const len = utf8Length(value);\n return len\n ? this.uint32(len)._push(utf8Write, len, value)\n : this._push(writeByte, 1, 0);\n }\n}\n\nfunction writeBytes(\n val: Uint8Array | number[],\n buf: Uint8Array | number[],\n pos: number\n) {\n if (typeof Uint8Array !== \"undefined\") {\n (buf as Uint8Array).set(val, pos);\n } else {\n for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i];\n }\n}\n\nfunction pool(\n alloc: (size: number) => Uint8Array,\n slice: (begin?: number, end?: number) => Uint8Array,\n size?: number\n): (size: number) => Uint8Array {\n const SIZE = size || 8192;\n const MAX = SIZE >>> 1;\n let slab = null;\n let offset = SIZE;\n return function pool_alloc(size): Uint8Array {\n if (size < 1 || size > MAX) return alloc(size);\n if (offset + size > SIZE) {\n slab = alloc(SIZE);\n offset = 0;\n }\n const buf: Uint8Array = slice.call(slab, offset, (offset += size));\n if (offset & 7)\n // align to 32 bit\n offset = (offset | 7) + 1;\n return buf;\n };\n}\n\nfunction indexOutOfRange(reader: BinaryReader, writeLength?: number) {\n return RangeError(\n \"index out of range: \" +\n reader.pos +\n \" + \" +\n (writeLength || 1) +\n \" > \" +\n reader.len\n );\n}\n"; +export declare const binary = "\n// Copyright (c) 2016, Daniel Wirtz All rights reserved.\n\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of its author, nor the names of its contributors\n// may be used to endorse or promote products derived from this software\n// without specific prior written permission.\n\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ---\n\n// Code generated by the command line utilities is owned by the owner\n// of the input file used when generating it. This code is not\n// standalone and requires a support library to be linked with it. This\n// support library is itself covered by the above license.\n\nimport { utf8Length, utf8Read, utf8Write } from \"./utf8\";\nimport {\n int64ToString,\n readInt32,\n readUInt32,\n uInt64ToString,\n varint32read,\n varint64read,\n writeVarint32,\n writeVarint64,\n int64FromString,\n int64Length,\n writeFixed32,\n writeByte,\n zzDecode,\n zzEncode,\n} from \"./varint\";\n\nexport enum WireType {\n Varint = 0,\n\n Fixed64 = 1,\n\n Bytes = 2,\n\n Fixed32 = 5,\n}\n\n// Reader\n\nexport class BinaryReader {\n buf: Uint8Array;\n pos: number;\n type: number;\n len: number;\n\n protected assertBounds(): void {\n if (this.pos > this.len) throw new RangeError(\"premature EOF\");\n }\n\n constructor(buf?: ArrayLike) {\n this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0);\n this.pos = 0;\n this.type = 0;\n this.len = this.buf.length;\n }\n\n tag(): [number, WireType, number] {\n const tag = this.uint32(),\n fieldNo = tag >>> 3,\n wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\n \"illegal tag: field no \" + fieldNo + \" wire type \" + wireType\n );\n return [fieldNo, wireType, tag];\n }\n\n skip(length?: number) {\n if (typeof length === \"number\") {\n if (this.pos + length > this.len) throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n if (this.pos >= this.len) throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n }\n\n skipType(wireType: number) {\n switch (wireType) {\n case WireType.Varint:\n this.skip();\n break;\n case WireType.Fixed64:\n this.skip(8);\n break;\n case WireType.Bytes:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case WireType.Fixed32:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n }\n\n uint32(): number {\n return varint32read.bind(this)();\n }\n\n int32(): number {\n return this.uint32() | 0;\n }\n\n sint32(): number {\n const num = this.uint32();\n return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n }\n\n fixed32(): number {\n const val = readUInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n }\n\n sfixed32(): number {\n const val = readInt32(this.buf, this.pos);\n this.pos += 4;\n return val;\n }\n\n int64(): bigint {\n const [lo, hi] = varint64read.bind(this)();\n return BigInt(int64ToString(lo, hi));\n }\n\n uint64(): bigint {\n const [lo, hi] = varint64read.bind(this)();\n return BigInt(uInt64ToString(lo, hi));\n }\n\n sint64(): bigint {\n let [lo, hi] = varint64read.bind(this)();\n // zig zag\n [lo, hi] = zzDecode(lo, hi);\n return BigInt(int64ToString(lo, hi));\n }\n\n fixed64(): bigint {\n const lo = this.sfixed32();\n const hi = this.sfixed32();\n return BigInt(uInt64ToString(lo, hi));\n }\n sfixed64(): bigint {\n const lo = this.sfixed32();\n const hi = this.sfixed32();\n return BigInt(int64ToString(lo, hi));\n }\n\n float(): number {\n throw new Error(\"float not supported\");\n }\n\n double(): number {\n throw new Error(\"double not supported\");\n }\n\n bool(): boolean {\n const [lo, hi] = varint64read.bind(this)();\n return lo !== 0 || hi !== 0;\n }\n\n bytes(): Uint8Array {\n const len = this.uint32(),\n start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n\n string(): string {\n const bytes = this.bytes();\n return utf8Read(bytes, 0, bytes.length);\n }\n}\n\n// Writer\n\ntype OpVal = string | number | object | Uint8Array;\n\nclass Op {\n fn?: (val: OpVal, buf: Uint8Array | number[], pos: number) => void;\n len: number;\n val: OpVal;\n next?: Op;\n\n constructor(\n fn: (\n val: OpVal,\n buf: Uint8Array | number[],\n pos: number\n ) => void | undefined,\n len: number,\n val: OpVal\n ) {\n this.fn = fn;\n this.len = len;\n this.val = val;\n }\n}\n\nclass State {\n head: Op;\n tail: Op;\n len: number;\n next: State;\n\n constructor(writer: BinaryWriter) {\n this.head = writer.head;\n this.tail = writer.tail;\n this.len = writer.len;\n this.next = writer.states;\n }\n}\n\nexport class BinaryWriter {\n len = 0;\n head: Op;\n tail: Op;\n states: State;\n\n constructor() {\n this.head = new Op(null, 0, 0);\n this.tail = this.head;\n this.states = null;\n }\n\n static create() {\n return new BinaryWriter();\n }\n\n static alloc(size: number): Uint8Array | number[] {\n if (typeof Uint8Array !== \"undefined\") {\n return pool(\n (size) => new Uint8Array(size),\n Uint8Array.prototype.subarray\n )(size);\n } else {\n return new Array(size);\n }\n }\n\n private _push(\n fn: (val: OpVal, buf: Uint8Array | number[], pos: number) => void,\n len: number,\n val: OpVal\n ) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n }\n\n finish(): Uint8Array {\n let head = this.head.next,\n pos = 0;\n const buf = BinaryWriter.alloc(this.len);\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n return buf as Uint8Array;\n }\n\n fork(): BinaryWriter {\n this.states = new State(this);\n this.head = this.tail = new Op(null, 0, 0);\n this.len = 0;\n return this;\n }\n\n reset(): BinaryWriter {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(null, 0, 0);\n this.len = 0;\n }\n return this;\n }\n\n ldelim(): BinaryWriter {\n const head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n }\n\n tag(fieldNo: number, type: WireType): BinaryWriter {\n return this.uint32(((fieldNo << 3) | type) >>> 0);\n }\n\n uint32(value: number): BinaryWriter {\n this.len += (this.tail = this.tail.next =\n new Op(\n writeVarint32,\n (value = value >>> 0) < 128\n ? 1\n : value < 16384\n ? 2\n : value < 2097152\n ? 3\n : value < 268435456\n ? 4\n : 5,\n value\n )).len;\n return this;\n }\n\n int32(value: number): BinaryWriter {\n return value < 0\n ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec\n : this.uint32(value);\n }\n\n sint32(value: number): BinaryWriter {\n return this.uint32(((value << 1) ^ (value >> 31)) >>> 0);\n }\n\n int64(value: string | number | bigint): BinaryWriter {\n const { lo, hi } = int64FromString(value.toString());\n return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });\n }\n\n // uint64 is the same with int64\n uint64 = BinaryWriter.prototype.int64;\n\n sint64(value: string | number | bigint): BinaryWriter {\n let { lo, hi } = int64FromString(value.toString());\n // zig zag\n [lo, hi] = zzEncode(lo, hi);\n return this._push(writeVarint64, int64Length(lo, hi), { lo, hi });\n }\n\n fixed64(value: string | number | bigint): BinaryWriter {\n const { lo, hi } = int64FromString(value.toString());\n return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi);\n }\n\n // sfixed64 is the same with fixed64\n sfixed64 = BinaryWriter.prototype.fixed64;\n\n bool(value: boolean): BinaryWriter {\n return this._push(writeByte, 1, value ? 1 : 0);\n }\n\n fixed32(value: number): BinaryWriter {\n return this._push(writeFixed32, 4, value >>> 0);\n }\n\n // sfixed32 is the same with fixed32\n sfixed32 = BinaryWriter.prototype.fixed32;\n\n float(value: number): BinaryWriter {\n throw new Error(\"float not supported\" + value);\n }\n\n double(value: number): BinaryWriter {\n throw new Error(\"double not supported\" + value);\n }\n\n bytes(value: Uint8Array): BinaryWriter {\n const len = value.length >>> 0;\n if (!len) return this._push(writeByte, 1, 0);\n return this.uint32(len)._push(writeBytes, len, value);\n }\n\n string(value: string): BinaryWriter {\n const len = utf8Length(value);\n return len\n ? this.uint32(len)._push(utf8Write, len, value)\n : this._push(writeByte, 1, 0);\n }\n}\n\nfunction writeBytes(\n val: Uint8Array | number[],\n buf: Uint8Array | number[],\n pos: number\n) {\n if (typeof Uint8Array !== \"undefined\") {\n (buf as Uint8Array).set(val, pos);\n } else {\n for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i];\n }\n}\n\nfunction pool(\n alloc: (size: number) => Uint8Array,\n slice: (begin?: number, end?: number) => Uint8Array,\n size?: number\n): (size: number) => Uint8Array {\n const SIZE = size || 8192;\n const MAX = SIZE >>> 1;\n let slab = null;\n let offset = SIZE;\n return function pool_alloc(size): Uint8Array {\n if (size < 1 || size > MAX) return alloc(size);\n if (offset + size > SIZE) {\n slab = alloc(SIZE);\n offset = 0;\n }\n const buf: Uint8Array = slice.call(slab, offset, (offset += size));\n if (offset & 7)\n // align to 32 bit\n offset = (offset | 7) + 1;\n return buf;\n };\n}\n\nfunction indexOutOfRange(reader: BinaryReader, writeLength?: number) {\n return RangeError(\n \"index out of range: \" +\n reader.pos +\n \" + \" +\n (writeLength || 1) +\n \" > \" +\n reader.len\n );\n}\n"; From 6ce29d8a4b393fa614bc3ed43ea742c342f88e72 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Thu, 29 Jun 2023 22:30:31 +0800 Subject: [PATCH 2/3] fix registry compile error fix amino any type compile error --- .../__snapshots__/stargate.spec.ts.snap | 4 +- packages/ast/src/clients/stargate/stargate.ts | 11 ++--- .../src/encoding/proto/from-amino/index.ts | 5 +++ .../src/encoding/proto/from-amino/utils.ts | 22 ++++++++++ .../ast/src/encoding/proto/to-amino/index.ts | 4 ++ .../ast/src/encoding/proto/to-amino/utils.ts | 44 ++++++++++++++++++- 6 files changed, 82 insertions(+), 8 deletions(-) diff --git a/packages/ast/src/clients/stargate/__snapshots__/stargate.spec.ts.snap b/packages/ast/src/clients/stargate/__snapshots__/stargate.spec.ts.snap index fb5aaccb0c..f551013b40 100644 --- a/packages/ast/src/clients/stargate/__snapshots__/stargate.spec.ts.snap +++ b/packages/ast/src/clients/stargate/__snapshots__/stargate.spec.ts.snap @@ -17,7 +17,7 @@ exports[`createStargateClient 1`] = ` defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; @@ -49,7 +49,7 @@ exports[`createStargateClient w/o defaults 1`] = ` aminoTypes } = getSigningOsmosisClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/packages/ast/src/clients/stargate/stargate.ts b/packages/ast/src/clients/stargate/stargate.ts index 7513cd0395..80d443f94a 100644 --- a/packages/ast/src/clients/stargate/stargate.ts +++ b/packages/ast/src/clients/stargate/stargate.ts @@ -176,9 +176,10 @@ export const createStargateClient = ({ name, options, context }: CreateStargateC t.objectExpression([ t.objectProperty( t.identifier('registry'), - t.identifier('registry'), - false, - true + t.tsAsExpression( + t.identifier('registry'), + t.tsAnyKeyword() + ) ), t.objectProperty( t.identifier('aminoTypes'), @@ -194,7 +195,7 @@ export const createStargateClient = ({ name, options, context }: CreateStargateC ] ), - // return + // return t.returnStatement(t.identifier('client')) ] ), @@ -399,7 +400,7 @@ export const createStargateClientOptions = ({ ), // NEW CODE - // return + // return t.returnStatement(t.objectExpression([ t.objectProperty( t.identifier('registry'), diff --git a/packages/ast/src/encoding/proto/from-amino/index.ts b/packages/ast/src/encoding/proto/from-amino/index.ts index 80740a0374..0ca7e43f0b 100644 --- a/packages/ast/src/encoding/proto/from-amino/index.ts +++ b/packages/ast/src/encoding/proto/from-amino/index.ts @@ -198,6 +198,11 @@ export const fromAminoJSONMethod = (context: ProtoParseContext, name: string, pr case 'google.protobuf.Timestamp': [].push.apply(body, fromAminoMessages.timestamp(context, name, proto)); break; + case 'google.protobuf.Any': + case 'Any': + [].push.apply(body, fromAminoMessages.anyType()); + break; + default: } } diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index c2a4d286ee..e99f14ad36 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -704,6 +704,28 @@ export const arrayTypes = { export const fromAminoMessages = { + anyType() { + return [ + t.returnStatement( + t.objectExpression([ + t.objectProperty( + t.identifier('typeUrl'), + t.memberExpression( + t.identifier('object'), + t.identifier('type') + ) + ), + t.objectProperty( + t.identifier('value'), + t.memberExpression( + t.identifier('object'), + t.identifier('value') + ) + ) + ]) + ) + ] + }, timestamp(context: ProtoParseContext, name: string, proto: ProtoType) { context.addUtil('fromJsonTimestamp'); diff --git a/packages/ast/src/encoding/proto/to-amino/index.ts b/packages/ast/src/encoding/proto/to-amino/index.ts index 646b627455..ad83fdfc4e 100644 --- a/packages/ast/src/encoding/proto/to-amino/index.ts +++ b/packages/ast/src/encoding/proto/to-amino/index.ts @@ -194,6 +194,10 @@ export const toAminoJSONMethod = (context: ProtoParseContext, name: string, prot case 'google.protobuf.Timestamp': body.push(toAminoMessages.timestamp(context, name, proto)); break; + case 'google.protobuf.Any': + case 'Any': + [].push.apply(body, toAminoMessages.anyType()) + break; default: } } diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 9864d3ac60..f46c18c4e7 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -1,6 +1,6 @@ import * as t from '@babel/types'; import { ProtoType } from '@osmonauts/types'; -import { BILLION, TypeLong } from '../../../utils'; +import { BILLION, TypeLong, identifier } from '../../../utils'; import { ProtoParseContext } from '../../context'; import { getFieldNames } from '../../types'; import { getInterfaceToAminoName } from '../implements'; @@ -661,6 +661,48 @@ export const arrayTypes = { export const toAminoMessages = { + anyType(){ + return [ + t.variableDeclaration( + 'const', + [ + t.variableDeclarator( + identifier('obj', t.tsTypeAnnotation(t.tsAnyKeyword())), + t.objectExpression([]) + ) + ] + ), + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.identifier('obj'), + t.identifier('type') + ), + t.memberExpression( + t.identifier('message'), + t.identifier('typeUrl') + ) + ) + ), + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.identifier('obj'), + t.identifier('value') + ), + t.memberExpression( + t.identifier('message'), + t.identifier('value') + ) + ) + ), + t.returnStatement( + t.identifier('obj') + ) + ] + }, timestamp(context: ProtoParseContext, name: string, proto: ProtoType) { context.addUtil('fromTimestamp'); From a1ad57fa5e8f3d75aa1fe98679921285d11fa10f Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Tue, 4 Jul 2023 14:19:19 +0800 Subject: [PATCH 3/3] fixed compilation errors and regen v-next --- __fixtures__/v-next/outputosmojs/akash/client.ts | 2 +- __fixtures__/v-next/outputosmojs/cosmos/client.ts | 2 +- __fixtures__/v-next/outputosmojs/cosmwasm/client.ts | 2 +- __fixtures__/v-next/outputosmojs/evmos/client.ts | 2 +- __fixtures__/v-next/outputosmojs/ibc/client.ts | 2 +- __fixtures__/v-next/outputosmojs/osmosis/client.ts | 2 +- __fixtures__/v-next/outputv2/akash/client.ts | 2 +- __fixtures__/v-next/outputv2/cosmos/client.ts | 2 +- __fixtures__/v-next/outputv2/cosmwasm/client.ts | 2 +- __fixtures__/v-next/outputv2/evmos/client.ts | 2 +- __fixtures__/v-next/outputv2/google/protobuf/any.ts | 4 ++-- __fixtures__/v-next/outputv2/ibc/client.ts | 2 +- __fixtures__/v-next/outputv2/osmosis/client.ts | 2 +- __fixtures__/v-next/outputv3/akash/client.ts | 2 +- __fixtures__/v-next/outputv3/cosmos/client.ts | 2 +- __fixtures__/v-next/outputv3/cosmwasm/client.ts | 2 +- __fixtures__/v-next/outputv3/evmos/client.ts | 2 +- __fixtures__/v-next/outputv3/google/protobuf/any.ts | 4 ++-- __fixtures__/v-next/outputv3/ibc/client.ts | 2 +- __fixtures__/v-next/outputv3/osmosis/client.ts | 2 +- __fixtures__/v-next/outputv4/akash/client.ts | 2 +- __fixtures__/v-next/outputv4/cosmos/client.ts | 2 +- __fixtures__/v-next/outputv4/cosmwasm/client.ts | 2 +- __fixtures__/v-next/outputv4/evmos/client.ts | 2 +- __fixtures__/v-next/outputv4/ibc/client.ts | 2 +- __fixtures__/v-next/outputv4/osmosis/client.ts | 2 +- packages/ast/types/src/encoding/proto/from-amino/utils.d.ts | 2 ++ packages/ast/types/src/encoding/proto/to-amino/utils.d.ts | 2 ++ 28 files changed, 32 insertions(+), 28 deletions(-) diff --git a/__fixtures__/v-next/outputosmojs/akash/client.ts b/__fixtures__/v-next/outputosmojs/akash/client.ts index adf09c7ab0..564870b96a 100644 --- a/__fixtures__/v-next/outputosmojs/akash/client.ts +++ b/__fixtures__/v-next/outputosmojs/akash/client.ts @@ -58,7 +58,7 @@ export const getSigningAkashClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputosmojs/cosmos/client.ts b/__fixtures__/v-next/outputosmojs/cosmos/client.ts index 79671b987a..d71646865f 100644 --- a/__fixtures__/v-next/outputosmojs/cosmos/client.ts +++ b/__fixtures__/v-next/outputosmojs/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputosmojs/cosmwasm/client.ts b/__fixtures__/v-next/outputosmojs/cosmwasm/client.ts index 3246535660..1b6196fc7f 100644 --- a/__fixtures__/v-next/outputosmojs/cosmwasm/client.ts +++ b/__fixtures__/v-next/outputosmojs/cosmwasm/client.ts @@ -40,7 +40,7 @@ export const getSigningCosmwasmClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputosmojs/evmos/client.ts b/__fixtures__/v-next/outputosmojs/evmos/client.ts index 726d048f44..6b935a4a1d 100644 --- a/__fixtures__/v-next/outputosmojs/evmos/client.ts +++ b/__fixtures__/v-next/outputosmojs/evmos/client.ts @@ -46,7 +46,7 @@ export const getSigningEvmosClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputosmojs/ibc/client.ts b/__fixtures__/v-next/outputosmojs/ibc/client.ts index b53402f231..5f3f23488b 100644 --- a/__fixtures__/v-next/outputosmojs/ibc/client.ts +++ b/__fixtures__/v-next/outputosmojs/ibc/client.ts @@ -55,7 +55,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputosmojs/osmosis/client.ts b/__fixtures__/v-next/outputosmojs/osmosis/client.ts index 74a6683af2..def190e062 100644 --- a/__fixtures__/v-next/outputosmojs/osmosis/client.ts +++ b/__fixtures__/v-next/outputosmojs/osmosis/client.ts @@ -70,7 +70,7 @@ export const getSigningOsmosisClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/akash/client.ts b/__fixtures__/v-next/outputv2/akash/client.ts index b852518546..8f6b9790f1 100644 --- a/__fixtures__/v-next/outputv2/akash/client.ts +++ b/__fixtures__/v-next/outputv2/akash/client.ts @@ -61,7 +61,7 @@ export const getSigningAkashClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/cosmos/client.ts b/__fixtures__/v-next/outputv2/cosmos/client.ts index 79671b987a..d71646865f 100644 --- a/__fixtures__/v-next/outputv2/cosmos/client.ts +++ b/__fixtures__/v-next/outputv2/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/cosmwasm/client.ts b/__fixtures__/v-next/outputv2/cosmwasm/client.ts index 3246535660..1b6196fc7f 100644 --- a/__fixtures__/v-next/outputv2/cosmwasm/client.ts +++ b/__fixtures__/v-next/outputv2/cosmwasm/client.ts @@ -40,7 +40,7 @@ export const getSigningCosmwasmClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/evmos/client.ts b/__fixtures__/v-next/outputv2/evmos/client.ts index 726d048f44..6b935a4a1d 100644 --- a/__fixtures__/v-next/outputv2/evmos/client.ts +++ b/__fixtures__/v-next/outputv2/evmos/client.ts @@ -46,7 +46,7 @@ export const getSigningEvmosClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/google/protobuf/any.ts b/__fixtures__/v-next/outputv2/google/protobuf/any.ts index 63406b76dd..8b4a7bae39 100644 --- a/__fixtures__/v-next/outputv2/google/protobuf/any.ts +++ b/__fixtures__/v-next/outputv2/google/protobuf/any.ts @@ -393,13 +393,13 @@ export const Any = { }, fromAmino(object: AnyAmino): Any { return { - typeUrl: object.type_url, + typeUrl: object.type, value: object.value }; }, toAmino(message: Any): AnyAmino { const obj: any = {}; - obj.type_url = message.typeUrl; + obj.type = message.typeUrl; obj.value = message.value; return obj; }, diff --git a/__fixtures__/v-next/outputv2/ibc/client.ts b/__fixtures__/v-next/outputv2/ibc/client.ts index 33dfa5aefc..1256ef06d1 100644 --- a/__fixtures__/v-next/outputv2/ibc/client.ts +++ b/__fixtures__/v-next/outputv2/ibc/client.ts @@ -49,7 +49,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv2/osmosis/client.ts b/__fixtures__/v-next/outputv2/osmosis/client.ts index 66cfe09aa7..48df1de1b5 100644 --- a/__fixtures__/v-next/outputv2/osmosis/client.ts +++ b/__fixtures__/v-next/outputv2/osmosis/client.ts @@ -58,7 +58,7 @@ export const getSigningOsmosisClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/akash/client.ts b/__fixtures__/v-next/outputv3/akash/client.ts index b852518546..8f6b9790f1 100644 --- a/__fixtures__/v-next/outputv3/akash/client.ts +++ b/__fixtures__/v-next/outputv3/akash/client.ts @@ -61,7 +61,7 @@ export const getSigningAkashClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/cosmos/client.ts b/__fixtures__/v-next/outputv3/cosmos/client.ts index 79671b987a..d71646865f 100644 --- a/__fixtures__/v-next/outputv3/cosmos/client.ts +++ b/__fixtures__/v-next/outputv3/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/cosmwasm/client.ts b/__fixtures__/v-next/outputv3/cosmwasm/client.ts index 3246535660..1b6196fc7f 100644 --- a/__fixtures__/v-next/outputv3/cosmwasm/client.ts +++ b/__fixtures__/v-next/outputv3/cosmwasm/client.ts @@ -40,7 +40,7 @@ export const getSigningCosmwasmClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/evmos/client.ts b/__fixtures__/v-next/outputv3/evmos/client.ts index 726d048f44..6b935a4a1d 100644 --- a/__fixtures__/v-next/outputv3/evmos/client.ts +++ b/__fixtures__/v-next/outputv3/evmos/client.ts @@ -46,7 +46,7 @@ export const getSigningEvmosClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/google/protobuf/any.ts b/__fixtures__/v-next/outputv3/google/protobuf/any.ts index 63406b76dd..8b4a7bae39 100644 --- a/__fixtures__/v-next/outputv3/google/protobuf/any.ts +++ b/__fixtures__/v-next/outputv3/google/protobuf/any.ts @@ -393,13 +393,13 @@ export const Any = { }, fromAmino(object: AnyAmino): Any { return { - typeUrl: object.type_url, + typeUrl: object.type, value: object.value }; }, toAmino(message: Any): AnyAmino { const obj: any = {}; - obj.type_url = message.typeUrl; + obj.type = message.typeUrl; obj.value = message.value; return obj; }, diff --git a/__fixtures__/v-next/outputv3/ibc/client.ts b/__fixtures__/v-next/outputv3/ibc/client.ts index 33dfa5aefc..1256ef06d1 100644 --- a/__fixtures__/v-next/outputv3/ibc/client.ts +++ b/__fixtures__/v-next/outputv3/ibc/client.ts @@ -49,7 +49,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv3/osmosis/client.ts b/__fixtures__/v-next/outputv3/osmosis/client.ts index 66cfe09aa7..48df1de1b5 100644 --- a/__fixtures__/v-next/outputv3/osmosis/client.ts +++ b/__fixtures__/v-next/outputv3/osmosis/client.ts @@ -58,7 +58,7 @@ export const getSigningOsmosisClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/akash/client.ts b/__fixtures__/v-next/outputv4/akash/client.ts index adf09c7ab0..564870b96a 100644 --- a/__fixtures__/v-next/outputv4/akash/client.ts +++ b/__fixtures__/v-next/outputv4/akash/client.ts @@ -58,7 +58,7 @@ export const getSigningAkashClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/cosmos/client.ts b/__fixtures__/v-next/outputv4/cosmos/client.ts index 79671b987a..d71646865f 100644 --- a/__fixtures__/v-next/outputv4/cosmos/client.ts +++ b/__fixtures__/v-next/outputv4/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/cosmwasm/client.ts b/__fixtures__/v-next/outputv4/cosmwasm/client.ts index 3246535660..1b6196fc7f 100644 --- a/__fixtures__/v-next/outputv4/cosmwasm/client.ts +++ b/__fixtures__/v-next/outputv4/cosmwasm/client.ts @@ -40,7 +40,7 @@ export const getSigningCosmwasmClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/evmos/client.ts b/__fixtures__/v-next/outputv4/evmos/client.ts index 726d048f44..6b935a4a1d 100644 --- a/__fixtures__/v-next/outputv4/evmos/client.ts +++ b/__fixtures__/v-next/outputv4/evmos/client.ts @@ -46,7 +46,7 @@ export const getSigningEvmosClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/ibc/client.ts b/__fixtures__/v-next/outputv4/ibc/client.ts index 33dfa5aefc..1256ef06d1 100644 --- a/__fixtures__/v-next/outputv4/ibc/client.ts +++ b/__fixtures__/v-next/outputv4/ibc/client.ts @@ -49,7 +49,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/__fixtures__/v-next/outputv4/osmosis/client.ts b/__fixtures__/v-next/outputv4/osmosis/client.ts index 66cfe09aa7..48df1de1b5 100644 --- a/__fixtures__/v-next/outputv4/osmosis/client.ts +++ b/__fixtures__/v-next/outputv4/osmosis/client.ts @@ -58,7 +58,7 @@ export const getSigningOsmosisClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry, + registry: (registry as any), aminoTypes }); return client; diff --git a/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts b/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts index 193ba37305..da9a95074a 100644 --- a/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts @@ -58,6 +58,8 @@ export declare const arrayTypes: { type(args: FromAminoJSONMethod): t.CallExpression; }; export declare const fromAminoMessages: { + anyType(): t.ReturnStatement[]; + timestamp(context: ProtoParseContext, name: string, proto: ProtoType): t.ReturnStatement[]; height(context: ProtoParseContext, name: string, proto: ProtoType): t.ReturnStatement[]; duration(context: ProtoParseContext, name: string, proto: ProtoType): (t.ReturnStatement | t.VariableDeclaration)[]; }; diff --git a/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts b/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts index 01cb831c25..19e3fb42c8 100644 --- a/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts @@ -58,5 +58,7 @@ export declare const arrayTypes: { type(args: ToAminoJSONMethod): t.ConditionalExpression; }; export declare const toAminoMessages: { + anyType(): (t.ExpressionStatement | t.ReturnStatement | t.VariableDeclaration)[]; + timestamp(context: ProtoParseContext, name: string, proto: ProtoType): t.ReturnStatement; duration(context: ProtoParseContext, name: string, proto: ProtoType): t.ReturnStatement; };