mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Defining bitwise operations
This commit is contained in:
parent
a062ac8e14
commit
d3e8f3ee0b
@ -0,0 +1,22 @@
|
||||
package org.scalacoin.script.bitwise
|
||||
|
||||
import org.scalacoin.script.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
||||
*/
|
||||
sealed trait BitwiseOperation extends ScriptOperation
|
||||
|
||||
/**
|
||||
* Returns 1 if the inputs are exactly equal, 0 otherwise.
|
||||
*/
|
||||
case object OP_EQUAL extends ScriptOperation {
|
||||
override def opCode = 135
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as OP_EQUAL, but runs OP_VERIFY afterward.
|
||||
*/
|
||||
case object OP_EQUALVERIFY extends ScriptOperation {
|
||||
override def opCode = 136
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package org.scalacoin.script.bitwise
|
||||
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
||||
*/
|
||||
class BitwiseOperationsTest extends FlatSpec with MustMatchers {
|
||||
|
||||
|
||||
"BitwiseOperations" must "define OP_EQUAL" in {
|
||||
OP_EQUAL.opCode must be (135)
|
||||
}
|
||||
|
||||
it must "define OP_EQUALVERIFY" in {
|
||||
OP_EQUALVERIFY.opCode must be (136)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user