Skip to content

Mgpai22/logic refactor#44

Open
mgpai22 wants to merge 9 commits intomainfrom
mgpai22/logic-refactor
Open

Mgpai22/logic refactor#44
mgpai22 wants to merge 9 commits intomainfrom
mgpai22/logic-refactor

Conversation

@mgpai22
Copy link
Copy Markdown
Member

@mgpai22 mgpai22 commented Sep 17, 2024

No description provided.

@mgpai22
Copy link
Copy Markdown
Member Author

mgpai22 commented Sep 17, 2024

Loops were used for trivial reasons

  • Made initialization tx less complex/cheaper
  • Made tx building easier
  • serves as a good open source example for the community

val minerFeeErgoTreeHash: Coll[Byte] = fromBase16("e540cceffd3b8dd0f401193576cc413467039695969427df94454193dddfb375")
val ergonameCollectionTokenId: Coll[Byte] = SELF.tokens(1)._1
val ergonameCollectionTokenAmount: Long = SELF.tokens(1)._2
val ergonameCollectionTokenAmount = SELF.tokens.fold(0L, { (sum: Long, t: (Coll[Byte], Long)) =>
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.

Could just use filter?

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.

Or is it possible for same token to be in different sections of the tokens collection?

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.

2 participants