Skip to content

Commit

Permalink
polishing #6
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Apr 25, 2022
1 parent db6f718 commit e0f72e5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion papers/emission.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Emission Retargeting Soft-Fork Proposal
Emission Retargeting Soft-Fork Proposal
========================================

* Author: kushti
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4897,13 +4897,13 @@ paths:

/emission/scripts:
get:
summary: Get emission data for a given height
operationId: emissionAt
summary: Print emission-related scripts
operationId: emissionScripts
tags:
- emission
responses:
'200':
description: Emission data
description: Emission-related scripts
content:
application/json:
schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object EmissionApiRoute {
EmissionInfo(minerReward, totalCoinsIssued, totalRemainCoins, reemissionAmt)
}

// todo: add totalReemitted
// todo: add totalReemitted ?
implicit val encoder: Encoder[EmissionInfo] = (ei: EmissionInfo) => Json.obj(
"minerReward" -> Json.fromLong(ei.minerReward),
"totalCoinsIssued" -> Json.fromLong(ei.totalCoinsIssued),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ErgoWallet(historyReader: ErgoHistoryReader, settings: ErgoSettings, param
// and also optimal number of inputs(a selector is collecting dust if transaction has less inputs than optimal).
private val maxInputs = walletSettings.maxInputs
private val optimalInputs = walletSettings.optimalInputs

// if checkEIP27 flag is on, we pass re-emission parameters to box selector
private val reemissionDataOpt = if (walletSettings.checkEIP27) {
val rs = settings.chainSettings.reemission
Some(ReemissionData(rs.reemissionNftId, rs.reemissionTokenId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import scala.util.{Failure, Success, Try}

trait ErgoWalletSupport extends ScorexLogging {

val ergoSettings: ErgoSettings
def ergoSettings: ErgoSettings

private def addressEncoder = ergoSettings.chainSettings.addressEncoder

Expand Down Expand Up @@ -224,7 +224,6 @@ trait ErgoWalletSupport extends ScorexLogging {
candidate
case changeBox: ErgoBoxAssets =>
// todo: is this extra check needed ?

val reemissionTokenId = ergoSettings.chainSettings.reemission.reemissionTokenId
val assets = changeBox.tokens.filterKeys(_ != reemissionTokenId).map(t => Digest32 @@ idToBytes(t._1) -> t._2).toIndexedSeq

Expand Down

0 comments on commit e0f72e5

Please sign in to comment.