@@ -26,7 +26,7 @@ class NodeHttpApi(apiUri: Uri, backend: SttpBackend[Identity, ?], apiKeyValue: S
2626 extends IntegrationTestEventually
2727 with Matchers
2828 with ScorexLogging {
29- def blockHeader (atHeight : Int )(implicit loggingOptions : LoggingOptions = LoggingOptions ()): Option [BlockHeaderResponse ] = {
29+ def blockHeader (atHeight : Height )(implicit loggingOptions : LoggingOptions = LoggingOptions ()): Option [BlockHeaderResponse ] = {
3030 if (loggingOptions.logRequest) log.debug(s " ${loggingOptions.prefix} blockHeader( $atHeight) " )
3131 basicRequest
3232 .get(uri " $apiUri/blocks/headers/at/ $atHeight" )
@@ -45,7 +45,7 @@ class NodeHttpApi(apiUri: Uri, backend: SttpBackend[Identity, ?], apiKeyValue: S
4545 }
4646 }
4747
48- def waitForHeight (atLeast : Int )(implicit loggingOptions : LoggingOptions = LoggingOptions ()): Height = {
48+ def waitForHeight (atLeast : Height )(implicit loggingOptions : LoggingOptions = LoggingOptions ()): Height = {
4949 if (loggingOptions.logCall) log.debug(s " ${loggingOptions.prefix} waitForHeight( $atLeast) " )
5050 val subsequentLoggingOptions = loggingOptions.copy(logCall = false , logResult = false , logRequest = false )
5151 val currHeight = height()(using subsequentLoggingOptions)
@@ -258,7 +258,8 @@ object NodeHttpApi {
258258
259259 case class HeightResponse (height : Height )
260260 object HeightResponse {
261- implicit val heightResponseFormat : OFormat [HeightResponse ] = Json .format[HeightResponse ]
261+ given Reads [Height ] = Reads .IntReads .map(Height .apply)
262+ given OFormat [HeightResponse ] = Json .format[HeightResponse ]
262263 }
263264
264265 case class BroadcastResponse (id : String )
@@ -268,7 +269,8 @@ object NodeHttpApi {
268269
269270 case class TransactionInfoResponse (height : Height , applicationStatus : String )
270271 object TransactionInfoResponse {
271- implicit val transactionInfoResponseFormat : OFormat [TransactionInfoResponse ] = Json .format[TransactionInfoResponse ]
272+ given Reads [Height ] = Reads .IntReads .map(Height .apply)
273+ given OFormat [TransactionInfoResponse ] = Json .format[TransactionInfoResponse ]
272274 }
273275
274276 case class BalanceResponse (balance : Long )
0 commit comments