Skip to content

Conversation

@pr0n00gler
Copy link
Collaborator

This PR pulls recent changes in the tokenfactory module from the Osmosis upstream and more specifically:

  • it adds gas metering to BlockBeforeSend call;
  • small refactoring due to constant renamings;

Task: https://hadronlabs.atlassian.net/jira/software/projects/NTRN/boards/3?selectedIssue=NTRN-518

@pr0n00gler
Copy link
Collaborator Author

// consume gas used for calling contract to the parent ctx
c.GasMeter().ConsumeGas(childCtx.GasMeter().GasConsumed(), "track before send gas")
childCtx := c.WithGasMeter(storetypes.NewGasMeter(types.BeforeSendHookGasLimit))
_, err = k.contractKeeper.Sudo(childCtx.WithEventManager(em), cwAddr, msgBz)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. In the line above, you're creating a new context with a gas manager, and then again, line later, a new context with an event manager - maybe it's better to combine both With calls into a single statement?

  2. What is the reason for creating a new event manager? We're essentially ignoring all events from sudo calls.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, fixed that

@pr0n00gler
Copy link
Collaborator Author

pr0n00gler commented Jun 3, 2025

@swelf19 swelf19 mentioned this pull request Jan 21, 2026
@pr0n00gler pr0n00gler closed this Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants