Skip to content

add Nonce attribute of IssueAsset Transaction#385

Open
zhengq1 wants to merge 1 commit into
DNAProject:masterfrom
zhengq1:IssueAsset-Nonce
Open

add Nonce attribute of IssueAsset Transaction#385
zhengq1 wants to merge 1 commit into
DNAProject:masterfrom
zhengq1:IssueAsset-Nonce

Conversation

@zhengq1

@zhengq1 zhengq1 commented Aug 7, 2017

Copy link
Copy Markdown
Contributor

Signed-off-by: zhengq1 ljqlyy@gmail.com

Comment thread core/transaction/payload/IssueAsset.go Outdated
func (a *IssueAsset) Deserialize(r io.Reader, version byte) error {
var err error
a.Nonce, err = serialization.ReadUint64(r)
if err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cannot judge to err, return err directly.

Comment thread core/transaction/payload/IssueAsset.go Outdated
}

func (a *IssueAsset) Serialize(w io.Writer, version byte) error {
err := serialization.WriteUint64(w, a.Nonce)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cannot judge to err, return err directly.

return serialization.WriteUint64(w, a.Nonce)

Signed-off-by: zhengq1 <ljqlyy@gmail.com>
@zhengq1

zhengq1 commented Aug 9, 2017

Copy link
Copy Markdown
Contributor Author

got it.

@dreamfly281 dreamfly281 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is already a nonce existed in the Transaction header, it looks duplicate to add another nonce field in the payload

@zhengq1

zhengq1 commented Aug 15, 2017

Copy link
Copy Markdown
Contributor Author

Nonce in transaction struct is reserved for balance model, if use UTXO model, transaction which need nonce can add it to payload.

@Arbio5zt

Copy link
Copy Markdown
Member

agree with zhengq1, this nonce is used to allow issuer to create multiple issue transaction with the just same value.

Honglei-Cong pushed a commit to Honglei-Cong/DNA that referenced this pull request Nov 27, 2019
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.

4 participants