Skip to content

Commit

Permalink
feat(loader): set blockHeight in handler, based on current message #1055
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Oct 23, 2024
1 parent 3a57459 commit f7dd714
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions loader/src/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ module.exports = async function (binary, options) {


return async (buffer, msg, env) => {
/**
* instance is the Module
* abstraction for the WebAssembly environnment
*
* This is where things like module options, extensions
* and other metadata are exposed to things like WeaveDrive.
*
* So by setting blockHeight on the instance to the current
* msg's blockHeight, it can be made available to WeaveDrive
* for admissable checks
*/
instance.blockHeight = msg['Block-Height']

const originalRandom = Math.random
// const OriginalDate = Date
Expand Down

0 comments on commit f7dd714

Please sign in to comment.