Skip to content

Commit

Permalink
Merge pull request #46 from wavesplatform/SC-635-remove-unused-name
Browse files Browse the repository at this point in the history
SC-635-remove-unused-name
  • Loading branch information
KardanovIR committed Jun 18, 2020
2 parents 9460199 + 3643e46 commit f8be665
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions dApps/bankCredit/ride/account_lock.ride
Expand Up @@ -9,11 +9,11 @@ let BANK = base58'3MpFRn3X9ZqcLimFoqNeZwPBnwP7Br5Fmgs'


let TARGETHEIGHT = match( getInteger(Address(BANK), toBase58String(tx.sender.bytes) + "_target")){
case x: Unit => 0
case _: Unit => 0
case x: Int => x
}
let status = match( getString(Address(BANK), toBase58String(tx.sender.bytes) + "_status")){
case x: Unit => "unset"
case _: Unit => "unset"
case x: String => x
}

Expand All @@ -29,7 +29,7 @@ if (height > TARGETHEIGHT && status == "borrowed") then {
# In any other case forbid SetScript
}else {
match (tx){
case t: SetScriptTransaction => false
case _: SetScriptTransaction => false
case _ => sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
}
}
Expand Down
12 changes: 6 additions & 6 deletions dApps/bankCredit/ride/bank_dapp.ride
Expand Up @@ -23,15 +23,15 @@ func getMoney() = {
let callerStr = toBase58String(i.caller.bytes)

let status = match( this.getString(callerStr + "_status")){
case x: Unit => "unset"
case _: Unit => "unset"
case x: String => x
}

let lockTxId = this.getString(callerStr + "_lockScriptId").extract()
let lockTx = transactionHeightById(fromBase58String(lockTxId))

let isLockSet = match (lockTx) {
case t: Int => true
case _: Int => true
case _ => throw("Lock has not been set")
}

Expand All @@ -52,7 +52,7 @@ func getMoney() = {
func returnMoney() = {
let callerStr = toBase58String(i.caller.bytes)
let status = match( this.getString(callerStr + "_status")){
case x: Unit => "unset"
case _: Unit => "unset"
case x: String => x
}

Expand All @@ -73,7 +73,7 @@ func returnMoney() = {
func cancelContract() = {
let callerStr = toBase58String(i.caller.bytes)
let status = match( this.getString(callerStr + "_status")){
case x: Unit => "unset"
case _: Unit => "unset"
case x: String => x
}
if(status == "approved" || status == "unset") then WriteSet([DataEntry(callerStr + "_status", "canceled")])
Expand All @@ -83,8 +83,8 @@ func cancelContract() = {
@Verifier(tx)
func verify() = {
match(tx) {
case t:DataTransaction => false
case t:SetScriptTransaction => false
case _:DataTransaction => false
case _:SetScriptTransaction => false
case _ => sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
}
}
4 changes: 2 additions & 2 deletions dApps/momentaryLottery/ride/momentaryLottery.ride
Expand Up @@ -18,7 +18,7 @@
func randomizer(inv: Invocation) = {
let lastPlay = match getBinary(this, "lastPlay") {
case s:ByteVector => s
case a:Unit => base64'V2F2ZXNMb3R0b1Yy'
case _:Unit => base64'V2F2ZXNMb3R0b1Yy'
}

let rand = lastPlay + inv.transactionId + inv.callerPublicKey + lastBlock.generationSignature + toBytes(lastBlock.timestamp) + toBytes(lastBlock.height)
Expand Down Expand Up @@ -57,4 +57,4 @@ func lotto() = {
@Callable(inv)
func default() = {
startLotto(inv)
}
}
4 changes: 2 additions & 2 deletions smart-assets/MainCoinsTrade.ride
Expand Up @@ -19,6 +19,6 @@ let EURId = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU'
match tx {
case e : ExchangeTransaction =>
e.sellOrder.assetPair.priceAsset == BTCId || e.sellOrder.assetPair.priceAsset == ETHId || e.sellOrder.assetPair.priceAsset == LTCId || e.sellOrder.assetPair.priceAsset == ZECId || e.sellOrder.assetPair.priceAsset == DASHId || e.sellOrder.assetPair.priceAsset == XMRId || e.sellOrder.assetPair.priceAsset == USDId || e.sellOrder.assetPair.priceAsset == EURId
case t:TransferTransaction | MassTransferTransaction | BurnTransaction => false
case _:TransferTransaction | MassTransferTransaction | BurnTransaction => false
case _ => true
}
}
2 changes: 1 addition & 1 deletion smart-assets/Medal.ride
Expand Up @@ -18,6 +18,6 @@ match tx {
t.sender == master || t.recipient == master
case mt: MassTransferTransaction =>
mt.sender == master
case ex: ExchangeTransaction => false
case _: ExchangeTransaction => false
case _ => true
}
4 changes: 2 additions & 2 deletions smart-assets/ScheduleTrade.ride
Expand Up @@ -78,7 +78,7 @@

let timeOracleAddress = Address(base58'3P4V5znH4AvkpNVZ2EKSmkdSCeJppsZ4x8F')
match (tx) {
case tx:ExchangeTransaction =>
case _:ExchangeTransaction =>
let mondayTradeStart = extract(getInteger(timeOracleAddress, "mondayTradeStart"))
let mondayTradeEnd = extract(getInteger(timeOracleAddress, "mondayTradeEnd"))
let tuesdayTradeStart = extract(getInteger(timeOracleAddress, "tuesdayTradeStart"))
Expand All @@ -94,4 +94,4 @@ match (tx) {
(height >= wednesdayTradeStart && height <= wednesdayTradeEnd) || (height >= thursdayTradeStart && height <= thursdayTradeEnd)||
(height >= fridayTradeStart && height <= fridayTradeEnd)
case _ => true
}
}

0 comments on commit f8be665

Please sign in to comment.