Skip to content

Commit

Permalink
v1.4.21-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ppedziwiatr committed Oct 19, 2023
1 parent d6d68ac commit f021d58
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 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.20",
"version": "1.4.21-beta.0",
"description": "An implementation of the SmartWeave smart contract protocol.",
"types": "./lib/types/index.d.ts",
"main": "./lib/cjs/index.js",
Expand Down
8 changes: 2 additions & 6 deletions src/__tests__/integration/basic/pst.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LoggerFactory } from '../../../logging/LoggerFactory';
import { DeployPlugin } from 'warp-contracts-plugin-deploy';
import { VM2Plugin } from 'warp-contracts-plugin-vm2';
import { InteractionCompleteEvent } from '../../../core/modules/StateEvaluator';
import { NetworkCommunicationError } from "../../../utils/utils";
import { NetworkCommunicationError } from '../../../utils/utils';

describe('Testing the Profit Sharing Token', () => {
let contractSrc: string;
Expand Down Expand Up @@ -151,9 +151,7 @@ describe('Testing the Profit Sharing Token', () => {
}
});


it('should allow to safe fetch from external api', async () => {

const blockData = await arweave.blocks.getCurrent();

await pst.writeInteraction({
Expand All @@ -165,12 +163,10 @@ describe('Testing the Profit Sharing Token', () => {

const result = await pst.readState();

expect((result.cachedValue.state as any).blocks["" + blockData.height]).toEqual(blockData.indep_hash);

expect((result.cachedValue.state as any).blocks['' + blockData.height]).toEqual(blockData.indep_hash);
});

it('should stop evaluation on safe fetch error', async () => {

const blockData = await arweave.blocks.getCurrent();

await pst.writeInteraction({
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/smartweave-global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GQLNodeInterface, GQLTagInterface, VrfData } from './gqlResult';
import { CacheKey, SortKeyCache } from '../cache/SortKeyCache';
import { SortKeyCacheRangeOptions } from '../cache/SortKeyCacheRangeOptions';
import { InteractionState } from '../contract/states/InteractionState';
import { safeGet } from "../utils/utils";
import { safeGet } from '../utils/utils';

/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ export async function getJsonResponse<T>(response: Promise<Response>): Promise<T

export async function safeGet<T>(input: RequestInfo | URL, init?: RequestInit): Promise<T> {
return getJsonResponse(fetch(input, init));
}
}

0 comments on commit f021d58

Please sign in to comment.