Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of accounts in ledger coinbase witness #15267

Merged
merged 5 commits into from Mar 4, 2024

Conversation

mrmr1993
Copy link
Member

@mrmr1993 mrmr1993 commented Mar 4, 2024

This PR cherry-picks #13860 onto berkeley, and adds a test that passes only when the fix is applied. All credit goes to @sebastiencs.

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

@mrmr1993 mrmr1993 requested a review from a team as a code owner March 4, 2024 16:14
@mrmr1993
Copy link
Member Author

mrmr1993 commented Mar 4, 2024

!ci-build-me

@mrmr1993
Copy link
Member Author

mrmr1993 commented Mar 4, 2024

!ci-build-me

@mrmr1993
Copy link
Member Author

mrmr1993 commented Mar 4, 2024

!approved-for-mainnet

@mrmr1993 mrmr1993 merged commit f4365be into berkeley Mar 4, 2024
40 checks passed
@mrmr1993 mrmr1993 deleted the fix-coinbase-witness branch March 4, 2024 19:34
List.map account_ids ~f:(fun acct_id -> (acct_id, access_status))
|> List.rev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this whole piece after let access_status definition can be simplified as something like:

let fee_transfer =
  let%map.Option transfer = t.fee_transfer in
  (Fee_transfer.receiver transfer, access_status)
in
Option.value_map ~default:ident ~f:List.cons fee_transfer [(receiver t, access_status)]

Current code is a bit hard to read
CC @mrmr1993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants