diff --git a/demos/taco-demo/webpack.config.js b/demos/taco-demo/webpack.config.js index 60d709f95..11c98381e 100644 --- a/demos/taco-demo/webpack.config.js +++ b/demos/taco-demo/webpack.config.js @@ -11,7 +11,7 @@ module.exports = { entry: './src', devtool: isDevelopment ? 'eval-source-map' : 'source-map', plugins: [ - // isDevelopment && new ReactRefreshWebpackPlugin(), // TODO: Investigate why ConditionContext can't be loaded here + isDevelopment && new ReactRefreshWebpackPlugin(), new HtmlWebpackPlugin({ template: './src/index.html', }), diff --git a/demos/taco-nft-demo/webpack.config.js b/demos/taco-nft-demo/webpack.config.js index 60d709f95..11c98381e 100644 --- a/demos/taco-nft-demo/webpack.config.js +++ b/demos/taco-nft-demo/webpack.config.js @@ -11,7 +11,7 @@ module.exports = { entry: './src', devtool: isDevelopment ? 'eval-source-map' : 'source-map', plugins: [ - // isDevelopment && new ReactRefreshWebpackPlugin(), // TODO: Investigate why ConditionContext can't be loaded here + isDevelopment && new ReactRefreshWebpackPlugin(), new HtmlWebpackPlugin({ template: './src/index.html', }), diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 0d624c7b7..e9595823d 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -78,6 +78,7 @@ const decryptFromBytes = async (encryptedBytes: Uint8Array) => { "\nConsumer signer's address:", await consumerSigner.getAddress(), ); + const messageKit = ThresholdMessageKit.fromBytes(encryptedBytes); console.log('Decrypting message ...'); return decrypt( diff --git a/packages/taco/src/conditions/base/shared.ts b/packages/taco/src/conditions/base/shared.ts index 8da43d203..325abda27 100644 --- a/packages/taco/src/conditions/base/shared.ts +++ b/packages/taco/src/conditions/base/shared.ts @@ -1,11 +1,11 @@ import { z } from 'zod'; import { + CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, ETH_ADDRESS_REGEXP, USER_ADDRESS_PARAM, } from '../const'; -import { CONTEXT_PARAM_PREFIX } from '../context/context'; export const contextParamSchema = z.string().regex(CONTEXT_PARAM_REGEXP); // We want to discriminate between ContextParams and plain strings diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 971c0839b..c7f80d5f0 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -7,6 +7,8 @@ export const ETH_ADDRESS_REGEXP = new RegExp('^0x[a-fA-F0-9]{40}$'); // Only allow alphanumeric characters and underscores export const CONTEXT_PARAM_REGEXP = new RegExp('^:[a-zA-Z_][a-zA-Z0-9_]*$'); +export const CONTEXT_PARAM_PREFIX = ':'; + export const SUPPORTED_CHAIN_IDS = [ ChainId.POLYGON, ChainId.MUMBAI, diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index 312fa085c..7b528f70e 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -5,7 +5,11 @@ import { ethers } from 'ethers'; import { CompoundConditionType } from '../compound-condition'; import { Condition, ConditionProps } from '../condition'; import { ConditionExpression } from '../condition-expr'; -import { CONTEXT_PARAM_REGEXP, USER_ADDRESS_PARAM } from '../const'; +import { + CONTEXT_PARAM_PREFIX, + CONTEXT_PARAM_REGEXP, + USER_ADDRESS_PARAM, +} from '../const'; import { TypedSignature, WalletAuthenticationProvider } from './providers'; @@ -13,7 +17,6 @@ export type CustomContextParam = string | number | boolean; export type ContextParam = CustomContextParam | TypedSignature; export const RESERVED_CONTEXT_PARAMS = [USER_ADDRESS_PARAM]; -export const CONTEXT_PARAM_PREFIX = ':'; const ERR_RESERVED_PARAM = (key: string) => `Cannot use reserved parameter name ${key} as custom parameter`;