Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Document that Transaction::sign might panic #17026

Merged
merged 2 commits into from
May 4, 2021

Conversation

ruuda
Copy link
Contributor

@ruuda ruuda commented May 4, 2021

Problem

My program panicked, because somewhere in a third-party library, that library called Transaction::new_signed_with_payer, which can panic. I’m not sure whether the caller of Transaction::new_signed_with_payer was aware of that. Document it, so users can at least be aware of this.

Summary of Changes

Add # Panics sections. Where possible, include an intra-doc-links to the non-panicking try_* variants of these functions.

ruuda added 2 commits May 4, 2021 10:21
This was not obvious from the documentation, which can make programs
that rely on it panic unexpectedly.
The direct callers of the Transaction::sign, which can panic, are
Transaction::new and related functions, which means these can panic as
well.
@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

Merging #17026 (489dd69) into master (bc7e741) will increase coverage by 0.0%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #17026   +/-   ##
=======================================
  Coverage    82.8%    82.8%           
=======================================
  Files         416      416           
  Lines      117260   117260           
=======================================
+ Hits        97106    97107    +1     
+ Misses      20154    20153    -1     

@mvines mvines added the v1.6 label May 4, 2021
@mvines
Copy link
Contributor

mvines commented May 4, 2021

Thanks!

@mvines mvines merged commit 9abfa65 into solana-labs:master May 4, 2021
mergify bot pushed a commit that referenced this pull request May 4, 2021
mvines pushed a commit that referenced this pull request May 4, 2021
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request May 6, 2021
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
@ruuda ruuda deleted the doc-panic branch July 15, 2022 08:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants