xmtp / didethresolver

XMTP Registry Resolver
MIT License
3 stars 1 forks source link

add timestamp to ethr builder #48

Closed insipx closed 8 months ago

insipx commented 8 months ago

related to https://github.com/xmtp/xps-gateway/issues/61

timestamp is not the best way b/c we can have multiple installation id updates in the same block. It may be OK in the general case, since it could be rare that a user updates their installation key in the same block twice, but it can happen. libxmtp relies on it in order to sort through installation ids it already has. In the future it would be better to use a block # / log index combo. This would also avoid yet another api call to the ethereum rpc node

codecov[bot] commented 8 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c7f7452) 97.27% compared to head (77f5c5a) 97.25%.

Files Patch % Lines
lib/src/types/ethr.rs 97.97% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #48 +/- ## ========================================== - Coverage 97.27% 97.25% -0.02% ========================================== Files 13 13 Lines 2826 2953 +127 ========================================== + Hits 2749 2872 +123 - Misses 77 81 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

insipx commented 8 months ago

LGTM! Looks like we need a rustfmt.toml to unify cargo fmt

we should be just on the stable default rustfmt settings, in this case my lsp crashed and i didn't get the autoformatting I usually do

insipx commented 8 months ago

removed logic to convert to datetime b/c it was wasteful, changed to store the usual timestamp and then multiply for nanoseconds @jac18281828