Fixed test-wallet for phantomjs (it does not like the "let" keyword).
This commit is contained in:
parent
dfdbb9bb28
commit
df2a00a2fc
@ -119,16 +119,16 @@ describe('Test Transaction Signing and Parsing', function() {
|
|||||||
assert.equal(parsedTransaction.chainId, 0, 'parses chainId (legacy)');
|
assert.equal(parsedTransaction.chainId, 0, 'parses chainId (legacy)');
|
||||||
|
|
||||||
// Legacy serializes unsigned transaction
|
// Legacy serializes unsigned transaction
|
||||||
{
|
(function() {
|
||||||
let unsignedTx = ethers.utils.serializeTransaction(transaction);
|
var unsignedTx = ethers.utils.serializeTransaction(transaction);
|
||||||
assert.equal(unsignedTx, test.unsignedTransaction,
|
assert.equal(unsignedTx, test.unsignedTransaction,
|
||||||
'serializes undsigned transaction (legacy)');
|
'serializes undsigned transaction (legacy)');
|
||||||
|
|
||||||
// Legacy signed serialized transaction
|
// Legacy signed serialized transaction
|
||||||
let signature = signDigest(ethers.utils.keccak256(unsignedTx));
|
var signature = signDigest(ethers.utils.keccak256(unsignedTx));
|
||||||
assert.equal(ethers.utils.serializeTransaction(transaction, signature), test.signedTransaction,
|
assert.equal(ethers.utils.serializeTransaction(transaction, signature), test.signedTransaction,
|
||||||
'signs transaction (legacy)');
|
'signs transaction (legacy)');
|
||||||
}
|
})();
|
||||||
|
|
||||||
|
|
||||||
// EIP155
|
// EIP155
|
||||||
@ -156,17 +156,17 @@ describe('Test Transaction Signing and Parsing', function() {
|
|||||||
|
|
||||||
transaction.chainId = 5;
|
transaction.chainId = 5;
|
||||||
|
|
||||||
{
|
(function() {
|
||||||
// EIP-155 serialized unsigned transaction
|
// EIP-155 serialized unsigned transaction
|
||||||
let unsignedTx = ethers.utils.serializeTransaction(transaction);
|
var unsignedTx = ethers.utils.serializeTransaction(transaction);
|
||||||
assert.equal(unsignedTx, test.unsignedTransactionChainId5,
|
assert.equal(unsignedTx, test.unsignedTransactionChainId5,
|
||||||
'serializes unsigned transaction (eip155) ');
|
'serializes unsigned transaction (eip155) ');
|
||||||
|
|
||||||
// EIP-155 signed serialized transaction
|
// EIP-155 signed serialized transaction
|
||||||
let signature = signDigest(ethers.utils.keccak256(unsignedTx));
|
var signature = signDigest(ethers.utils.keccak256(unsignedTx));
|
||||||
assert.equal(ethers.utils.serializeTransaction(transaction, signature), test.signedTransactionChainId5,
|
assert.equal(ethers.utils.serializeTransaction(transaction, signature), test.signedTransactionChainId5,
|
||||||
'signs transaction (eip155)');
|
'signs transaction (eip155)');
|
||||||
}
|
})();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user