Skip to content

Commit

Permalink
Persist user data to DB (#35)
Browse files Browse the repository at this point in the history
* Persist nonce to db

* run db setup script

* lint

* install sqlx-cli

* Update post_data route flow

* Update data intent status in DB

* update tests

* fix tests

* lint

* Support sqlx offline mode

* ensure sqlx offline data is synced

* fix docs

* add more tests

* add sig tests

* fix sync-readme script

* install mysql-client

* alphabetic database_name

* drop reject too many items test

* add reject too many intents tests

* Allow to skip geth build

* Fix too many pending intents test

* move logic to AppData struct

* make db_pool private too

* drop total_data_intent_cost

* drop intents_tx_inclusion

* check all targets
  • Loading branch information
dapplion authored Dec 29, 2023
1 parent 885f18d commit a31d663
Show file tree
Hide file tree
Showing 41 changed files with 2,417 additions and 833 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
style:
name: Check Style
runs-on: ubuntu-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
Expand All @@ -31,6 +33,7 @@ jobs:
components: rustfmt
# </setup>
- run: cargo fmt -- --check
- run: cargo check --all-targets
- run: cargo clippy -- --deny warnings

tests:
Expand Down Expand Up @@ -74,9 +77,19 @@ jobs:
brew install docker-buildx
- name: Test docker
run: docker run hello-world
- name: Install sqlx-cli
run: cargo install --version='~0.7' sqlx-cli --no-default-features --features rustls,mysql
- name: Migrate database
# linux: mysql-client, macos: brew install mysql
run: |
sudo apt-get install mysql-client -y
./scripts/init_db.sh
# </setup>
- name: Check
run: cargo check
# To re-sync run `cargo sqlx prepare` ref: https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md#enable-building-in-offline-mode-with-query
- name: Ensure sqlx-offline data is synced
run: cargo sqlx prepare --check
- name: Test
run: cargo test -- --test-threads=1 --nocapture

Expand Down Expand Up @@ -119,6 +132,8 @@ jobs:
docs:
name: Docs
runs-on: ubuntu-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
Expand Down

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

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

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

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

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

Loading

0 comments on commit a31d663

Please sign in to comment.