Skip to content

Commit

Permalink
v1.4.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeuchi committed Oct 18, 2023
1 parent f271ffa commit 249e370
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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",
"description": "An implementation of the SmartWeave smart contract protocol.",
"types": "./lib/types/index.d.ts",
"main": "./lib/cjs/index.js",
Expand Down
24 changes: 13 additions & 11 deletions src/__tests__/integration/basic/pst-kv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,27 @@ describe('Testing the Profit Sharing Token', () => {

it('should properly store false and falsy values in kv', async () => {
const falsyEntries = {
'false': false,
'emptyString': '',
'zero': 0,
'emptyArray': [],
'nan': NaN,
'null': null,
'undefined': undefined,
} as const;
false: false,
emptyString: '',
zero: 0,
emptyArray: [],
nan: NaN,
null: null,
undefined: undefined
} as const;

await pst.writeInteraction({
function: 'kvPut',
kvPut: falsyEntries
});
await mineBlock(warp);

const { kvGet } =
(await pst.viewState<unknown, { kvGet: typeof falsyEntries }>({
const { kvGet } = (
await pst.viewState<unknown, { kvGet: typeof falsyEntries }>({
function: 'kvGet',
kvGet: Object.keys(falsyEntries) })).result;
kvGet: Object.keys(falsyEntries)
})
).result;

expect(kvGet.emptyArray).toEqual([]);
expect(kvGet.emptyString).toEqual('');
Expand Down

0 comments on commit 249e370

Please sign in to comment.