Commit Graph
281 Commits
Author SHA1 Message Date
Jaco Greeff 35a59ec469 Basic IKeyringInterface (address encoding/decoding still used) (#968) 2019-06-04 12:26:53 +02:00
Jaco Greeff 447b7c447d Construct toRawType using internal types (#966)
* Construct toRawType using internal types

* typo

* Struct test for with + toRawType

* Tuple tests for toRawType

* Remove extra empty check, already handled

* EnumType with sane toRawType

* Sane toRawType representation for Set

* Use JSON.stringify inside Struct toRawType

* Extrinsic toRawType yields Extrinsic (like a primitive)

* Block toRawType test
2019-06-04 11:45:56 +02:00
Jaco Greeff b37eb31b60 Add SignaturePayloadRaw (#967) 2019-06-04 11:23:41 +02:00
Jaco Greeff 543fdc034f Update for latest substrate master metadata (#958)
* Update for latest substrate master metadata

* Add ContractStorageKey type

* Update schedule
2019-05-29 17:23:06 +02:00
Alex Wang a7f16064a9 update signature of doublemap storage function, add e2e test cases (#957)
* update signature of doublemap storage function

* add test cases

* update doublemap implementation

* update implementation

* remove duplicate test case

* update test cases
2019-05-29 16:14:42 +02:00
Stefanie DollandAmaury Martiny c01ade86a6 Convert tests to ts and fix existing (#936)
* Add jest watch option to package.json

* convert promise-alex-spec to ts & add types

* convert ./api tests from JS to TS

* convert ./api tests from JS to TS pt. 2

* More convert tests from JS to TS

* rpc-provider convert tests from js to ts

* rpc-provider tests js => ts

* rpc-provider tests js => ts

* linting issues

* tslint fixes

* 101 => 68 typescript errors

* WIP

* connect() e2e tests

* more fixes

* Fix linting errors of new ERA tests after merge

* test for listeners in connect

* formatting

* getting there...

* re-add skips

* test refactoring & codeclimate fixes

* more fixed tests

* mock.body workaround

* Fixed wrong test description

* ApiPromiseInterface => Api

* ws polyfill / send

* bring back isZero() test

* .then().catch() => .catch()

* Removed leftover body

* Type ProviderInterface => Http

* Fixed polyfill tests

* trailing whitespce

* (mock.body as any)['test_body'] and Balance

* Fix autoconnect in WsProvider

* Fixed part of linting errors in ERA tests

* call unused const unsubscribe

* added ts-ignores for testing private properties/ methods of Provider

* Archive node test

* Fixed linting for ERA tests

* Further changes

* Update packages/rpc-provider/src/ws/polyfill.spec.ts

Co-Authored-By: Amaury Martiny <amaury.martiny@protonmail.com>

* relative paths for imports inside module & reordering of imports pt. 1

* relative paths for imports inside module & reordering of imports pt. 2

* added skip back to e2e transactions

* Fix some more tests in TS (#952)

* Fix some more tests in ts

* Add more constructor

* More typing in ./api

* .skip

* <SubmittableResult>'s

* .catch() -> return()

* Extrinsics tests

* Left TODO's for extrinsic e2e tests

* Workaround for failing Type Extrinsic tests
2019-05-27 17:08:06 +02:00
Jaco Greeff acaca67385 derive.{balances, contracts, staking, session} returns Codec (#953)
* derive.{balances, contracts, staking, session} returns Codec

* Json -> StructAny (as per VectorAny)

* multi returns VectorAny

* VectorAny casts

* Bump common
2019-05-27 12:49:19 +02:00
Jaco Greeff 054cf1f51e Fix ContractAbi assert name (#951) 2019-05-24 10:01:46 +02:00
KarishmaBothara 0f3a745ed8 ERA changes (#927) 2019-05-23 09:10:34 +02:00
Jaco Greeff 96133d22b8 Align IExtrinsic with Extrinsic impl. (signer/signature string) (#946) 2019-05-23 09:05:25 +02:00
Alex Wang 833b49d012 support double map storage function (#934)
* support double map storage function

* add twox_64_concat, clean comments

* change Twox128Concat to Twox64Concat

* update decodeStorageKey

* fix: update decodeStorageKey

* test: add e2e test
2019-05-21 10:25:58 +02:00
Jaco Greeff 767891dca0 ExtrinsicSignature init with address/signature strings (#935) 2019-05-20 14:09:29 +02:00
Jaco Greeff 9f258ff4c7 Allow Moment with BE/LE hex encoding (#933)
* Allow Moment with BE/LE hex encoding

* description clarification
2019-05-17 17:13:11 +02:00
Jaco Greeff 1e8e0b2974 Polkadot master specVersion bump (#932)
* Polkadot master specVersion bump

* EventRecord_0_76
2019-05-17 16:37:22 +02:00
Jaco GreeffandAmaury Martiny f8f05ba21e Show section.method on storage read error (#928)
* Show section.method on storage read error

* Update packages/types/src/primitive/StorageKey.ts

Co-Authored-By: Amaury Martiny <amaury.martiny@protonmail.com>

* Update StorageKey.ts
2019-05-17 14:39:17 +02:00
Jaco Greeff 03234a0cc9 Codec Fallback on createType (along with pedantic) (#929)
* Codec Fallback on createType (along with pedantic)

* Updates for numbers (fix failing tests)

* Add isPedantic to linked
2019-05-17 14:07:51 +02:00
Jaco Greeff 36d7a85ed2 Move HeaderExtended type to api-derive (#923)
* Move HeaderExtended type to api-derive

* Really remove HeaderExt from Header this time around
2019-05-17 11:44:14 +02:00
Jaco Greeff b701bdf763 Set assert fix (with tests) (#925)
* Set assert fix (with tests)

* toNumber() -> function
2019-05-16 15:34:59 +02:00
Stefanie Doll 70716d61c9 Extrinsic bug with undefined value (#914)
* Extrinsic contructor to fix

* Switch from Unit8Array to U8a

* new line

* Move Unit8Array to end of decode function

* move unit8array up as default

* only create empty Unit8Array for undefined values

* default value for string

* remove empty ExtrinsicValue in decode function call

* Throw error instead of console.error

* Travis
2019-05-16 15:11:22 +02:00
Jaco Greeff 8c70cbf0f1 Add Codec toRawType (#921)
* Add Codec toType

* Revert i* & u* (toType, catered for in base)

* toType -> toRawType
2019-05-16 14:14:18 +02:00
Jaco Greeff 42fe4e1739 Combine Enum & EnumType (#922)
* Extend EnumType with basic (convert use)

* Remove Enum, adjust EnumType tests with Enum version

* Remove aliasses

* test json finaised -> finalized
2019-05-16 13:52:00 +02:00
Amaury Martiny 2b538f5f58 refactor: Metadata overhaul (#913)
* Replace part1

* Replace part2

* Replace part3

* Replace part5

* Replace part6

* Fix small bugs

* Fix double map toString

* Small fixes

* Update to v4

* Fix docs script

* Grumbles

* Alphabetical

* Reads better

* comment

* module to modul
2019-05-16 12:57:51 +02:00
Jaco Greeff 5a857a33c8 codec/Set extends JS Set (#917) 2019-05-16 11:54:26 +02:00
Jaco Greeff 2dfc55cb5c Update api.derive to use api.queryMulti (#911)
* session api.queryMulti

* Make a single subscription to retrieve all session info

* Adjustments

* WIP

* Seems mostly comprehensive, need to full test e2e

* e2e tests for operations

* Allow "create from empty"

* skip

* Remove comment

* Remove ancient ?'s

* Update types.ts
2019-05-16 11:36:41 +02:00
Jaco Greeff bafda6dc93 Remove struct map naming overrides (#918) 2019-05-16 11:18:49 +02:00
Jaco Greeff 86a8011c65 Move additional types to primitive & rpc (#916) 2019-05-16 11:11:32 +02:00
Jaco Greeff 2509309326 Update Extrinsic Signature description (#905)
* Update Extrinsic Signature description

* Update ExtrinsicSignature.ts
2019-05-15 16:04:53 +02:00
Jaco Greeff 7b04ea0bfe new EventRecord with topics (#902)
* new EventRecord with topics

* Add additional decoding checks (from #612)

* Slightly rework storage parsing (future checks)

* Split storage result formatting (set vs data)

* Allow v3 event parsing

* Max Vector length check

* assert during Event parsing

* Well, HACK-y fallback

* Revert "Well, HACK-y fallback"

This reverts commit edbf61b99da2753bec3a535126660e71bdcd9861.

* Node overrides...

* Add implVersion

* Register types

* Update with polkadot as well

* inject compatibility types

* EventRecord77 in testing

* Conversion with DoubleMap

* E2E tested against v3 & v4

* Filter with some

* Split archive/remove alex tests

* beforeAll -> beforeEach

* Remove .only

* EventRecordV0 -> 77
2019-05-15 08:07:23 +02:00
Jaco Greeff 57715c50c0 Revert "Update extrinsics FromMetadata. Drop storages with doublemap type when converting v3 to v2 (#888)" (#903)
This reverts commit 97032e7e86.
2019-05-14 16:21:32 +02:00
satellitex 06a5dc61a2 Add traits replace rules. for invalid cases ::<type> and <type>::. (#885)
* add replace rules

* fix replace grep
2019-05-14 12:21:08 +02:00
Jaco Greeff 27934f7bd9 Metadata update for latest master (#901)
* Latest metadata, add EventIndex type

* Add parsed metadata

* Create empty DoubleMap type
2019-05-14 12:15:34 +02:00
Xiliang Chen 46fee3125d Start supporting double map (#843)
* double map fix

* update metadata to prevent error using double map
2019-05-13 11:53:46 +02:00
Alex Wang 97032e7e86 Update extrinsics FromMetadata. Drop storages with doublemap type when converting v3 to v2 (#888)
* update extrinsics fromMetadata

* drop storages with doublemap when convert v3 to v2

* update Event.injectMetadata
2019-05-13 10:49:29 +02:00
Amaury Martiny 865e480a1e Linked map in v0 (#886) 2019-05-08 17:10:16 +02:00
Jaco Greeff 3e755b926b Fix bug in metadata conversion (return converted) (#880)
* Fix bug in metadata conversion (return converted)

* v2 -> v3
2019-05-07 16:48:35 +02:00
Jaco Greeff 28399544cb assert type on all asXxx getters (#879)
* assert type on all asXxx getters

* Convert via built-in asVx

* Implicit index

* Re-add V0 (not dropped here, but dropped somewhere)

* MetadataDeprectated -> MetadataDeprecated
2019-05-07 16:01:35 +02:00
Amaury Martiny 6396c8df80 Fix linked maps (#878)
* Fix linked maps

* Line breaks
2019-05-07 15:35:15 +02:00
Jaco Greeff 0ab3916d28 Update to latest metadata (with ContractInfo) (#874)
* Update to latest metadata (with ContractInfo)

* isAlive/isTomstone

* typo
2019-05-07 12:04:24 +02:00
Jaco Greeff 4b5ce14737 Fix struct keys, log additional decoding error info (#872)
* Re-create test cases for failures

* Fix cloberring of keys

* Add logging to pinpoint decoding failures
2019-05-07 10:41:24 +02:00
Jaco Greeff 76a9d73774 Bump dev (& fix indents) (#870)
* Bump dev (& fix indents)

* Bump common
2019-05-03 14:59:22 +02:00
Xiliang Chen 91341e63ae Update WithdrawReasons to match substrate (#865)
* Update WithdrawReasons to match substrate

* Linting, comment alignment
2019-05-03 10:16:16 +02:00
Jaco Greeff 45fa3dc514 USize -> U32 (#839)
- Possibly a fix for https://github.com/polkadot-js/api/issues/838
2019-04-30 11:03:30 +02:00
Amaury Martiny 4dd320fc89 Use custom hasher for Map (#857)
* Use blake2 instead of two_x

* Add v4

* Update to new v4 static

* Update json

* Revert

* Use hasher enum

* Fix metadata v4 test

* Fix metadata v4 test

* Fix versioned metadata

* refactor & clean

* Use consistent naming

* Make jsons consistent

* Add backward compat

* Fix tests

* Start working on type-storage

* Fix output

* Grumble

* Update to latest static

* Clean code

* Fix imports

* Remove useless imports

* Fix tests

* Use prettier output for toJSON in metadata

* Implement different hashers

* Remove generic storageKey

* Bump version

* Add backwards-compat

* Fix hashing function, use Twox128

* Grumbles

* Add tests
2019-04-25 15:34:35 +02:00
Stefanie Doll c085d01d00 Add short description to all types on overview page (#849)
* Smaller typos/ wording

* Grammar An - A

* Add short description to each type on overview page WIP

* Removed 'Derived types' section because HeaderExtended was the only derived method left

* Commit current state

* Description completed

* Removed empty row placeholder

* Fixed Typo in LockPeriods

* Spell out Little Endian

* Fixed accidentaly removed space character
2019-04-23 13:07:56 +02:00
Jaco Greeff 4aa1783e3c Remove contract encoding debug (confirmed working) (#836)
* Remove contract encoding debug (confirmed working)

* Remove (now-unused) import
2019-04-12 07:57:20 +02:00
Jaco Greeff b37aebe88b AbstractArray base & VectorAny (no types in constructor) (#833)
* AbstractArray base & VectorAny (no  types in constrctor)

* Remove noInheritDoc from Tuple, Vector* (already on abstract)
2019-04-10 12:36:00 +02:00
Jaco Greeff 825408d0f3 Contract ABI (extended) (#828)
* Contract ABI (extended)

* Rework __selector

* Small updates

* Rename step 1

* Rename step 2
2019-04-09 17:11:38 +02:00
Jaco Greeff 5a82fb623f Expand Digest for asAura, use in HeaderExtended (#832) 2019-04-09 17:00:44 +02:00
Jaco Greeff 33924367bc TreasuryProposal (#825) 2019-04-05 23:32:38 +02:00
Jaco Greeff 8e6c5f693d Contracts attachment (#818)
* WIP... just getting ti to work

* Export ContractAbi from types

* e2e testing

* Add selector encoding (calls)

* Linting

* Exapnd e2e tests

* TODO comments

* Add ABI types & isConstant flag

* Updated with actual steps (progress)

* Linting

* Cleanup event code

* Bump deps

* Bump deps (keyring mnemonic fix)
2019-04-02 21:21:00 +02:00