Skip to content

Commit

Permalink
test: fix bridge MsgUndelegateResponseSDKType
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 31, 2024
1 parent ff5b2f4 commit 6e432e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions packages/orchestration/src/exos/local-chain-account-kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,17 @@ export const prepareLocalChainAccountKit = (
const delegatorAddress = await E(lca).getAddress();
trace('delegatorAddress', delegatorAddress);
const [response] = await E(lca).executeTx([
typedJson('/cosmos.staking.v1beta1.MsgUndelegate', {
typedJson('/cosmos.staking.v1beta1.MsgUndelegateSDKType', {
amount,
validatorAddress,
delegatorAddress,
validator_address: validatorAddress,
delegator_address: delegatorAddress,
}),
]);
trace('undelegate response', response);
const { completionTime } = response;

await E(timerService).wakeAt(
// TODO clean up date handling once we have real data
dateInSeconds(new Date(completionTime)) + maxClockSkew,
dateInSeconds(new Date(response.completion_time)) + maxClockSkew,
);
},
/**
Expand Down
13 changes: 6 additions & 7 deletions packages/vats/tools/fake-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Nat } from '@endo/nat';

/**
* @import {JsonSafe} from '@agoric/cosmic-proto';
* @import {MsgDelegateResponse, MsgUndelegateResponse} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
* @import {MsgDelegateResponse, MsgDelegateResponseSDKType, MsgUndelegateResponse, MsgUndelegateResponseSDKType} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
* @import {BridgeHandler, ScopedBridgeManager} from '../src/types.js';
* @import {Remote} from '@agoric/vow';
*/
Expand Down Expand Up @@ -189,13 +189,12 @@ export const makeFakeLocalchainBridge = (zone, onToBridge = () => {}) => {
sequence: lcaExecuteTxSequence,
};
}
case '/cosmos.staking.v1beta1.MsgDelegate': {
return /** @type {JsonSafe<MsgDelegateResponse>} */ ({});
case '/cosmos.staking.v1beta1.MsgDelegateSDKType': {
return /** @type {JsonSafe<MsgDelegateResponseSDKType>} */ ({});
}
case '/cosmos.staking.v1beta1.MsgUndelegate': {
// @ts-expect-error XXX JsonSafe doesn't handle Date
return /** @type {JsonSafe<MsgUndelegateResponse>} */ ({
completionTime: new Date().toJSON(),
case '/cosmos.staking.v1beta1.MsgUndelegateSDKType': {
return /** @type {JsonSafe<MsgUndelegateResponseSDKType>} */ ({
completion_time: new Date().toJSON(),
});
}
// returns one empty object per message unless specified
Expand Down

0 comments on commit 6e432e4

Please sign in to comment.