mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Add unit test for isHex and add to CHANGELOG.md
This commit is contained in:
parent
5fb1e492fb
commit
4366f72fe1
@ -2,6 +2,7 @@
|
||||
|
||||
## Current Master
|
||||
|
||||
- Add a check for improper Transaction data.
|
||||
- Increase default max gas to `100000` over the RPC's `estimateGas` response.
|
||||
|
||||
## 2.13.4 2016-10-17
|
||||
|
@ -227,5 +227,22 @@ describe('util', function() {
|
||||
assert.equal(result.toString(10), '1111000000000000000', 'accepts decimals')
|
||||
})
|
||||
})
|
||||
describe('#isHex', function(){
|
||||
it('should return true when given a hex string', function() {
|
||||
var result = util.isHex('c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2')
|
||||
assert.equal(result, true)
|
||||
})
|
||||
|
||||
it('should return false when given a non-hex string', function() {
|
||||
var result = util.isHex('c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714imnotreal')
|
||||
assert.equal(result, false)
|
||||
})
|
||||
|
||||
it('should return false when given a string containing a non letter/number character', function() {
|
||||
var result = util.isHex('c3ab8ff13720!8ad9047dd39466b3c%8974e592c2fa383d4a396071imnotreal')
|
||||
assert.equal(result, false)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user