onflow / hybrid-custody

Cadence suite enabling Hybrid Custody on Flow
Apache License 2.0
16 stars 12 forks source link

Fix: rotateAuthAccount failed when called twice #154

Closed btspoony closed 1 year ago

btspoony commented 1 year ago

When giveOwnership and addOwnedAccount are executed in the same transaction rotateAuthAccount will be called twice. However, during the second call, since authAcctPath is the same, it will cause acct.linkAccount to return nil as a result.

Personal opinion, it would be better to change HybridCustody overall to CapCons coding style.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0ddf6b8) 83.95% compared to head (97363bd) 83.95%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #154 +/- ## ======================================= Coverage 83.95% 83.95% ======================================= Files 4 4 Lines 349 349 ======================================= Hits 293 293 Misses 56 56 ``` | [Files Changed](https://app.codecov.io/gh/onflow/hybrid-custody/pull/154?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow) | Coverage Δ | | |---|---|---| | [contracts/HybridCustody.cdc](https://app.codecov.io/gh/onflow/hybrid-custody/pull/154?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow#diff-Y29udHJhY3RzL0h5YnJpZEN1c3RvZHkuY2Rj) | `81.54% <100.00%> (ø)` | |

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

btspoony commented 1 year ago

Updated with unsafeRandom on new flow-cli v1.4.4 @sisyphusSmiling @austinkline

sisyphusSmiling commented 1 year ago

Testnet and Mainnet contracts have been updated.

Testnet updating transaction- c3c31132c1217fb5e993281fa4618e0bd2684a409e1f8ef9ca4d119bddef678d Mainnet updating transaction - 7a757e20c55149567715fb7135ef521e02e4345ed19fd4685e2b4b2a4b9f9030