cic-internal-integration/apps/cic-eth/tests/unit/db/test_nonce_db.py

21 lines
487 B
Python
Raw Normal View History

2021-02-01 18:12:51 +01:00
# third-party imports
import pytest
# local imports
from cic_eth.db.models.nonce import Nonce
def test_nonce_increment(
init_database,
eth_empty_accounts,
database_engine,
):
# if database_engine[:6] == 'sqlite':
# pytest.skip('sqlite cannot lock tables which is required for this test, skipping')
nonce = Nonce.next(eth_empty_accounts[0], 3)
assert nonce == 3
nonce = Nonce.next(eth_empty_accounts[0], 3)
assert nonce == 4