Skip to content

Commit

Permalink
Separate field for AssetPair key
Browse files Browse the repository at this point in the history
  • Loading branch information
koloale committed May 23, 2017
1 parent 26521c2 commit 8b58ab6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@ object OrderHistoryStorage {
type AssetPairAddressKey = String
type AssetPairAddressListKey = String

def assetPairAddressListKey(pairAddressKey: AssetPairAddressKey, index: Long): String = pairAddressKey + index

def assetPairAddressListKey(assetPair: AssetPair, address: String, index: Long): AssetPairAddressListKey =
assetPair.toString + address + index.toString

def assetPairAddressKey(assetPair: AssetPair, address: String): AssetPairAddressKey = assetPair.toString + address
def assetPairAddressKey(assetPair: AssetPair, address: String): AssetPairAddressKey = assetPair.key + address
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ case class AssetPair(@ApiModelProperty(dataType = "java.lang.String") amountAsse
}
}

override def toString: String = amountAssetStr + "-" + priceAssetStr
override def toString: String = key

def key: String = amountAssetStr + "-" + priceAssetStr

def isValid: Validation = {
!ByteArrayExtension.sameOption(amountAsset, priceAsset) :| "Invalid AssetPair"
Expand Down

0 comments on commit 8b58ab6

Please sign in to comment.