Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nonce: 1,
to: 'another_person',
amount: new BN(888),
pubKey: account.publicKey,
gasPrice: 888,
gasLimit: 888888,
code: '',
data: 'some_data',
};
const tx = new Transaction(rawTx);
const rawSignature = account.signTransaction(tx);
const lgtm = zcrypto.schnorr.verify(
tx.bytes,
new Signature({
r: new BN(rawSignature.slice(0, 64), 16),
s: new BN(rawSignature.slice(64), 16),
}),
Buffer.from(account.publicKey, 'hex'),
);
expect(lgtm).toBeTruthy();
});
});
const tx = {
version: 8,
nonce: 8,
to: pairs[0].digest.slice(24),
pubKey: publicKey,
amount: new BN('888', 10),
gasPrice: 8,
gasLimit: 88,
code: '',
data: '',
};
const {signature} = util.createTransactionJson(privateKey, tx);
const res = schnorr.verify(
util.encodeTransaction(tx),
new Signature({
r: new BN((signature as string).slice(0, 64), 16),
s: new BN((signature as string).slice(64), 16),
}),
Buffer.from(publicKey, 'hex'),
);
expect(res).toBeTruthy();
});