Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
- Loading branch information
Andrew Nikitin
committed
May 23, 2019
1 parent
f7bfd86
commit 2949b01
Showing
4 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
sovtokenfees/sovtokenfees/test/test_get_fees_from_empty_state.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from indy_common.constants import CONFIG_LEDGER_ID | ||
|
||
from plenum.common.constants import AUDIT_LEDGER_ID | ||
from sovtokenfees.constants import FEES | ||
from sovtokenfees.domain import build_path_for_set_fees | ||
from sovtokenfees.fees_authorizer import FeesAuthorizer | ||
from sovtokenfees.static_fee_req_handler import StaticFeesReqHandler | ||
|
||
from stp_core.loop.eventually import eventually | ||
|
||
from plenum.test.txn_author_agreement.helper import check_state_proof | ||
|
||
from state.pruning_state import PruningState | ||
|
||
from storage.kv_in_memory import KeyValueStorageInMemory | ||
|
||
|
||
def test_get_fees_when_no_fees_set(helpers, looper): | ||
def _freshness_done(): | ||
assert audit_ledger.size == length_after + 1 | ||
|
||
for n in helpers.node._nodes: | ||
curr_state = n.states[CONFIG_LEDGER_ID] | ||
curr_state.remove(build_path_for_set_fees().encode()) | ||
""" | ||
Update config state | ||
""" | ||
primary = helpers.node.get_primary_node() | ||
audit_ledger = primary.getLedger(AUDIT_LEDGER_ID) | ||
length_after = audit_ledger.size | ||
primary.master_replica._do_send_3pc_batch(ledger_id=CONFIG_LEDGER_ID) | ||
looper.run(eventually(_freshness_done)) | ||
""" | ||
GET_FEES | ||
""" | ||
response = helpers.general.do_get_fees() | ||
ledger_fees = response[FEES] | ||
assert ledger_fees == {} | ||
check_state_proof(response, build_path_for_set_fees(), None) | ||
helpers.node.assert_set_fees_in_memory({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters