Skip to content

Commit

Permalink
NODE-2369: Add the old price mode for OrderV4 (wavesplatform#3599)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 authored Jan 13, 2022
1 parent 38707d0 commit 39070ec
Show file tree
Hide file tree
Showing 25 changed files with 1,508 additions and 1,052 deletions.
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version = "2.0.1"
version = "3.2.2"
runner.dialect = scala213source3
style = defaultWithAlign
assumeStandardLibraryStripMargin = true
maxColumn = 150
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,9 @@ class SmartNoSmartBenchmark {
object SmartNoSmartBenchmark {
@State(Scope.Benchmark)
class ExchangeTransactionSt {
val buy = Order(
TxVersion.V2,
PublicKey.fromBase58String("BqeJY8CP3PeUDaByz57iRekVUGtLxoow4XxPvXfHynaZ").explicitGet(),
PublicKey.fromBase58String("Fvk5DXmfyWVZqQVBowUBMwYtRAHDtdyZNNeRrwSjt6KP").explicitGet(),
AssetPair.createAssetPair("WAVES", "9ZDWzK53XT5bixkmMwTJi2YzgxCqn5dUajXFcT2HcFDy").get,
OrderType.BUY,
2,
6000000000L,
1526992336241L,
1529584336241L,
1,
proofs = Proofs(Seq(ByteStr.decodeBase58("2bkuGwECMFGyFqgoHV4q7GRRWBqYmBFWpYRkzgYANR4nN2twgrNaouRiZBqiK2RJzuo9NooB9iRiuZ4hypBbUQs").get))
)
val buy = Order(TxVersion.V2, PublicKey.fromBase58String("BqeJY8CP3PeUDaByz57iRekVUGtLxoow4XxPvXfHynaZ").explicitGet(), PublicKey.fromBase58String("Fvk5DXmfyWVZqQVBowUBMwYtRAHDtdyZNNeRrwSjt6KP").explicitGet(), AssetPair.createAssetPair("WAVES", "9ZDWzK53XT5bixkmMwTJi2YzgxCqn5dUajXFcT2HcFDy").get, OrderType.BUY, 2, 6000000000L, 1526992336241L, 1529584336241L, 1, proofs = Proofs(Seq(ByteStr.decodeBase58("2bkuGwECMFGyFqgoHV4q7GRRWBqYmBFWpYRkzgYANR4nN2twgrNaouRiZBqiK2RJzuo9NooB9iRiuZ4hypBbUQs").get)))

val sell = Order(
TxVersion.V1,
PublicKey.fromBase58String("7E9Za8v8aT6EyU1sX91CVK7tWUeAetnNYDxzKZsyjyKV").explicitGet(),
PublicKey.fromBase58String("Fvk5DXmfyWVZqQVBowUBMwYtRAHDtdyZNNeRrwSjt6KP").explicitGet(),
AssetPair.createAssetPair("WAVES", "9ZDWzK53XT5bixkmMwTJi2YzgxCqn5dUajXFcT2HcFDy").get,
OrderType.SELL,
3,
5000000000L,
1526992336241L,
1529584336241L,
2,
proofs = Proofs(ByteStr.decodeBase58("2R6JfmNjEnbXAA6nt8YuCzSf1effDS4Wkz8owpCD9BdCNn864SnambTuwgLRYzzeP5CAsKHEviYKAJ2157vdr5Zq").get)
)
val sell = Order(TxVersion.V1, PublicKey.fromBase58String("7E9Za8v8aT6EyU1sX91CVK7tWUeAetnNYDxzKZsyjyKV").explicitGet(), PublicKey.fromBase58String("Fvk5DXmfyWVZqQVBowUBMwYtRAHDtdyZNNeRrwSjt6KP").explicitGet(), AssetPair.createAssetPair("WAVES", "9ZDWzK53XT5bixkmMwTJi2YzgxCqn5dUajXFcT2HcFDy").get, OrderType.SELL, 3, 5000000000L, 1526992336241L, 1529584336241L, 2, proofs = Proofs(ByteStr.decodeBase58("2R6JfmNjEnbXAA6nt8YuCzSf1effDS4Wkz8owpCD9BdCNn864SnambTuwgLRYzzeP5CAsKHEviYKAJ2157vdr5Zq").get))

val proofs = Proofs(Seq(ByteStr.decodeBase58("5NxNhjMrrH5EWjSFnVnPbanpThic6fnNL48APVAkwq19y2FpQp4tNSqoAZgboC2ykUfqQs9suwBQj6wERmsWWNqa").get))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.concurrent.duration.Duration
import com.wavesplatform.account.Address
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.test.{FlatSpec, TestTime}
import com.wavesplatform.transaction.Asset.{IssuedAsset, Waves}
import com.wavesplatform.transaction.Asset.Waves
import com.wavesplatform.BlockchainStubHelpers
import com.wavesplatform.api.common.{CommonTransactionsApi, TransactionMeta}
import com.wavesplatform.api.grpc.TransactionsApiGrpcImpl
Expand All @@ -16,7 +16,6 @@ import com.wavesplatform.lang.ValidationError
import com.wavesplatform.protobuf.transaction.PBTransactions
import com.wavesplatform.state.{Blockchain, Height}
import com.wavesplatform.transaction.{Asset, CreateAliasTransaction, Transaction, TxHelpers, TxVersion}
import com.wavesplatform.transaction.assets.exchange.{AssetPair, Order, OrderType}
import com.wavesplatform.transaction.smart.script.trace.TracedResult
import com.wavesplatform.transaction.TransactionType.TransactionType
import com.wavesplatform.transaction.utils.EthTxGenerator
Expand All @@ -39,39 +38,7 @@ class GRPCBroadcastSpec
val FakeTime: TestTime = TestTime(100)

"GRPC broadcast" should "accept Exchange with ETH orders" in {
val ethBuyOrder = Order(
Order.V4,
TestEthOrdersPublicKey,
TxHelpers.matcher.publicKey,
AssetPair(IssuedAsset(ByteStr(EthStubBytes32)), Waves),
OrderType.BUY,
1,
100L,
1,
123,
100000,
Waves,
eip712Signature = EthSignature(
"0xe5ff562bfb0296e95b631365599c87f1c5002597bf56a131f289765275d2580f5344c62999404c37cd858ea037328ac91eca16ad1ce69c345ebb52fde70b66251c"
)
)

val ethSellOrder = Order(
Order.V4,
TestEthOrdersPublicKey,
TxHelpers.matcher.publicKey,
AssetPair(IssuedAsset(ByteStr(EthStubBytes32)), Waves),
OrderType.SELL,
1,
100L,
1,
123,
100000,
Waves,
eip712Signature = EthSignature(
"0xc8ba2bdafd27742546b3be34883efc51d6cdffbb235798d7b51876c6854791f019b0522d7a39b6f2087cba46ae86919b71a2d9d7920dfc8e00246d8f02a258f21b"
)
)
import com.wavesplatform.transaction.assets.exchange.EthOrderSpec.{ethBuyOrder, ethSellOrder}

val blockchain = createBlockchainStub { blockchain =>
val sh = StubHelpers(blockchain)
Expand Down
Loading

0 comments on commit 39070ec

Please sign in to comment.