Skip to content

Commit

Permalink
Merge pull request #7543 from Agoric/mfig-cli-run-no-solo
Browse files Browse the repository at this point in the history
Enable `agoric run init-core.js` to work without a solo VM connection
  • Loading branch information
mergify[bot] authored May 1, 2023
2 parents ef650ca + 73fef25 commit ab38bde
Show file tree
Hide file tree
Showing 17 changed files with 646 additions and 464 deletions.
4 changes: 3 additions & 1 deletion golang/cosmos/ante/vm_admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ func (ad AdmissionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate boo
for _, msg := range tx.GetMsgs() {
if camsg, ok := msg.(vm.ControllerAdmissionMsg); ok {
if err := camsg.CheckAdmissibility(ctx, ad.data); err != nil {
errors = append(errors, err)
// Only let admission errors interrupt the transaction if we're not
// simulating, otherwise our gas estimation will be too low.
if !simulate {
errors = append(errors, err)
defer func(msg sdk.Msg) {
telemetry.IncrCounterWithLabels(
[]string{"tx", "ante", "admission_refused"},
Expand Down
7 changes: 7 additions & 0 deletions packages/access-token/src/access-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export function generateAccessToken({
);
}

/**
* @param {string|number} port
* @returns {Promise<string>}
*/
export async function getAccessToken(port) {
if (typeof port === 'string') {
const match = port.match(/^(.*:)?(\d+)$/);
Expand All @@ -47,5 +51,8 @@ export async function getAccessToken(port) {
}
const accessToken = storage.get(accessTokenKey);
await close();
if (typeof accessToken !== 'string') {
throw Error(`Could not find access token for ${port}`);
}
return accessToken;
}
Loading

0 comments on commit ab38bde

Please sign in to comment.