Skip to content
Snippets Groups Projects
Commit 0486a7ba authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix(#125): fix(e2e): tests are now passing

parent f01e0313
No related branches found
No related tags found
No related merge requests found
Feature: Balance transfer
Feature: Account creation
Scenario: Create a new account with enough funds
When alice sends 5 ĞD to dave
......@@ -29,8 +29,10 @@ Feature: Balance transfer
@ignoreErrors
Scenario: Create a new account without any funds
Then eve should have 0 ĞD
# Alice is treasury funder for 1 ĞD
Then alice should have 9 ĞD
When eve send 0 ĞD to alice
Then alice should have 10 ĞD
Then alice should have 9 ĞD
When alice send 5 ĞD to eve
Then eve should have 5 ĞD
When 1 block later
......
......@@ -6,11 +6,14 @@ Feature: Identity creation
# - existential deposit (2 ĞD)
# - transaction fees (below 1 ĞD)
When alice sends 7 ĞD to dave
# Alice is treasury funder for 1 ĞD => 10-1-7 = 2
Then alice should have 2 ĞD
When bob sends 750 cĞD to dave
When charlie sends 6 ĞD to eve
# alice last certification is counted from block zero
# then next cert can be done after cert_period, which is 15
When 15 block later
# Then alice should have 1202 cĞD
When alice creates identity for dave
Then dave identity should be created
Then dave should be certified by alice
......
Feature: Balance transfer
Feature: Monetary mass
Scenario: After 10 blocks, the monetary mass should be 60 ĞD
Then Monetary mass should be 30.00 ĞD
......
......@@ -2,7 +2,8 @@ Feature: Oneshot account
Scenario: Simple oneshot consumption
When alice sends 7 ĞD to oneshot dave
Then alice should have 3 ĞD
# Alice is treasury funder for 1 ĞD
Then alice should have 2 ĞD
Then dave should have oneshot 7 ĞD
When oneshot dave consumes into account bob
Then dave should have oneshot 0 ĞD
......@@ -11,7 +12,8 @@ Feature: Oneshot account
Scenario: Double oneshot consumption
When alice sends 7 ĞD to oneshot dave
Then alice should have 3 ĞD
# Alice is treasury funder for 1 ĞD
Then alice should have 2 ĞD
Then dave should have oneshot 7 ĞD
When oneshot dave consumes 4 ĞD into account bob and the rest into oneshot charlie
Then dave should have oneshot 0 ĞD
......
......@@ -5,10 +5,10 @@ Feature: Balance transfer all
When bob sends all her ĞDs to dave
"""
Bob is a member, as such he is not allowed to empty his account completely,
if he tries to do so, the existence deposit (2 ĞD) must remain.
if he tries to do so, the existence deposit (1 ĞD) must remain.
"""
Then bob should have 2 ĞD
Then bob should have 1 ĞD
"""
10 ĞD (initial Bob balance) - 2 ĞD (Existential deposit) - 0.02 ĞD (transaction fees)
10 ĞD (initial Bob balance) - 1 ĞD (Existential deposit) - 0.02 ĞD (transaction fees)
"""
Then dave should have 798 cĞD
Then dave should have 898 cĞD
......@@ -360,7 +360,7 @@ fn genesis_data_to_gdev_genesis_conf(
.collect(),
},
cert: CertConfig {
apply_cert_period_at_genesis: true,
apply_cert_period_at_genesis: false,
certs_by_receiver,
},
membership: MembershipConfig { memberships },
......
......@@ -442,9 +442,16 @@ where
}
// Forced authority gets its required certs from first "minCert" WoT identities (fake certs)
let mut new_certs: HashMap<String, u32> = HashMap::new();
let certs_of_authority = &identities_v2.get(name).unwrap().certs_received;
identities_v2
.keys()
.filter(|issuer| issuer != &name)
// Identities which are not the authority and have not already certified her
.filter(|issuer| {
issuer != &name
&& !certs_of_authority
.iter()
.any(|(authority_issuer, _)| issuer == &authority_issuer)
})
.take(common_parameters.min_cert as usize)
.map(String::clone)
.for_each(|issuer| {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment