Expand types & tests (#166)

* RegEx for alias

* Expand tests

* Cleanup naming

* Options & Struct tests

* Cleanup Length with tests

* Enum tests

* TODO... expand/question assumption

* Remove extra line

* Hashin tests (commented, encoding change)

* Export Type on Vector & Struct

* Test Type & Base

* Address FIXME & additional test

* Cleanup TODOs

* Add MisbehaviorReport

* Add index.ts combinators

* typo in export

* Comment typo

* Update index.ts

* Update MisbehaviorReport.ts

* Update MisbehaviorReport.spec.js

* Extract Bft, add SignedBlock (allow anonymous structures)

* <foo>Struct -> <foo>Value (for constructor args)

* AnyNumber/U8a types for inputs (PR comment)

* Comment struct generics

* Typo in comment

* Simplify StorageFunctionType construction

* Fix liniting (wtf?)

* Fix linting & tests, make more robust
This commit is contained in:
Jaco Greeff
2018-09-26 14:33:12 +02:00
committed by GitHub
parent 7eb2b29201
commit dfd2e70931
51 changed files with 988 additions and 147 deletions
+49
View File
@@ -0,0 +1,49 @@
// Copyright 2017-2018 @polkadot/api-codec authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// NOTE We are not re-exporting the index.ts from codec here. The reasoning being
// that these should be enough to actually _use_ the codec, i.e. from a api-user
// perspective these are the value classes. (Codec is for the cases where you need
// to construct values dynamically)
export { default as AccountId } from './AccountId';
export { default as AccountIndex } from './AccountIndex';
export { default as Address } from './Address';
export { default as AuthorityId } from './AuthorityId';
export { default as Balance } from './Balance';
// NOTE Bft items are only used in internal structures
// export * from './Bft;
export { default as Block } from './Block';
export { default as BlockNumber } from './BlockNumber';
export { default as Bool } from './Bool';
export { default as Bytes } from './Bytes';
export { default as Extrinsic } from './Extrinsic';
// NOTE These are currently only used internally, no direct mapping to Rust strings
// export { default as H256 } from './H256';
// export { default as H512 } from './H512';
export { default as Hash } from './Hash';
export { default as Header } from './Header';
export { default as KeyValue } from './KeyValue';
export { default as Metadata } from './Metadata';
export { default as MisbehaviorReport } from './MisbehaviorReport';
// NOTE Nonce is renamed to Index
export { default as Index } from './Nonce';
export { default as PropIndex } from './PropIndex';
export { default as ProposalIndex } from './ProposalIndex';
export { default as RawAddress } from './RawAddress';
export { default as ReferendumIndex } from './ReferendumIndex';
export { default as Signature } from './Signature';
export { default as SignedBlock } from './SignedBlock';
// NOTE Text is currently only used internally, export not needed
// export { default as Text } from './Text';
// NOTE Type is currently only used internally (possibly in codec-related work)
// export { default as Type } from './Type';
export { default as U8 } from './U8';
export { default as U16 } from './U16';
export { default as U32 } from './U32';
export { default as U64 } from './U64';
export { default as U128 } from './U128';
export { default as U256 } from './U256';
export { default as ValidatorPrefx } from './ValidatorPrefs';
export { default as UoteIndex } from './VoteIndex';