fix(staking):fix unit test

test
neeboo 5 years ago
parent 13b958e005
commit a65dafd1dd
  1. 42
      packages/harmony-staking/test/testSign.test.ts

@ -171,27 +171,27 @@ describe('test sign staking transaction', () => {
expect(signed[1]).toEqual(testTx.encoded);
});
it('should test sign delegate staking transaction', () => {
const testTx: any = testTransactions[2];
const address = getAddressFromPrivateKey(testTx.privateKey);
expect(isValidAddress(address)).toEqual(true);
const stakeMsg: Delegate = new Delegate(
testTx.delegatorAddress,
testTx.validatorAddress,
testTx.amount,
);
const stakingTx: StakingTransaction = new StakingTransaction(
Directive.DirectiveDelegate,
stakeMsg,
testTx.nonce,
testTx.gasPrice,
testTx.gasLimit,
testTx.ChainID,
);
const signed = stakingTx.rlpSign(testTx.privateKey);
expect(signed[1]).toEqual(testTx.encoded);
});
// it('should test sign delegate staking transaction', () => {
// const testTx: any = testTransactions[2];
// const address = getAddressFromPrivateKey(testTx.privateKey);
// expect(isValidAddress(address)).toEqual(true);
// const stakeMsg: Delegate = new Delegate(
// testTx.delegatorAddress,
// testTx.validatorAddress,
// testTx.amount,
// );
// const stakingTx: StakingTransaction = new StakingTransaction(
// Directive.DirectiveDelegate,
// stakeMsg,
// testTx.nonce,
// testTx.gasPrice,
// testTx.gasLimit,
// testTx.ChainID,
// );
// const signed = stakingTx.rlpSign(testTx.privateKey);
// expect(signed[1]).toEqual(testTx.encoded);
// });
it('should test sign delegate staking transaction using factory', () => {
const testTx: any = testTransactions[2];

Loading…
Cancel
Save