coinbase / mesh-sdk-go

Mesh Client Go SDK
Apache License 2.0
196 stars 135 forks source link

Pallas signer stake delegation #464

Open Sventimir opened 1 year ago

Sventimir commented 1 year ago

Motivation

The following PR updates the pallas signer used for mina.

Solution

Delegation transactions

The Transaction type could already handle various types of transaction and distinguish between them using the Tag field. {false, false, false} is the first case (payments) and {false,false,true} the second one (stake delegation). However the parsing step in signer_pallas.go could only handle Payment transaction so far so I added the StakeDelelegation case.

The valid_until field

If the valid_until field is not specified in the preprocess step, the rosetta server uses the greatest uint32 as a default value. The pallas signer of rosetta-sdk-go was defaulting to zero when building the signing payload which resulted in an invalid signature error. The greatest uint32 is now used in both cases.

Sventimir commented 1 year ago

This is the duplicate of #457 , which should be closed in favour of this PR. The reason for this is that @ylecornec no longer works on it and we won't be able to make changes to his PR if so requested.