-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2084 from ergoplatform/v5.0.18
Candidate for 5.0.18
- Loading branch information
Showing
28 changed files
with
220 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
required_java_version="1.8" | ||
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}') | ||
|
||
if [[ $java_version != $required_java_version* ]]; then | ||
echo "Incompatible Java version: $java_version. Requires 1.8.x." | ||
exit 1 | ||
fi | ||
|
||
rm -rf target | ||
sbt clean assembly | ||
|
||
jar=$(find "target/scala-2.12" -name 'ergo-*.jar' -print -quit) | ||
|
||
if [[ -z $jar ]]; then | ||
echo "Ergo jar not found." | ||
exit 1 | ||
fi | ||
|
||
jar_version=$(echo "$jar" | sed 's/^.*ergo-\(.*\)\.jar$/\1/') | ||
conf_file="src/main/resources/application.conf" | ||
conf_version=$(grep "appVersion =" "$conf_file" | cut -d '=' -f2 | tr -d '[:space:]') | ||
|
||
if [[ -z $conf_version ]]; then | ||
echo "Version not found in application.conf." | ||
exit 1 | ||
fi | ||
|
||
if [[ $conf_version != $jar_version ]]; then | ||
echo "Version mismatch: application.conf ($conf_version) != jar ($jar_version)." | ||
echo "Removing jar $jar" | ||
rm "$jar" | ||
exit 1 | ||
fi | ||
|
||
openapi_files=("openapi.yaml" "openapi-ai.yaml") | ||
|
||
for file in "${openapi_files[@]}"; do | ||
openapi_path="src/main/resources/api/$file" | ||
version_line=$(grep 'version:' "$openapi_path") | ||
|
||
if [[ -z $version_line ]]; then | ||
echo "Error: Version line not found in $openapi_path" | ||
exit 1 | ||
fi | ||
|
||
actual_version=$(echo $version_line | awk -F '"' '{print $2}') | ||
|
||
if [[ -z $actual_version ]]; then | ||
echo "Error: Version not found in $openapi_path" | ||
exit 1 | ||
fi | ||
|
||
if [[ $actual_version != $jar_version ]]; then | ||
echo "Version mismatch in $openapi_path: ($actual_version) != jar ($jar_version)." | ||
echo "Removing jar $jar" | ||
rm "$jar" | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "do-release completed successfully" |
55 changes: 0 additions & 55 deletions
55
ergo-core/src/main/scala/org/ergoplatform/NodeViewModifier.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
ergo-core/src/main/scala/org/ergoplatform/modifiers/BlockSection.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 47 additions & 2 deletions
49
ergo-core/src/main/scala/org/ergoplatform/modifiers/ErgoNodeViewModifier.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,61 @@ | ||
package org.ergoplatform.modifiers | ||
|
||
import org.ergoplatform.core.BytesSerializable | ||
import org.ergoplatform.utils.ScorexEncoding | ||
import scorex.util.{ModifierId, bytesToId} | ||
import scorex.utils.Ints | ||
|
||
trait ErgoNodeViewModifier { self: BytesSerializable => | ||
/** | ||
* Basic trait for entities which are modifying internal blockchain view of the node, such as | ||
* unconfirmed transactions, block sections | ||
*/ | ||
trait ErgoNodeViewModifier extends BytesSerializable with ScorexEncoding { | ||
|
||
/** | ||
* @return cryptographically strong unique identifier of an object | ||
*/ | ||
def serializedId: Array[Byte] | ||
|
||
/** | ||
* identifier which can is friendly to data structures such as maps etc | ||
*/ | ||
lazy val id: ModifierId = bytesToId(serializedId) | ||
|
||
/** | ||
* Type of node view modifier (transaction, header etc) | ||
*/ | ||
val modifierTypeId: NetworkObjectTypeId.Value | ||
|
||
/** | ||
* Size of binary representation provided during object construction (to avoid serialization just to get the value) | ||
*/ | ||
val sizeOpt: Option[Int] | ||
|
||
/** | ||
* Cached size of binary representation | ||
*/ | ||
lazy val size: Int = sizeOpt.getOrElse(bytes.length) | ||
|
||
def serializedId: Array[Byte] | ||
/** | ||
* @return readable representation of `id`, as `id` is a hex-encoded string now, just identity functions is used | ||
*/ | ||
def encodedId: String = id | ||
|
||
override def equals(obj: scala.Any): Boolean = obj match { | ||
case that: ErgoNodeViewModifier => (that.id == id) && (that.modifierTypeId == modifierTypeId) | ||
case _ => false | ||
} | ||
|
||
override def hashCode(): Int = { | ||
Ints.fromByteArray(serializedId) | ||
} | ||
|
||
} | ||
|
||
object ErgoNodeViewModifier { | ||
/** | ||
* It is assumed that all the modifiers (offchain transactions, blocks, blockheaders etc) | ||
* have identifiers of the some length fixed with the ModifierIdSize constant | ||
*/ | ||
val ModifierIdSize: Int = 32 // in bytes | ||
} |
12 changes: 12 additions & 0 deletions
12
ergo-core/src/main/scala/org/ergoplatform/modifiers/TransactionsCarryingBlockSection.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.ergoplatform.modifiers | ||
|
||
import org.ergoplatform.modifiers.mempool.ErgoTransaction | ||
|
||
/** | ||
* Block section which contains transactions | ||
*/ | ||
trait TransactionsCarryingBlockSection extends BlockSection { | ||
|
||
def transactions: Seq[ErgoTransaction] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
ergo-core/src/main/scala/org/ergoplatform/modifiers/transaction/Signable.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.ergoplatform.modifiers.transaction | ||
|
||
|
||
/** | ||
* A basic trait for entities which can be signed | ||
*/ | ||
trait Signable { | ||
|
||
/** | ||
* Bytes to be signed | ||
*/ | ||
val messageToSign: Array[Byte] | ||
|
||
} |
18 changes: 0 additions & 18 deletions
18
ergo-core/src/main/scala/org/ergoplatform/modifiers/transaction/Transaction.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.