-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Library should support scenario with signing process detatched from transaction building:
- transaction gets prepared
- it gets serialized without signatures and delivered to
signer
component - signer generates and returns signatures
- signatures are attached, transaction is broadcasted
To support that scenario:
Message.setFeePayer
should accept public key only (private key is not needed at that stage)Transaction.sign
should allow adding signature to already constructed messageMessage.deserialize
and/orTransaction.deserialize
is needed
Actually there are few more issues that might be cleaned up
- note
Transaction
andTransactionBuilder
provide same functionality. I'd suggest removing mutation methods from Transaction, and keep only signing and serialization logic there. Transaction.sign
mutates underlying message (setFeePayer); rather than that, it should just sign whatever is already there; if fee payer needs to be applied, it might be done during building stage- note the
Transaction
actually might operate on serialized message; this would also solve its problematic lifecycle, with NPE thrown ifserialize
is called withoutsign()
See #78 - it probably was requested for same reason
Take a look at recent commits at my fork: https://github.com/zorba128/solanaj/tree/signatures
Metadata
Metadata
Assignees
Labels
No labels