aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/sig-util.js
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2017-02-28 02:36:48 +0800
committerGitHub <noreply@github.com>2017-02-28 02:36:48 +0800
commit5edb3db96939de2dee31fa19cb8e715dc649bfd6 (patch)
tree1509d7fd69ac6dee6fd466286cf85524ac7887f2 /app/scripts/lib/sig-util.js
parentca5cf06ae9e3e417dd3488bb0d94cdeec74ca18c (diff)
parentab01fef1c0ffddf09a20f90a910e5e068cf8c71e (diff)
downloadtangerine-wallet-browser-5edb3db96939de2dee31fa19cb8e715dc649bfd6.tar.gz
tangerine-wallet-browser-5edb3db96939de2dee31fa19cb8e715dc649bfd6.tar.zst
tangerine-wallet-browser-5edb3db96939de2dee31fa19cb8e715dc649bfd6.zip
Merge branch 'master' into i1144-moarrpc
Diffstat (limited to 'app/scripts/lib/sig-util.js')
-rw-r--r--app/scripts/lib/sig-util.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/app/scripts/lib/sig-util.js b/app/scripts/lib/sig-util.js
deleted file mode 100644
index 193dda381..000000000
--- a/app/scripts/lib/sig-util.js
+++ /dev/null
@@ -1,28 +0,0 @@
-const ethUtil = require('ethereumjs-util')
-
-module.exports = {
-
- concatSig: function (v, r, s) {
- const rSig = ethUtil.fromSigned(r)
- const sSig = ethUtil.fromSigned(s)
- const vSig = ethUtil.bufferToInt(v)
- const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64)
- const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64)
- const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig))
- return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex')
- },
-
- normalize: function (address) {
- if (!address) return
- return ethUtil.addHexPrefix(address.toLowerCase())
- },
-
-}
-
-function padWithZeroes (number, length) {
- var myString = '' + number
- while (myString.length < length) {
- myString = '0' + myString
- }
- return myString
-}