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

feat: support versioned txs in sendTransaction and simulateTransaction #27528

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Sep 1, 2022

Problem

Not possible to use the Connection.sendTransaction and Connection.simulateTransaction methods with versioned transactions.

Summary of Changes

  • Deprecate the usage of Connection.sendTransaction and Connection.simulateTransaction without using a VersionedTransaction class.
  • Deprecate the side effects of the above methods including "recentBlockhash" replacement and signing

Fixes #

@jstarry jstarry force-pushed the web3/send-versioned-tx branch from d5d2468 to 7a37847 Compare September 1, 2022 15:07
@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #27528 (5b57610) into master (e779032) will decrease coverage by 0.9%.
The diff coverage is n/a.

❗ Current head 5b57610 differs from pull request most recent head 12d8281. Consider uploading reports for the commit 12d8281 to get more accurate results

@@            Coverage Diff            @@
##           master   #27528     +/-   ##
=========================================
- Coverage    76.9%    75.9%   -1.0%     
=========================================
  Files          48       52      +4     
  Lines        2505     2684    +179     
  Branches      355      374     +19     
=========================================
+ Hits         1927     2038    +111     
- Misses        448      510     +62     
- Partials      130      136      +6     

@jstarry jstarry force-pushed the web3/send-versioned-tx branch from 4dfed44 to 12d8281 Compare September 6, 2022 13:59
@steveluscher
Copy link
Contributor

steveluscher commented Sep 6, 2022

While we're changing the signatures anyway, maybe go full-on config object style.

/** @deprecated */
simulateTransaction(
  transactionOrMessage: Transaction | Message,
  signers?: Array<Signer>,
  includeAccounts?: boolean | Array<PublicKey>,
): Promise<...>
simulateTransaction(config: SimulateTransactionConfig): Promise<...>;
async simulateTransaction(
  transactionOrConfig: Transaction | SimulateTransactionConfig,
  signers?: Array<Signer>,
  includeAccounts?: boolean | Array<PublicKey>,
): Promise<...> {
  // ...
}

@jstarry
Copy link
Member Author

jstarry commented Sep 7, 2022

Now is definitely the time to do something like that but I prefer to keep the transaction as a separate arg since it mirrors the RPC API request structure. Thanks for the suggestion though!

@jstarry jstarry merged commit 204f272 into solana-labs:master Sep 7, 2022
@jstarry jstarry deleted the web3/send-versioned-tx branch September 7, 2022 03:53
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.

2 participants