Skip to content

Commit

Permalink
Merge pull request #223 from ergoplatform/develop
Browse files Browse the repository at this point in the history
Release v5.0.2 (with Sigma v5.0.7 and ergo-wallet v5.0.10)
  • Loading branch information
aslesarenko authored May 2, 2023
2 parents f027b75 + 645012b commit a7d5094
Show file tree
Hide file tree
Showing 33 changed files with 129 additions and 96 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Appkit is a foundational non-opinionated library which can be used to create oth
libraries, Apps and tools. Here is the list of projects which use Appkit.

- [Official Ergo Wallet App](https://github.com/ergoplatform/ergo-wallet-app) - a cross-platform wallet for Ergo supporting Android, iOS (via RoboVM) and Desktop (via Kotlin Compose). Can be used as an example of cross-platform application using Appkit.
- [SigmaFi](https://github.com/K-Singh/Sigma-Finance) - A Decentralized P2P Financial Contracts on the Ergo blockchain.
- [ErgoMixer](https://github.com/ergoMixer/ergoMixBack) - a web application for mixing ergs and tokens based on Ergo platform
- [ergo-playgrounds](https://github.com/ergoplatform/ergo-playgrounds) - Run contracts + off-chain code in the browser
- [ErgoGravity](https://github.com/ErgoGravity) - provides the required tools for Ergo platform to be integrated with Gravity network (`gateway-proxy`, `ergo-susy-proxy`, `ergo-luport-executor`, `startup-script`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import org.ergoplatform.appkit.examples.RunMockedScala
import org.ergoplatform.appkit.examples.RunMockedScala.createMockedErgoClient
import org.ergoplatform.appkit.testing.AppkitTesting
import org.ergoplatform.{ErgoAddressEncoder, Pay2SAddress}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.{Matchers, PropSpec}
import scorex.util.encode.Base16
import sigmastate.serialization.ErgoTreeSerializer



class AddressSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks
class AddressSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks
with AppkitTesting {

def checkIsTestnetP2PKAddress(addr: Address) = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package org.ergoplatform.appkit

import java.util

import org.ergoplatform.appkit.BoxOperations.{createProver}
import org.ergoplatform.appkit.BoxOperations.createProver
import org.ergoplatform.appkit.Parameters.MinFee
import org.ergoplatform.appkit.impl.ErgoTreeContract
import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.eval._
import sigmastate.helpers.NegativeTesting
import sigmastate.interpreter.CryptoConstants
import special.sigma.GroupElement

class AnonymousAccessSpec extends PropSpec with Matchers
class AnonymousAccessSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import org.ergoplatform.appkit.examples.ExampleScenarios
import org.ergoplatform.appkit.testing.AppkitTesting
import org.ergoplatform.settings.ErgoAlgos
import org.ergoplatform.validation.ValidationRules
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.Values.SigmaPropConstant
import sigmastate.serialization.ErgoTreeSerializer

class ApiClientSpec
extends PropSpec
extends AnyPropSpec
with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import org.ergoplatform.appkit.JavaHelpers._
import org.ergoplatform.{ErgoScriptPredef, ErgoBox, UnsignedErgoLikeTransaction}
import org.ergoplatform.appkit.impl.{BlockchainContextImpl, InputBoxImpl, UnsignedTransactionBuilderImpl, UnsignedTransactionImpl}
import org.ergoplatform.settings.ErgoAlgos
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import sigmastate.helpers.NegativeTesting
import org.scalatest.{Matchers, PropSpec}
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.TestsBase
import sigmastate.eval.Colls
Expand All @@ -15,7 +16,7 @@ import java.util
import java.util.Collections
import util.{List => JList}

class AppkitProvingInterpreterSpec extends PropSpec
class AppkitProvingInterpreterSpec extends AnyPropSpec
with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTestingCommon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.ergoplatform.appkit

import org.ergoplatform.appkit.babelfee.{BabelFeeBoxContract, BabelFeeBoxState, BabelFeeOperations}
import org.scalatest.{Matchers, PropSpec}
import org.ergoplatform.appkit.babelfee.{BabelFeeOperations, BabelFeeBoxContract, BabelFeeBoxState}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

import java.util
import java.util.Arrays

class BabelFeeSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks
class BabelFeeSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks
with HttpClientTesting
with AppkitTestingCommon {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.ergoplatform.appkit

import org.ergoplatform.appkit.testing.AppkitTesting
import org.ergoplatform.wallet.secrets.{ExtendedPublicKey, ExtendedSecretKey}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

class Bip32SerializationSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks
class Bip32SerializationSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks
with AppkitTesting {

property("Serialization roundtrip") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package org.ergoplatform.appkit

import org.ergoplatform.appkit.impl.BoxAttachmentBuilder
import org.junit.Assert
import org.scalatest.Matchers.{be, convertToAnyShouldWrapper}
import org.scalatest.PropSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec

import java.util.Collections

class BoxAttachmentSpec extends PropSpec {
class BoxAttachmentSpec extends AnyPropSpec with Matchers {

private val textAttachmentContent = "Your loan January"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package org.ergoplatform.appkit

import org.scalatest.{PropSpec, Matchers}
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.eval._
import sigmastate.interpreter.CryptoConstants
import special.sigma.GroupElement
import JavaHelpers._
import java.util.{Arrays, List => JList}

import java.util.{Arrays, List => JList}
import org.ergoplatform.appkit.Parameters.MinFee
import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec

class ChangeOutputSpec extends PropSpec with Matchers
class ChangeOutputSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.ergoplatform.appkit

import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.eval._
import sigmastate.interpreter.CryptoConstants
import special.sigma.GroupElement

class DHTProverSpec extends PropSpec with Matchers
class DHTProverSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.ergoplatform.appkit

import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scorex.util.Random
import sigmastate.interpreter.HintsBag

import java.nio.charset.StandardCharsets

class ErgoAuthSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks
class ErgoAuthSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks
with AppkitTestingCommon {

property("ErgoAuth address round trip") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.ergoplatform.appkit

import scalan.util.FileUtil
import scalan.util.{FileUtil => SFileUtil}
import JavaHelpers._
import org.ergoplatform.appkit

import java.util.{List => JList}
import java.lang.{String => JString}

Expand All @@ -10,11 +12,11 @@ trait HttpClientTesting {
val addr1 = "9f4QF8AD1nQ3nJahQVkMj8hFSVVzVom77b52JU7EW71Zexg6N8v"

def loadNodeResponse(name: String) = {
FileUtil.read(FileUtil.file(s"$responsesDir/node_responses/$name"))
appkit.FileUtil.read(SFileUtil.file(s"$responsesDir/node_responses/$name"))
}

def loadExplorerResponse(name: String) = {
FileUtil.read(FileUtil.file(s"$responsesDir/explorer_responses/$name"))
appkit.FileUtil.read(SFileUtil.file(s"$responsesDir/explorer_responses/$name"))
}

case class MockData(nodeResponses: Seq[String] = Nil, explorerResponses: Seq[String] = Nil) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package org.ergoplatform.appkit

import org.ergoplatform.ErgoBox
import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.{PropSpec, Matchers}
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.Values.{ByteArrayConstant, EvaluatedValue, IntConstant}
import sigmastate.Values.{EvaluatedValue, ByteArrayConstant, IntConstant}
import sigmastate.{SType, TrivialProp}
import sigmastate.helpers.TestingHelpers._
import org.ergoplatform.wallet.mnemonic.{Mnemonic => WMnemonic}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec

class JavaHelpersSpec extends PropSpec with Matchers
class JavaHelpersSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting {
import ErgoBox._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.ergoplatform.appkit

import java.util

import org.ergoplatform.appkit.Mnemonic._
import org.ergoplatform.appkit.MnemonicValidationException.{MnemonicChecksumException, MnemonicEmptyException, MnemonicWordException, MnemonicWrongListSizeException}
import org.ergoplatform.appkit.MnemonicValidationException.{MnemonicWrongListSizeException, MnemonicChecksumException, MnemonicWordException, MnemonicEmptyException}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.{Matchers, PropSpec}

import scala.collection.JavaConverters._

class MnemonicSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks {
class MnemonicSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks {

val testMnemonic = "walnut endorse maid alone fuel jump torch company ahead nice abstract earth pig spice reduce"
val testEntropy: Array[Byte] = Array[Byte](-10, -55, 58, 24, 3, 117, -34, -15, -7, 81, 116, 5, 50, -84, 3, -94, -70, 73, -93, 45)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package org.ergoplatform.appkit

import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.eval._
import sigmastate.interpreter.CryptoConstants
import special.sigma.GroupElement

import scala.util.Try

class MultiProveDHTSpec extends PropSpec with Matchers
class MultiProveDHTSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package org.ergoplatform.appkit

import org.ergoplatform.appkit.testing.AppkitTesting
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import sigmastate.eval._
import sigmastate.interpreter.CryptoConstants
import special.sigma.GroupElement

import scala.util.Try

class MultiProveDlogSpec extends PropSpec with Matchers
class MultiProveDlogSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ package org.ergoplatform.appkit

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import org.ergoplatform.appkit.InputBoxesSelectionException.{InputBoxLimitExceededException, NotEnoughCoinsForChangeException, NotEnoughErgsException}
import org.ergoplatform.appkit.InputBoxesSelectionException.{InputBoxLimitExceededException, NotEnoughErgsException, NotEnoughCoinsForChangeException}
import org.ergoplatform.appkit.JavaHelpers._
import org.ergoplatform.appkit.impl.{Eip4TokenBuilder, ErgoTreeContract}
import org.ergoplatform.appkit.testing.AppkitTesting
import org.ergoplatform.explorer.client.model.{Items, TokenInfo}
import org.ergoplatform.{ErgoBox, ErgoScriptPredef}
import org.ergoplatform.{ErgoScriptPredef, ErgoBox, appkit}
import org.scalacheck.Gen
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scalan.util.FileUtil
import scalan.util.{FileUtil => SFileUtil}
import scorex.util.ModifierId
import sigmastate.eval.CBigInt
import sigmastate.helpers.NegativeTesting
Expand All @@ -23,7 +24,7 @@ import java.util
import java.util.Arrays
import java.util.function.Consumer

class TxBuilderSpec extends PropSpec with Matchers
class TxBuilderSpec extends AnyPropSpec with Matchers
with ScalaCheckDrivenPropertyChecks
with AppkitTesting
with HttpClientTesting
Expand Down Expand Up @@ -461,7 +462,7 @@ class TxBuilderSpec extends PropSpec with Matchers
property("Test changebox token amount max 100") {
val ergoClient = createMockedErgoClient(data)

val tokenList: Items[TokenInfo] = new Gson().fromJson(FileUtil.read(FileUtil.file(s"appkit/src/test/resources/tokens.json")), new TypeToken[Items[TokenInfo]]() {}.getType)
val tokenList: Items[TokenInfo] = new Gson().fromJson(appkit.FileUtil.read(SFileUtil.file(s"appkit/src/test/resources/tokens.json")), new TypeToken[Items[TokenInfo]]() {}.getType)

ergoClient.execute { ctx: BlockchainContext =>
val (storage, _) = loadStorageE2()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package org.ergoplatform.appkit.cli

import org.ergoplatform.appkit.FileMockedErgoClient
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.{PropSpec, Matchers}
import org.ergoplatform.appkit.JavaHelpers._
import java.lang.{String => JString}
import java.util.{List => JList}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec

object TestCliApplication extends CliApplication

class CliApplicationSpec
extends PropSpec
extends AnyPropSpec
with Matchers
with ScalaCheckDrivenPropertyChecks
with ConsoleTesting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.ergoplatform.appkit.cli

import org.ergoplatform.appkit.commands.UsageException
import org.scalatest.{PropSpec, Matchers}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

class CmdLineParserSpec extends PropSpec with Matchers with ScalaCheckDrivenPropertyChecks {
class CmdLineParserSpec extends AnyPropSpec with Matchers with ScalaCheckDrivenPropertyChecks {
import CmdLineParser._

property("parseOptions") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package org.ergoplatform.appkit.cli

import scalan.util.FileUtil
import org.ergoplatform.appkit
import scalan.util.{FileUtil => SFileUtil}
import org.ergoplatform.appkit.JavaHelpers._

import java.util.{List => JList}
import java.lang.{String => JString}

import org.scalatest.Matchers
import org.ergoplatform.appkit.{FileMockedErgoClient, BlockchainContext}
import org.ergoplatform.appkit.FileMockedErgoClient
import org.scalatest.matchers.should.Matchers

trait CommandsTesting extends ConsoleTesting { self: Matchers =>

def responsesDir: String

def loadNodeResponse(name: String) = {
FileUtil.read(FileUtil.file(s"$responsesDir/node_responses/$name"))
appkit.FileUtil.read(SFileUtil.file(s"$responsesDir/node_responses/$name"))
}
def loadExplorerResponse(name: String) = {
FileUtil.read(FileUtil.file(s"$responsesDir/explorer_responses/$name"))
appkit.FileUtil.read(SFileUtil.file(s"$responsesDir/explorer_responses/$name"))
}

def testConfigFile: String
Expand Down
Loading

0 comments on commit a7d5094

Please sign in to comment.