-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
326 additions
and
229 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
20 changes: 0 additions & 20 deletions
20
lang/shared/src/main/scala/com/wavesplatform/lang/Testing.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
18 changes: 18 additions & 0 deletions
18
lang/testkit/src/main/scala/com/wavesplatform/lang/Testing.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,18 @@ | ||
package com.wavesplatform.lang | ||
import com.wavesplatform.common.state.ByteStr | ||
import com.wavesplatform.common.utils.EitherExt2 | ||
import com.wavesplatform.lang.v1.compiler.Terms.* | ||
|
||
object Testing { | ||
|
||
def evaluated(i: Any): Either[ExecutionError, EVALUATED] = i match { | ||
case s: String => CONST_STRING(s) | ||
case s: Long => Right(CONST_LONG(s)) | ||
case s: Int => Right(CONST_LONG(s)) | ||
case s: ByteStr => CONST_BYTESTR(s) | ||
case s: CaseObj => Right(s) | ||
case s: Boolean => Right(CONST_BOOLEAN(s)) | ||
case a: Seq[?] => ARR(a.map(x => evaluated(x).explicitGet()).toIndexedSeq, false) | ||
case _ => Left("Bad Assert: unexpected type") | ||
} | ||
} |
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
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
8 changes: 4 additions & 4 deletions
8
node/src/main/scala/com/wavesplatform/state/diffs/LeaseTransactionsDiff.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,17 +1,17 @@ | ||
package com.wavesplatform.state.diffs | ||
|
||
import com.wavesplatform.lang.ValidationError | ||
import com.wavesplatform.state._ | ||
import com.wavesplatform.transaction.lease._ | ||
import com.wavesplatform.state.* | ||
import com.wavesplatform.transaction.lease.* | ||
|
||
object LeaseTransactionsDiff { | ||
def lease(blockchain: Blockchain)(tx: LeaseTransaction): Either[ValidationError, Diff] = | ||
DiffsCommon | ||
.processLease(blockchain, tx.amount.value, tx.sender, tx.recipient, tx.fee.value, tx.id(), tx.id()) | ||
.map(_.copy(scriptsRun = DiffsCommon.countScriptRuns(blockchain, tx))) | ||
.map(_.withScriptRuns(DiffsCommon.countScriptRuns(blockchain, tx))) | ||
|
||
def leaseCancel(blockchain: Blockchain, time: Long)(tx: LeaseCancelTransaction): Either[ValidationError, Diff] = | ||
DiffsCommon | ||
.processLeaseCancel(blockchain, tx.sender, tx.fee.value, time, tx.leaseId, tx.id()) | ||
.map(_.copy(scriptsRun = DiffsCommon.countScriptRuns(blockchain, tx))) | ||
.map(_.withScriptRuns(DiffsCommon.countScriptRuns(blockchain, tx))) | ||
} |
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
Oops, something went wrong.