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

Token claims and vesting runtime tests #445

Merged
merged 64 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d70f977
Simple working test
dmitrylavrenov Aug 16, 2022
de32ad4
Use separate vesting balance
dmitrylavrenov Aug 16, 2022
d54d7d3
Add comments
dmitrylavrenov Aug 16, 2022
aac0162
Add checks to claiming test without vesting
dmitrylavrenov Aug 16, 2022
f90999e
Remove file added by mistake
dmitrylavrenov Aug 16, 2022
c8764eb
Add claim test with vesting works
dmitrylavrenov Aug 17, 2022
9c11eb8
Change ethereum seed
dmitrylavrenov Aug 17, 2022
b4cf0e1
Implement unlock tests
dmitrylavrenov Aug 17, 2022
147ebd8
Genesis config test
dmitrylavrenov Aug 17, 2022
b5b68f5
Add tests for built-in chainspecs
dmitrylavrenov Aug 17, 2022
95795a3
Use more realistic block switching
dmitrylavrenov Aug 18, 2022
963d8cb
Move partial test related constants into it
dmitrylavrenov Aug 18, 2022
ed142b8
Rename a helper function
dmitrylavrenov Aug 18, 2022
52fa878
Add SignExt tests
dmitrylavrenov Aug 18, 2022
23af4b5
Remove genesis_config test from runtime. Will be used at humanode-peer
dmitrylavrenov Aug 18, 2022
96ccd0c
Change built-in chain specs test according to the review
dmitrylavrenov Aug 19, 2022
caae948
Add GenesisConfig parse tests
dmitrylavrenov Aug 19, 2022
2acf825
Edit file doc
dmitrylavrenov Aug 19, 2022
eefbb7c
Add genesis claims tests
dmitrylavrenov Aug 19, 2022
17738e5
Proper json input
dmitrylavrenov Aug 19, 2022
fa39235
Export genesis raw data into a helper function
dmitrylavrenov Aug 19, 2022
b1391c2
Apply little changes after rebasing
dmitrylavrenov Aug 19, 2022
7ec2e9a
Use new EIP-712 utils
dmitrylavrenov Aug 19, 2022
84963d0
Use inline substitution
dmitrylavrenov Aug 22, 2022
249a326
Use assetion helper
dmitrylavrenov Aug 22, 2022
b5d3340
Draft dispatch test works
dmitrylavrenov Aug 22, 2022
0845981
Use KeystoreBioauthAccountId
dmitrylavrenov Aug 22, 2022
45a310f
Use dev phrase for alice seed
dmitrylavrenov Aug 22, 2022
bc5ceb4
Remove println
dmitrylavrenov Aug 22, 2022
72a6d61
Little improvements
dmitrylavrenov Aug 22, 2022
76b3f72
Remove unused deps
dmitrylavrenov Aug 22, 2022
b8709c8
Use Applyable to validate and apply checked extrinsic without using s…
dmitrylavrenov Aug 24, 2022
43f30c2
Use assert_storage_noop
dmitrylavrenov Aug 24, 2022
6794253
Use a helper function to prepare checked_extrinsic, dispatch_info, len
dmitrylavrenov Aug 24, 2022
6923dd1
Add docs and rename
dmitrylavrenov Aug 24, 2022
4edb479
Add dispatch claiming with vesting works test
dmitrylavrenov Aug 24, 2022
fdd8503
Add dispatch unlock full balance works test
dmitrylavrenov Aug 24, 2022
8c6f50c
Add dispatch unlock partial balance works test
dmitrylavrenov Aug 24, 2022
fd8e353
Add more docs
dmitrylavrenov Aug 24, 2022
1a83c5a
Add dispatch fails tests
dmitrylavrenov Aug 24, 2022
ac43932
Removed misadded file
dmitrylavrenov Aug 24, 2022
ec90265
Don't use assert_noop for apply
dmitrylavrenov Aug 24, 2022
cb64f0a
Add zero balance test
dmitrylavrenov Aug 24, 2022
4865f1c
Add testing for all transaction sources
dmitrylavrenov Aug 24, 2022
207312f
Remove redundant type def
dmitrylavrenov Aug 24, 2022
9ad661d
Rename test ext usage
dmitrylavrenov Aug 26, 2022
9f907c5
Remove redundant signed extensions
dmitrylavrenov Aug 26, 2022
80a2fed
Improve comment for zero balance test
dmitrylavrenov Aug 26, 2022
26dcb2c
Remove redundant dependency
dmitrylavrenov Aug 26, 2022
21d11f2
Add pre dispatch post bad proof test
dmitrylavrenov Aug 29, 2022
1ae3663
Add pre dispatch post no claim test
dmitrylavrenov Aug 29, 2022
45414b8
Remove redundant dependency
dmitrylavrenov Aug 29, 2022
d2a6706
Export calls
dmitrylavrenov Aug 29, 2022
404f4ad
Remove redundant pre_dispatch_post_claiming_fails_invalid_call test
dmitrylavrenov Aug 30, 2022
bbcd7a8
Remove redundant pre_dispatch_post_claiming_fails_bad_proof test
dmitrylavrenov Aug 30, 2022
8a1b1eb
Rename test to dispatch_claiming_fails_when_eth_signature_invalid
dmitrylavrenov Aug 30, 2022
bac76ea
Rename test to dispatch_claiming_fails_when_no_claim
dmitrylavrenov Aug 30, 2022
6b87365
Remove redundant deps
dmitrylavrenov Aug 30, 2022
0481b1b
Simplify a helper function
dmitrylavrenov Aug 30, 2022
3ed23ed
Add direct claiming invalid signature test
dmitrylavrenov Aug 30, 2022
2378dc6
Add direct claiming no claim test
dmitrylavrenov Aug 30, 2022
bee8bb4
Direct unlock fails when no vesting test
dmitrylavrenov Aug 30, 2022
a0fa379
Return misdeleted dispatch_claiming_fails_when_eth_signature_invalid …
dmitrylavrenov Aug 30, 2022
9254dae
Merge branch 'master' into claims-integration-tests
dmitrylavrenov Aug 30, 2022
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/humanode-peer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ url = "2"

[dev-dependencies]
indoc = "1.0"
sp-io = { git = "https://github.com/humanode-network/substrate", branch = "master" }

[build-dependencies]
vergen = { version = "7", default-features = false, features = ["cargo", "git"] }
Expand Down
20 changes: 20 additions & 0 deletions crates/humanode-peer/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,29 @@ fn testnet_genesis(
#[cfg(test)]
mod tests {
use indoc::indoc;
use sp_runtime::BuildStorage;

use super::*;

fn assert_genesis_config(chain_spec_result: Result<ChainSpec, String>) {
chain_spec_result.unwrap().build_storage().unwrap();
}

#[test]
fn local_testnet_config_works() {
assert_genesis_config(local_testnet_config());
}

#[test]
fn development_config_works() {
assert_genesis_config(development_config());
}

#[test]
fn benchmark_config_works() {
assert_genesis_config(benchmark_config());
}

#[test]
fn deserialize_bioauth_flow_params_extensions() {
let expected = Extensions {
Expand Down
2 changes: 2 additions & 0 deletions crates/humanode-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ static_assertions = { version = "1.1.0", default-features = false }
crypto-utils = { version = "0.1", path = "../crypto-utils" }
eip712-common-test-utils = { version = "0.1", path = "../eip712-common-test-utils" }

hex = "0.4"
serde_json = "1"
sp-io = { git = "https://github.com/humanode-network/substrate", branch = "master" }

[features]
Expand Down
Loading