diff --git a/it/src/main/scala/com/wavesplatform/it/TransferSending.scala b/it/src/main/scala/com/wavesplatform/it/TransferSending.scala index ea4e9a45aff..08ead945efa 100644 --- a/it/src/main/scala/com/wavesplatform/it/TransferSending.scala +++ b/it/src/main/scala/com/wavesplatform/it/TransferSending.scala @@ -10,7 +10,7 @@ import com.wavesplatform.state.EitherExt2 import com.wavesplatform.utils.{Base58, ScorexLogging} import org.scalatest.Suite import com.wavesplatform.account.{Address, AddressOrAlias, AddressScheme, PrivateKeyAccount} -import com.wavesplatform.api.http.assets.SignedTransferV1Request +import com.wavesplatform.api.http.assets.SignedTransferV2Request import com.wavesplatform.transaction.transfer._ import scala.concurrent.Future @@ -110,7 +110,7 @@ trait TransferSending extends ScorexLogging { .map { case (x, i) => createSignedTransferRequest( - TransferTransactionV1 + TransferTransactionV2 .selfSigned( assetId = None, sender = PrivateKeyAccount.fromSeed(x.senderSeed).explicitGet(), @@ -121,7 +121,8 @@ trait TransferSending extends ScorexLogging { feeAmount = x.fee, attachment = if (includeAttachment) { Array.fill(TransferTransaction.MaxAttachmentSize)(ThreadLocalRandom.current().nextInt().toByte) - } else Array.emptyByteArray + } else Array.emptyByteArray, + version = 2 ) .right .get) @@ -134,18 +135,19 @@ trait TransferSending extends ScorexLogging { .map(_.flatten) } - protected def createSignedTransferRequest(tx: TransferTransactionV1): SignedTransferV1Request = { + protected def createSignedTransferRequest(tx: TransferTransactionV2): SignedTransferV2Request = { import tx._ - SignedTransferV1Request( + SignedTransferV2Request( Base58.encode(tx.sender.publicKey), assetId.map(_.base58), recipient.stringRepr, amount, - fee, feeAssetId.map(_.base58), + fee, timestamp, + 2, attachment.headOption.map(_ => Base58.encode(attachment)), - signature.base58 + proofs.base58().toList ) } diff --git a/it/src/main/scala/com/wavesplatform/it/api/AsyncHttpApi.scala b/it/src/main/scala/com/wavesplatform/it/api/AsyncHttpApi.scala index 5b47727674d..99aa8b7d57a 100644 --- a/it/src/main/scala/com/wavesplatform/it/api/AsyncHttpApi.scala +++ b/it/src/main/scala/com/wavesplatform/it/api/AsyncHttpApi.scala @@ -273,7 +273,7 @@ object AsyncHttpApi extends Assertions { def signedIssue(issue: SignedIssueV1Request): Future[Transaction] = postJson("/assets/broadcast/issue", issue).as[Transaction] - def batchSignedTransfer(transfers: Seq[SignedTransferV1Request], timeout: FiniteDuration = 1.minute): Future[Seq[Transaction]] = { + def batchSignedTransfer(transfers: Seq[SignedTransferV2Request], timeout: FiniteDuration = 1.minute): Future[Seq[Transaction]] = { val request = _post(s"${n.nodeApiEndpoint}/assets/broadcast/batch-transfer") .setHeader("Content-type", "application/json") .withApiKey(n.apiKey) diff --git a/it/src/test/scala/com/wavesplatform/it/sync/matcher/OrdersFromScriptedAccTestSuite.scala b/it/src/test/scala/com/wavesplatform/it/sync/matcher/OrdersFromScriptedAccTestSuite.scala index 7c4e73e137b..ab3643bbe01 100644 --- a/it/src/test/scala/com/wavesplatform/it/sync/matcher/OrdersFromScriptedAccTestSuite.scala +++ b/it/src/test/scala/com/wavesplatform/it/sync/matcher/OrdersFromScriptedAccTestSuite.scala @@ -88,7 +88,7 @@ class OrdersFromScriptedAccTestSuite // sell order should be in the aliceNode orderbook matcherNode.fullOrderHistory(aliceNode).head.status shouldBe "Accepted" - + // Bob gets error message assertBadRequestAndResponse( matcherNode diff --git a/it/src/test/scala/com/wavesplatform/it/sync/transactions/TransferTransactionV1Suite.scala b/it/src/test/scala/com/wavesplatform/it/sync/transactions/TransferTransactionV1Suite.scala index 7d86c132e2e..18432401be1 100644 --- a/it/src/test/scala/com/wavesplatform/it/sync/transactions/TransferTransactionV1Suite.scala +++ b/it/src/test/scala/com/wavesplatform/it/sync/transactions/TransferTransactionV1Suite.scala @@ -1,6 +1,5 @@ package com.wavesplatform.it.sync.transactions -import com.wavesplatform.it.TransferSending import com.wavesplatform.it.api.SyncHttpApi._ import com.wavesplatform.it.sync._ import com.wavesplatform.it.transactions.BaseTransactionSuite @@ -15,7 +14,7 @@ import com.wavesplatform.transaction.transfer._ import scala.concurrent.duration._ -class TransferTransactionV1Suite extends BaseTransactionSuite with TransferSending with CancelAfterFailure { +class TransferTransactionV1Suite extends BaseTransactionSuite with CancelAfterFailure { test("asset transfer changes sender's and recipient's asset balance; issuer's.waves balance is decreased by fee") { val (firstBalance, firstEffBalance) = notMiner.accountBalances(firstAddress)