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

Add TransactionBuilder #3005

Merged
merged 3 commits into from
Feb 28, 2019
Merged

Add TransactionBuilder #3005

merged 3 commits into from
Feb 28, 2019

Conversation

garious
Copy link
Contributor

@garious garious commented Feb 28, 2019

Problem

Transactions cannot be automatically composed from Instructions. We create "FooTransaction" modules containing anticipated permutations of instructions. If those aren't sufficient, the caller is on their own, and it's a tedious process.

Summary of Changes

  • Parameterize Instruction over its program id index and account keys
  • Add a new TransactionBuilder object
  • Demo usage in BudgetTransaction

cc #1293

For serialization: Instruction<u8, u8>
For users:         Instruction<Pubkey, (Pubkey, bool)>
For programs:      Instruction<Pubkey, (Pubkey, bool, Account)>
@codecov
Copy link

codecov bot commented Feb 28, 2019

Codecov Report

Merging #3005 into master will decrease coverage by 5.1%.
The diff coverage is 94.9%.

@@           Coverage Diff            @@
##           master   #3005     +/-   ##
========================================
- Coverage    76.6%   71.5%   -5.2%     
========================================
  Files         128     129      +1     
  Lines       19694   21332   +1638     
========================================
+ Hits        15102   15261    +159     
- Misses       4592    6071   +1479

@codecov
Copy link

codecov bot commented Feb 28, 2019

Codecov Report

Merging #3005 into master will increase coverage by 0.1%.
The diff coverage is 96%.

@@           Coverage Diff            @@
##           master   #3005     +/-   ##
========================================
+ Coverage    76.6%   76.8%   +0.1%     
========================================
  Files         128     129      +1     
  Lines       19694   19861    +167     
========================================
+ Hits        15102   15265    +163     
- Misses       4592    4596      +4

@garious garious requested a review from mvines February 28, 2019 13:26
Copy link
Contributor

@mvines mvines left a comment

Choose a reason for hiding this comment

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

Super, glad we finally have this

@garious garious merged commit a79caf7 into solana-labs:master Feb 28, 2019
yihau pushed a commit to yihau/solana that referenced this pull request Sep 28, 2024
…a-labs#2952) (solana-labs#3005)

Fix: Corrected the derivation command format (solana-labs#2952)

(cherry picked from commit d2cc71f)

Co-authored-by: Asten <[email protected]>
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