snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

[Proposal] Expose functionality in rpc create_raw_transaction as a library

Open kellpossible opened this issue 5 years ago • 0 comments

💥 Proposal

The RPC endpoint has a function for creating transactions, it would be nice to have this functionality exposed as a rust library, with native snarkOS types as inputs (instead of decoding everything from hex strings).

Comments on rpc_impl_protected.rs create_raw_transaction() method

A couple of comments on this function.

  • It would be good to document this method, what the expected inputs are, what their expected vector lengths are.
  • There are some asserts such as assert!(transaction_input.old_records.len() <= Components::NUM_OUTPUT_RECORDS); should this be NUM_INPUT_RECORDS instead?
  • A lot of the asserts on user inputs will cause a panic if the user gets it wrong, are these handled somewhere else higher up in a way that doesn't result in a panic?

kellpossible avatar Oct 22 '20 07:10 kellpossible