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

Copy link
Copy Markdown
Contributor

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

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.

}

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

Copy link
Copy Markdown
ContributorAuthor

got it.

@dreamfly281dreamfly281 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

Copy link
Copy Markdown
ContributorAuthor

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 freeto 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

@zhengq1@Arbio5zt@dreamfly281@gasby88