semiotic-ai / timeline-aggregation-protocol

A fast, efficient and trust-minimized unidirectional micro-payments system.
Apache License 2.0
14 stars 3 forks source link

refactor(core): move error to separate module #104

Closed ozgrakkurt closed 1 year ago

ozgrakkurt commented 1 year ago

Moved error type to separate file inside core crate

github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 548 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`

github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%7
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
ozgrakkurt commented 1 year ago

Please fix the failed CI checks by reviewing:

* https://github.com/semiotic-ai/timeline-aggregation-protocol/blob/main/CONTRIBUTING.md#commit-messages

* https://github.com/semiotic-ai/timeline-aggregation-protocol/blob/main/CONTRIBUTING.md#i-want-to-contribute

I think should be ok now

github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 548 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`

github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%7
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 548 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`

github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%13
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 548 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`

github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%13
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
ozgrakkurt commented 1 year ago

@aasseman can you re-check?

github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 549 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`

github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%13
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
github-actions[bot] commented 1 year ago

Coverage after merging sep-error into main will be

80.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_aggregator/src
   aggregator.rs92.45%100%100%90.70%40–43, 53–56
   api_versioning.rs86.21%100%76.47%90.24%15–16
   error_codes.rs0%100%0%0%16, 5
   jsonrpsee_helpers.rs43.90%100%33.33%48.28%44, 51–57, 9
   main.rs3.70%100%6.67%2.56%17, 21–22, 26, 30–31, 35–36, 40–41, 45–46, 49–51, 54–61, 64–69, 72–76, 78
   server.rs86.09%100%100%82.22%101, 113–117, 137, 69–77
tap_core/src
   eip_712_signed_message.rs83.78%100%80%85.19%58
   error.rs50%100%50%50%13
   lib.rs83.33%100%87.50%81.25%26
   receipt_aggregate_voucher.rs92.50%100%87.50%93.75%23
tap_core/src/adapters/test
   collateral_adapter_mock.rs88.33%100%75%90.38%18, 44–45, 64
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs92%100%71.43%95.35%30
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs97.83%100%100%97.50%61
   receipt_checks_adapter_test.rs95.83%100%100%95%59
   receipt_storage_adapter_mock.rs93.46%100%86.67%94.57%28, 90–92
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_manager
   manager.rs76.76%100%58.33%78.46%107, 126–129, 135, 170–176, 190, 201–202, 213, 95
   rav_request.rs0%100%0%0%9
tap_core/src/tap_manager/test
   manager_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs41.46%100%36.36%43.33%16, 49–59
   receipt.rs88.46%100%87.50%88.89%19
   receipt_auditor.rs80%100%83.33%79.70%103–105, 115, 121–126, 139, 146, 161–163, 65, 78–80, 87–90
   received_receipt.rs83.06%100%78.05%83.83%119–121, 131, 215–217, 230–232, 238–240, 247–249, 251–253, 282–284, 308, 319, 326, 333–335, 340, 345, 349–350, 359–360, 382, 396–398
github-actions[bot] commented 1 year ago

🤖 Cargo Audit Report 🤖`

Show Report *** Fetching advisory database from `https://github.com/RustSec/advisory-db.git` Loaded 549 security advisories (from /usr/local/cargo/advisory-db) Updating crates.io index Scanning Cargo.lock for vulnerabilities (419 crate dependencies) Crate: atty Version: 0.2.14 Warning: unsound Title: Potential unaligned read Date: 2021-07-04 ID: RUSTSEC-2021-0145 URL: https://rustsec.org/advisories/RUSTSEC-2021-0145 Dependency tree: atty 0.2.14 └── criterion 0.4.0 └── tap_core 0.1.0 └── tap_aggregator 0.1.0 warning: 1 allowed warning found ```

Pusher: @ozgrakkurt, Action: pull_request, Working Directory: `, Workflow:tests`