Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

Commit eb7ae3c

Browse files
committed
Add additional signing + hashing api tests.
1 parent 1583bea commit eb7ae3c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/api.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,21 @@ tape('[Transaction]: Basic functions', function (t) {
238238
st.equal(tx.getChainId(), 0x16b2)
239239
st.end()
240240
})
241+
242+
t.test('EIP155 hashing when singing', function (st) {
243+
txFixtures.slice(0, 3).forEach(function (txData) {
244+
const tx = new Transaction(txData.raw.slice(0, 6), {chain: 1})
245+
246+
var privKey = new Buffer(txData.privateKey, 'hex')
247+
tx.sign(privKey)
248+
249+
st.equal(
250+
tx.getSenderAddress().toString('hex'),
251+
txData.sendersAddress,
252+
'computed sender address should equal the fixture\'s one'
253+
)
254+
})
255+
256+
st.end()
257+
})
241258
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy