Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Immutable Transaction data structure #307

Closed
debris opened this issue Feb 2, 2016 · 0 comments · Fixed by #350
Closed

Immutable Transaction data structure #307

debris opened this issue Feb 2, 2016 · 0 comments · Fixed by #350
Assignees
Labels
F6-refactor 📚 Code needs refactoring. F8-enhancement 🎊 An additional feature request.

Comments

@debris
Copy link
Collaborator

debris commented Feb 2, 2016

Instead of having a single Transaction structure, we could have Transaction and SignedTransaction. They could look like this:

pub struct Transaction {
  pub nonce: U256,
  // ...
}

impl Transaction {
  fn sign(self) -> SignedTransaction {
    // signing is here
  }
}

pub struct SignedTransaction {
  t: Transaction, // or Transaction fields
  v: u8,
  r: U256,
  s: U256,
  hash: H256,
  sender: Address
}

It would reduce number of places where we check if transaction is correctly signed, to 1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F6-refactor 📚 Code needs refactoring. F8-enhancement 🎊 An additional feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant