Skip to content

Commit

Permalink
v1.4.33
Browse files Browse the repository at this point in the history
  • Loading branch information
ppedziwiatr committed Jan 18, 2024
1 parent 0550773 commit 5801737
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "warp-contracts",
"version": "1.4.32",
"version": "1.4.33",
"description": "An implementation of the SmartWeave smart contract protocol.",
"types": "./lib/types/index.d.ts",
"main": "./lib/cjs/index.js",
Expand Down
7 changes: 5 additions & 2 deletions src/__tests__/integration/basic/contract-loading.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WarpGatewayContractDefinitionLoader } from '../../../core/modules/impl/
import { DefaultEvaluationOptions } from '../../../core/modules/StateEvaluator';
import { LexicographicalInteractionsSorter } from '../../../core/modules/impl/LexicographicalInteractionsSorter';
import { DeployPlugin } from 'warp-contracts-plugin-deploy';
import { CacheableContractDefinitionLoader } from "../../../core/modules/impl/CacheableContractDefinitionLoader";
import { CacheableContractDefinitionLoader } from '../../../core/modules/impl/CacheableContractDefinitionLoader';

interface ExampleContractState {
counter: number;
Expand Down Expand Up @@ -44,7 +44,10 @@ describe('Testing WarpGatewayContractDefinitionLoader', () => {

const { arweave } = warp;

loader = new CacheableContractDefinitionLoader(new WarpGatewayContractDefinitionLoader(arweave, 'local'), 'local', { ...defaultCacheOptions, inMemory: true });
loader = new CacheableContractDefinitionLoader(new WarpGatewayContractDefinitionLoader(arweave, 'local'), 'local', {
...defaultCacheOptions,
inMemory: true
});
loader.warp = warp;
sorter = new LexicographicalInteractionsSorter(arweave);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { ArweaveGatewayBundledContractDefinitionLoader } from '../../core/module
import { ArweaveGatewayBundledInteractionLoader } from '../../core/modules/impl/ArweaveGatewayBundledInteractionLoader';
import { SourceType, WarpGatewayInteractionsLoader } from '../../core/modules/impl/WarpGatewayInteractionsLoader';
import { EvaluationOptions } from '../../core/modules/StateEvaluator';
import { defaultCacheOptions, WarpFactory } from "../../core/WarpFactory";
import { defaultCacheOptions, WarpFactory } from '../../core/WarpFactory';
import { LoggerFactory } from '../../logging/LoggerFactory';
import { WarpGatewayContractDefinitionLoader } from '../../core/modules/impl/WarpGatewayContractDefinitionLoader';
import stringify from 'safe-stable-stringify';
import Arweave from 'arweave/node/common';
import { CacheableContractDefinitionLoader } from "../../core/modules/impl/CacheableContractDefinitionLoader";
import { CacheableContractDefinitionLoader } from '../../core/modules/impl/CacheableContractDefinitionLoader';

const EXAMPLE_CONTRACT_TX_ID = 'T8Fakv0Sol6ALQ4Mt6FTxEJVDJWT-HDUmcI3qIA49U4';
const EXAMPLE_CONTRACT_SRC_TX_ID = 'QEIweYIpdMSer_E33VreYzmuTIx33FQ4Sq32XJqlLQw';
Expand All @@ -32,7 +32,11 @@ describe('Arweave Gateway interaction loader', () => {
it('should load contract definition', async () => {
const warp = WarpFactory.forMainnet();

const wrLoader = new CacheableContractDefinitionLoader(new WarpGatewayContractDefinitionLoader(warp.arweave, 'local'), 'local', { ...defaultCacheOptions, inMemory: true })
const wrLoader = new CacheableContractDefinitionLoader(
new WarpGatewayContractDefinitionLoader(warp.arweave, 'local'),
'local',
{ ...defaultCacheOptions, inMemory: true }
);
wrLoader.warp = warp;

const arLoader = new ArweaveGatewayBundledContractDefinitionLoader(warp.environment);
Expand Down Expand Up @@ -86,7 +90,11 @@ describe('Arweave Gateway interaction loader', () => {
const arweave = Arweave.init({ host: 'arweave.net', port: 443, protocol: 'https' });

const arLoader = new ArweaveGatewayBundledInteractionLoader(arweave, 'mainnet');
const wrLoader = new CacheableContractDefinitionLoader(new WarpGatewayContractDefinitionLoader(arweave, 'local'), 'local', { ...defaultCacheOptions, inMemory: true });
const wrLoader = new CacheableContractDefinitionLoader(
new WarpGatewayContractDefinitionLoader(arweave, 'local'),
'local',
{ ...defaultCacheOptions, inMemory: true }
);
const withArLoader = WarpFactory.custom(arweave, { inMemory: true, dbLocation: '' }, 'mainnet')
.setInteractionsLoader(arLoader)
.setDefinitionLoader(wrLoader)
Expand Down

0 comments on commit 5801737

Please sign in to comment.