Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/humanize acc #196

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions packages/access-control-conditions/src/lib/humanizer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Object.defineProperty(global.self, 'crypto', {
});

import * as humanizer from './humanizer';
import { humanizeAccessControlConditions } from './humanizer';
import {
AccsCOSMOSParams,
AccsEVMParams,
Expand Down Expand Up @@ -298,4 +299,26 @@ describe('humanizer.ts', () => {
'Owns at least 0.00001 ETH or balanceOf(:userAddress, 8) on contract address 0x7C7757a9675f06F3BE4618bB68732c4aB25D2e88 should have a result of more than 0'
);
});

it('should humanize acc', async () => {
const result = await humanizeAccessControlConditions({
unifiedAccessControlConditions: [
{
chain: 'goerli',
method: 'balanceOf',
parameters: [':userAddress'],
conditionType: 'evmBasic',
contractAddress: '0x5b8B8C9aD976aFCAd24fd6CF424294d372c190Ac',
returnValueTest: {
value: '100000000000000000000',
comparator: '>='
},
standardContractType: 'ERC20'
}
]
});
expect(result).toContain("0x5b8B8C9aD976aFCAd24fd6CF424294d372c190Ac");
expect(result).toContain("100.0");
expect(result).toContain("at least");
});
});
4 changes: 2 additions & 2 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export * from './lib/errors';
export * from './lib/utils/utils';

// ----------- ABIs -----------
const ABI_LIT = import('./lib/abis/LIT.json');
const ABI_ERC20 = import('./lib/abis/ERC20.json');
import * as ABI_LIT from './lib/abis/LIT.json';
import * as ABI_ERC20 from './lib/abis/ERC20.json';

export { ABI_LIT, ABI_ERC20 };
Loading