Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guarded transactions #77

Merged
merged 7 commits into from
Aug 22, 2022
Merged

Guarded transactions #77

merged 7 commits into from
Aug 22, 2022

Conversation

AdoAdoAdo
Copy link
Contributor

@AdoAdoAdo AdoAdoAdo commented Jul 19, 2022

This PR adds support for guarded transactions:

  • the required field transactions
  • methods to allow the guardian to apply his signature over the user transaction

@dragos-rebegea dragos-rebegea self-requested a review July 19, 2022 07:42
@AdoAdoAdo AdoAdoAdo changed the base branch from main to feat/freeze-account August 22, 2022 10:18
@AdoAdoAdo AdoAdoAdo marked this pull request as ready for review August 22, 2022 10:18
@AdoAdoAdo AdoAdoAdo requested a review from raduchis August 22, 2022 10:21
skBytes []byte,
arg data.ArgCreateTransaction,
) (*data.Transaction, error) {

newArg := arg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don`t we use arg directly and make a copy ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

}, nil
}

func (builder *txBuilder) createUnsignedMessage(arg data.ArgCreateTransaction) ([]byte, error) {
arg.Signature = ""
func TransactionToUnsignedTx(tx *data.Transaction) *data.Transaction {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can be private if we don`t intend to use it anywhere else

Suggested change
func TransactionToUnsignedTx(tx *data.Transaction) *data.Transaction {
func transactionToUnsignedTx(tx *data.Transaction) *data.Transaction {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signature string `json:"signature,omitempty"`
ChainID string `json:"chainID"`
Version uint32 `json:"version"`
Options uint32 `json:"options,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Options uint32 `json:"options,omitempty"`
Options uint32 `json:"options"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need omitempty for backwards compatibility

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AdoAdoAdo AdoAdoAdo merged commit 168a562 into feat/freeze-account Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants