snarkOS
snarkOS copied to clipboard
[Proposal] Expose functionality in rpc create_raw_transaction as a library
💥 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 beNUM_INPUT_RECORDSinstead? - 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?