Skip to content

Commit

Permalink
chore(types): accomodate new Telescope
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 16, 2024
1 parent cbad08d commit c1c5a6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/cosmic-proto/test/helpers.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ import type { Timestamp } from '../src/codegen/google/protobuf/timestamp.js';
null as any;
expectType<Timestamp>(response.completionTime);
const responseJson: JsonSafe<typeof response> = null as any;
// FIXME: should be a string. UNTIL: github.com/cosmology-tech/telescope/pull/632
expectType<bigint>(responseJson.completionTime.seconds);
expectType<string>(responseJson.completionTime.seconds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ export const prepareLocalOrchestrationAccountKit = (
*/
queryBalancesWatcher: {
/**
* @param {ResponseTo<
* TypedJson<'/cosmos.bank.v1beta1.QueryAllBalancesRequest'>
* @param {JsonSafe<
* ResponseTo<
* TypedJson<'/cosmos.bank.v1beta1.QueryAllBalancesRequest'>
* >
* >} result
* @returns {DenomAmount[]}
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/orchestration/src/typeGuards.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ export const chainFacadeMethods = harden({
/**
* for google/protobuf/timestamp.proto, not to be confused with TimestampShape
* from `@agoric/time`
*
* `seconds` is a big integer but since it goes through JSON it is encoded as
* string
*/
export const TimestampProtoShape = { seconds: M.nat(), nanos: M.number() };
export const TimestampProtoShape = { seconds: M.string(), nanos: M.number() };

/**
* see {@link TxBody} for more details
Expand Down
2 changes: 1 addition & 1 deletion packages/vats/tools/fake-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const fakeLocalChainBridgeTxMsgHandler = (message, sequence) => {
case '/cosmos.staking.v1beta1.MsgUndelegate': {
return /** @type {JsonSafe<MsgUndelegateResponse>} */ ({
// 5 seconds from unix epoch
completionTime: { seconds: 5n, nanos: 0 },
completionTime: { seconds: '5', nanos: 0 },
});
}
// returns one empty object per message unless specified
Expand Down

0 comments on commit c1c5a6f

Please sign in to comment.