-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
builders/txBuilder.go
Outdated
skBytes []byte, | ||
arg data.ArgCreateTransaction, | ||
) (*data.Transaction, error) { | ||
|
||
newArg := arg |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
builders/txBuilder.go
Outdated
}, nil | ||
} | ||
|
||
func (builder *txBuilder) createUnsignedMessage(arg data.ArgCreateTransaction) ([]byte, error) { | ||
arg.Signature = "" | ||
func TransactionToUnsignedTx(tx *data.Transaction) *data.Transaction { |
There was a problem hiding this comment.
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
func TransactionToUnsignedTx(tx *data.Transaction) *data.Transaction { | |
func transactionToUnsignedTx(tx *data.Transaction) *data.Transaction { |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options uint32 `json:"options,omitempty"` | |
Options uint32 `json:"options"` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR adds support for guarded transactions: