* generate types from registry * cleanup * merge, rearrange * lint * built out * abi v2 creation * throw on unions * linting * version handling * split functions * cleanup * drop v1 support * special types * changes * requested changes * formatTYpe * rv outdated test * rv union test * codeclimate * codeclimate * codeclimate * codeclimate * codeclimate * review * cleanup encodeTypes * fix option sub * TypeDefInfo.Result
24 lines
645 B
TypeScript
24 lines
645 B
TypeScript
// Copyright 2017-2019 @polkadot/api-contract authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import erc20Abi from '../test/contracts/Erc20.json';
|
|
|
|
import { Abi } from '.';
|
|
|
|
describe('Abi', (): void => {
|
|
describe('erc20', (): void => {
|
|
let abi: Abi;
|
|
|
|
beforeEach((): void => {
|
|
abi = new Abi(erc20Abi);
|
|
});
|
|
|
|
it('has the attached methods', (): void => {
|
|
expect(Object.keys(abi.messages)).toEqual(
|
|
['totalSupply', 'balanceOf', 'allowance', 'transfer', 'approve', 'transferFrom']
|
|
);
|
|
});
|
|
});
|
|
});
|