The following PR updates the pallas signer used for mina.
It adds support for stake delegation transactions, in order to test the mina rosetta implementation.
It fixes the default value for the validUntil field of payment transaction (from 0 to max_uint32).
This was tested by running the construction tests on the mina rosetta server with both payment and delegation transactions.
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.
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.
Motivation
The following PR updates the pallas signer used for mina.
validUntil
field of payment transaction (from0
tomax_uint32
). This was tested by running the construction tests on the mina rosetta server with both payment and delegation transactions.Solution
Delegation transactions
The
Transaction
type could already handle various types of transaction and distinguish between them using theTag
field.{false, false, false}
is the first case (payments) and{false,false,true}
the second one (stake delegation). However the parsing step insigner_pallas.go
could only handlePayment
transaction so far so I added theStakeDelelegation
case.The valid_until field
If the
valid_until
field is not specified in the preprocess step, the rosetta server uses the greatestuint32
as a default value. The pallas signer ofrosetta-sdk-go
was defaulting to zero when building the signing payload which resulted in aninvalid signature
error. The greatestuint32
is now used in both cases.