Commit Graph

152 Commits

Author SHA1 Message Date
emostov a8bbec4c9d Merge branch 'zeke-mortal-ext' of https://github.com/paritytech/substrate-subxt into zeke-mortal-ext 2020-12-26 12:11:48 -08:00
emostov 7cae5d2bc7 Add MortalPeriod enum 2020-12-26 12:11:43 -08:00
Zeke Mostov d3b6971bc6 Update src/lib.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2020-12-24 10:05:41 -08:00
emostov 6908adbd1a Merge branch 'zeke-mortal-ext' of https://github.com/paritytech/substrate-subxt into zeke-mortal-ext 2020-12-23 18:35:23 -08:00
emostov fe8b441aba Use timestamp to calc block time; Misc. review resp. 2020-12-23 18:35:16 -08:00
Zeke Mostov ecd674f714 Update src/lib.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2020-12-23 08:08:33 -08:00
emostov a80c64461f Night fmt 2020-12-22 18:52:44 -08:00
emostov b617815f6a Remove fallbacks and simply error 2020-12-22 18:50:25 -08:00
emostov 039c82a2a5 nightly fmt 2020-12-21 18:20:32 -08:00
emostov cde38ca9b7 Move derive_mortal_period to metadata with crate viz 2020-12-21 18:19:16 -08:00
emostov f09adc1875 Dynamically derive default mortal period 2020-12-21 16:48:18 -08:00
emostov 9110f7a950 Merge remote-tracking branch 'origin' into zeke-mortal-ext 2020-12-21 14:57:24 -08:00
Zeke Mostov 0a926ef4c4 Enable retrieval of constants from rutnime metadata (#207) 2020-12-17 10:23:46 +00:00
emostov 722c38d01e Remove stray comment 2020-12-16 09:14:27 -08:00
emostov f356ca38e4 Link to substrate reference for mortal period 2020-12-15 18:30:38 -08:00
emostov 8f11c42635 Update comment 2020-12-14 14:53:59 -08:00
emostov ff265ec693 nightly fmt 2020-12-14 14:41:11 -08:00
emostov dc782e930e Trivial cleaning 2020-12-14 14:40:25 -08:00
emostov eef192925b Update to set mortal_period in client 2020-12-14 14:09:11 -08:00
emostov 47911b8a02 Have create_signed() Pass era enum 2020-12-14 11:46:31 -08:00
emostov 633bd0fb6f Remove poorly panickable unwraps 2020-12-14 11:34:26 -08:00
Caio 8a76bebcff Add badge to docs.rs (#203) 2020-12-14 17:26:49 +00:00
emostov a9899324ec Remove stray comment 2020-12-13 20:42:01 -08:00
emostov 00078ac94c Remove TODO 2020-12-13 20:36:41 -08:00
emostov 085eb5e606 Remove unused proc macro token stuff 2020-12-13 20:34:08 -08:00
emostov c9059d1a32 feat: Mortal extrinsic construction 2020-12-13 20:13:16 -08:00
Greg Hill 80aff7eb6e register type sizes for u64 and u128 (#200)
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
2020-12-09 15:09:29 +00:00
Andrew Jones 0b3c8d4523 Remove some substrate dependencies to improve compile time (#194)
* Copy ReadProof and TransactionStatus types

* Define local app crypto types

* Fmt

* Restore logging and add comments
2020-12-03 13:20:50 +00:00
Greg Hill 27c377a9d6 propagate 'RuntimeError's to 'decode_raw_bytes' caller (#189)
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
2020-11-13 17:16:14 +00:00
Qinxuan Chen 7655caac0f Derive Clone for PairSigner (#184)
* Derive `Clone` for `PairSigner`

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Specify the date of nightly toolchain to fix CI

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2020-10-20 10:57:27 +01:00
David fc2da6b9c7 Release v0.13 (#175)
* Upgrade to substrate 2.0.0

* WIP implement Subcommand manually (see https://github.com/paritytech/substrate/pull/6894#issuecomment-676060197)

* Add pallet-staking/std to the std feature

* Sort out the subcommand impl

* Sort out the module index (ty @ascjones)
Sort out the RefCount type (ty @dvc94ch)
Random tweaks to make test-node more similar to the vanilla node-template

* obey the fmt

* Add changelog and bump versions

* Merge #165 and update CHANGELOG

* Update test-node/runtime/src/lib.rs

Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>

Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
2020-10-05 10:56:27 +02:00
Demi Marie Obenour cd7bb6041b Remove unnecessary Sync requirements (#172)
This is needed for Ledgeracio, as Ledgeracio’s signer is now no longer
`Send`.
2020-09-25 08:18:26 +01:00
Andrew Jones 385d214217 Call a contract (#165)
* Revert contracts put_code test to pure code (not using the macro)

* Test contract instantiate

* Fmt

* Extract put_code and new_client functions

* Generate fresh accounts for contract tests to allow reruns without a chain purge

* Fetch and increment nonce to allow concurrent test runs

* fmt

* Failing contract call test

* Fmt and fix compilation

* Fix error message for contract call

* Fix call test

* Update contract execution event comment

* Remove redundant feature flags, now on module

* Update event data comment

* Use fetch_add

* Fmt
2020-09-24 18:21:51 +02:00
David 8e2a4f06ee Upgrade to substrate 2.0.0 (#173)
* Upgrade to substrate 2.0.0

* WIP implement Subcommand manually (see https://github.com/paritytech/substrate/pull/6894#issuecomment-676060197)

* Add pallet-staking/std to the std feature

* Sort out the subcommand impl

* Sort out the module index (ty @ascjones)
Sort out the RefCount type (ty @dvc94ch)
Random tweaks to make test-node more similar to the vanilla node-template

* obey the fmt

* cleanup

* more cleanup
2020-09-24 12:57:35 +01:00
David 56bd633706 Address review grumbles from #99 (#171)
* Address review grumbles from #99

* obey the fmt
2020-09-22 16:29:29 +01:00
Demi Obenour f9f69b8c3b Staking support (#99)
* Initial Staking API

* Add more staking types

* Reformat

* Remove dead code

* Fix missing documentation

* Reformat

* Staking: use proc macros

* Add partial session support

* Reformat

* Try to implement nomination

This currently fails with compilation errors I do not understand.

* Use the #[module] macro

This fixes a compile error

* Explain undefined method diagnostics

* Use ‘#[module]’ and implement session for Kusama

* Don’t impl ‘Staking’ for all ‘T: System’

* Add staking payout support

* Fix compilation errors and remove useless lifetimes

* Respond to code review

This fixes most of the issues found during review, with the exception of
tests.

* Make signing fallable and asynchronous

This is needed for hardware wallets, which require human confirmation to
sign transactions.  Blocking on a human to sign transactions is not a
good idea, and the signing might fail for many reasons (device
unplugged, authorization not granted, etc).

* Reformat

* Refactor as suggested by Andrew Jones (@ascjones).

* Reformat

* Refactor as suggested by Andrew Jones (@ascjones).

* Trait cleanups

* Make the `Signer` impl require Send + Sync

This is what Ledgeracio needs.

* Use the correct key for staking maps

They use the key type, not ‘PhantomData’.

* Implement set_payee call

* Switch to associated types for Staking

* Implement `set_keys`

This is needed for Ledgeracio.

* Remove impl of Signer for Box<dyn Signer + Send + Sync>

It isn’t needed, since Box implements Deref.

* Fix Polkadot and Kusama ‘SessionKey’ structs

I had failed to include the ‘Parachains’ component, which the default
Substrate runtime doesn’t have.

* Include a copy of `ValidatorId`

This avoids needing to depend on Polkadot.

* Fix syntax error in Cargo.toml

* Fix compile errors

* Add Debug impls

* Fix return type of `BondedStore`

* Use some upstream type definitions

Also add `Default` impls.

* Bump deps and fix build

* Remove last reference to Kusama feature

* Fix compilation errors

* Implement the `concat` in `twox_64_concat`

* Expose properties and per-era preferences

* Era rewards point support

I also did some refactoring.

* Expose clipped exposure

* Era reward points support

* Make `PayoutStakersCall` public

* Add in all default features for debugging

* Chill support and update to latest Substrate

* If property fetch fails, use dummy values

* Fix tests

* Fix header

* Remove some code Ledgeracio does not need

* More deletions

* Remove more code not needed for Ledgeracio

* Remove a pointless change in Cargo.toml

w.r.t. upstream.

* Remove more junk

* Revert contracts put_code test to pure code (not using the macro)

* Test contract instantiate

* Fmt

* WIP

* Add some more submission tests

* Reformat

* More tests

* Cleanup

* Hopefully fix CI

* Remove dead code

* Test chill

* Add missing docs

* Remove unnecessary use

* Revert "Remove unnecessary use"

This reverts commit bc8bc36bde581f1892ea88a778dfe0fe5bff24d7.

* Retry on temporary failures

* Ignore the staking tests on CI

* Obey the fmt

* Run CI with at most one test thread

* Implement tests for staking

* More tests

* Remove unhelpful println!

* Revert changes in contract tests

* Reformat

* Remove spurious diff

* More tests

Co-authored-by: Demi M. Obenour <demiobenour@gmail.com>
Co-authored-by: David Palm <dvdplm@gmail.com>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
2020-09-21 13:15:46 -04:00
Liu-Cheng Xu 0c7454dfcd Display RawEvent data in hex (#168)
So that printing the RawEvent won't comsume more than the whole screen.
2020-09-21 10:32:41 +01:00
Liu-Cheng Xu e843bd670f Add SudoUncheckedWeightCall (#167)
* Add SudoUncheckedWeightCall

* Add test_sudo_unchecked_weight()

* Fix CI

Use nightly fmt.

* .
2020-09-21 09:22:57 +01:00
Liu-Cheng Xu ce22986a75 Add SetCodeWithoutChecksCall (#166) 2020-09-17 15:20:48 +01:00
Andrew Jones 4ed8e37ffe Fix up contracts pallet tests (#163)
* Revert contracts put_code test to pure code (not using the macro)

* Test contract instantiate

* Fmt
2020-09-15 08:32:33 +01:00
Greg Hill 2829d7d7c1 fix option decoding and add basic sanity test (#161)
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
2020-09-15 08:24:05 +01:00
David Ackerman f2cf79847a Remove visibility limiter pub (crate) from Metadata (#162)
* Remove visibility limiter `pub (crate)`

* Run fmt

* Add comments
2020-09-14 15:51:42 +01:00
Greg Hill e85d01ed08 decode option event arg (#158)
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
2020-09-07 14:58:45 +01:00
Andrew Jones af45c39fb1 Release v0.12.0 (#157)
* Bump version, update changelog

* Bump proc-macro crate

* Bump client crate
v0.12.0
2020-09-01 15:54:01 +01:00
David Craven e9c50e21d0 Only return an error if the extrinsic failed. (#156) 2020-09-01 11:15:04 +01:00
David Craven 3ea9d3b8bb Update to rc6. (#155)
* Update to rc6.

* Fix clippy warnings.
2020-08-25 09:50:14 +01:00
David Craven eac2ce3b2a Different assert. (#153) 2020-08-17 09:14:26 +01:00
Yuanchao Sun 59b9c117b7 Add a method to fetch an unhashed key, close #100 (#152)
* Add a method to fetch an unhashed key, close #100

* Return decoded value

* Refactoring
2020-08-13 21:06:30 +01:00
David Craven 9aa32ef63d Fix port number. (#151) 2020-08-13 16:04:30 +01:00
Demi Obenour 511e6f5a16 Implement the concat in twox_64_concat (#150)
Co-authored-by: Demi M. Obenour <demiobenour@gmail.com>
2020-08-10 11:05:17 +01:00