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

37 update library to use ether rs keyaddress instead of using k256 library directly #63

Closed ColePBryan closed 1 year ago

ColePBryan commented 1 year ago

Updates library to use ethers-rs instead of k256 directly.

Changes:

github-actions[bot] commented 1 year ago

Coverage after merging 37-update-library-to-use-ether-rs-keyaddress-instead-of-using-k256-library-directly into main will be

86.77%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_core/src
   eip_712_signed_message.rs67.74%100%55.56%72.73%49
   lib.rs86.21%100%77.78%90%18
   receipt_aggregate_voucher.rs81.58%100%57.14%87.10%21
tap_core/src/adapters/test
   collateral_adapter_mock.rs82.98%100%71.43%85%25–26, 44, 50–52
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs94.74%100%83.33%96.88%7
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs87.18%100%83.33%87.88%49, 53–55
   receipt_checks_adapter_test.rs95.83%100%100%95%53
   receipt_storage_adapter_mock.rs97.37%100%92.31%98.41%7
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs66.67%100%50%75%
   receipt.rs67.65%100%55.56%72%20, 44
   received_receipt.rs82.42%100%75.86%83.82%100–102, 109–111, 113–115, 160, 171, 185–187, 95–97
aasseman commented 1 year ago

:thinking: not quite sure that was really needed. If a user of the lib wanted to use ethers-rs wallets, they could have used wallet.signer(), which gives you a K256 SignerKey that worked with your previous implementation.

ColePBryan commented 1 year ago

Thats true, but this keeps our whole library at the same level of abstraction. Previously we signed with k256, derived eip-712 with ether-rs, wrote custom code to translate to eth address from k-256. Now it is all through ethers-rs and they handle k256.

Either way the whole library was going to be updated to using recoverable signatures. This was just one approach to achieving that.

github-actions[bot] commented 1 year ago

Coverage after merging 37-update-library-to-use-ether-rs-keyaddress-instead-of-using-k256-library-directly into main will be

86.37%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_core/src
   eip_712_signed_message.rs67.74%100%55.56%72.73%49
   lib.rs71.43%100%71.43%71.43%17
   receipt_aggregate_voucher.rs81.58%100%57.14%87.10%21
tap_core/src/adapters/test
   collateral_adapter_mock.rs82.98%100%71.43%85%25–26, 44, 50–52
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs94.74%100%83.33%96.88%7
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs87.18%100%83.33%87.88%49, 53–55
   receipt_checks_adapter_test.rs95.83%100%100%95%53
   receipt_storage_adapter_mock.rs97.37%100%92.31%98.41%7
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs66.67%100%50%75%
   receipt.rs67.65%100%55.56%72%20, 44
   received_receipt.rs82.42%100%75.86%83.82%100–102, 109–111, 113–115, 160, 171, 185–187, 95–97
github-actions[bot] commented 1 year ago

Coverage after merging 37-update-library-to-use-ether-rs-keyaddress-instead-of-using-k256-library-directly into main will be

86.37%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tap_core/src
   eip_712_signed_message.rs67.74%100%55.56%72.73%49
   lib.rs71.43%100%71.43%71.43%17
   receipt_aggregate_voucher.rs81.58%100%57.14%87.10%21
tap_core/src/adapters/test
   collateral_adapter_mock.rs82.98%100%71.43%85%25–26, 44, 50–52
   collateral_adapter_test.rs100%100%100%100%
   rav_storage_adapter_mock.rs94.74%100%83.33%96.88%7
   rav_storage_adapter_test.rs100%100%100%100%
   receipt_checks_adapter_mock.rs87.18%100%83.33%87.88%49, 53–55
   receipt_checks_adapter_test.rs95.83%100%100%95%53
   receipt_storage_adapter_mock.rs97.37%100%92.31%98.41%7
   receipt_storage_adapter_test.rs100%100%100%100%
tap_core/src/tap_receipt
   mod.rs66.67%100%50%75%
   receipt.rs67.65%100%55.56%72%20, 44
   received_receipt.rs82.42%100%75.86%83.82%100–102, 109–111, 113–115, 160, 171, 185–187, 95–97