aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/test/unit
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-04-06 14:07:00 +0800
committerJacob Evans <jacob@dekz.net>2018-04-06 14:07:00 +0800
commita0fac663f72feafbac98c2949578ec48b8d2ec0a (patch)
tree0e342072160e66f352260e32d7c34dd8ce8b0199 /packages/subproviders/test/unit
parent774ab8a8efa1ff5914896d9435c0362a4586c2ef (diff)
downloaddexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar.gz
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar.bz2
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar.lz
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar.xz
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.tar.zst
dexon-sol-tools-a0fac663f72feafbac98c2949578ec48b8d2ec0a.zip
Update shared fixture data for network 42
Diffstat (limited to 'packages/subproviders/test/unit')
-rw-r--r--packages/subproviders/test/unit/ledger_subprovider_test.ts5
-rw-r--r--packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts17
2 files changed, 6 insertions, 16 deletions
diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts
index 66cb39a48..c18506681 100644
--- a/packages/subproviders/test/unit/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts
@@ -14,6 +14,7 @@ import {
WalletSubproviderErrors,
} from '../../src/types';
import { chaiSetup } from '../chai_setup';
+import { fixtureData } from '../utils/fixture_data';
import { reportCallbackErrors } from '../utils/report_callback_errors';
chaiSetup.configure();
@@ -80,7 +81,7 @@ describe('LedgerSubprovider', () => {
expect(accounts.length).to.be.equal(numberOfAccounts);
});
it('signs a personal message', async () => {
- const data = ethUtils.bufferToHex(ethUtils.toBuffer('hello world'));
+ const data = ethUtils.bufferToHex(ethUtils.toBuffer(fixtureData.PERSONAL_MESSAGE_STRING));
const ecSignatureHex = await ledgerSubprovider.signPersonalMessageAsync(data);
expect(ecSignatureHex).to.be.equal(
'0xa6cc284bff14b42bdf5e9286730c152be91719d478605ec46b3bebcd0ae491480652a1a7b742ceb0213d1e744316e285f41f878d8af0b8e632cbca4c279132d001',
@@ -144,7 +145,7 @@ describe('LedgerSubprovider', () => {
provider.sendAsync(payload, callback);
});
it('signs a personal message with personal_sign', (done: DoneCallback) => {
- const messageHex = ethUtils.bufferToHex(ethUtils.toBuffer('hello world'));
+ const messageHex = ethUtils.bufferToHex(ethUtils.toBuffer(fixtureData.PERSONAL_MESSAGE_STRING));
const payload = {
jsonrpc: '2.0',
method: 'personal_sign',
diff --git a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts
index 32650b3a0..ca0665871 100644
--- a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts
+++ b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts
@@ -21,7 +21,7 @@ const expect = chai.expect;
describe('PrivateKeyWalletSubprovider', () => {
let subprovider: PrivateKeyWalletSubprovider;
before(async () => {
- subprovider = new PrivateKeyWalletSubprovider(fixtureData.TEST_ACCOUNT_PRIVATE_KEY);
+ subprovider = new PrivateKeyWalletSubprovider(fixtureData.TEST_RPC_ACCOUNT_0_ACCOUNT_PRIVATE_KEY);
});
describe('direct method calls', () => {
describe('success cases', () => {
@@ -36,19 +36,8 @@ describe('PrivateKeyWalletSubprovider', () => {
expect(ecSignatureHex).to.be.equal(fixtureData.PERSONAL_MESSAGE_SIGNED_RESULT);
});
it('signs a transaction', async () => {
- const tx = {
- nonce: '0x00',
- gasPrice: '0x0',
- gas: '0x2710',
- to: '0x0000000000000000000000000000000000000000',
- value: '0x00',
- chainId: 3,
- from: fixtureData.TEST_RPC_ACCOUNT_0,
- };
- const txHex = await subprovider.signTransactionAsync(tx);
- expect(txHex).to.be.equal(
- '0xf85f808082271094000000000000000000000000000000000000000080802aa018894834d89899f71f6d8e74e6992fea34914c3b6d8090495f738086ca18f15da056e3333ec6c7465512a49558a84b56ec358718feaf0b162bda9aa6c40824ede4',
- );
+ const txHex = await subprovider.signTransactionAsync(fixtureData.TX_DATA);
+ expect(txHex).to.be.equal(fixtureData.TX_DATA_SIGNED_RESULT);
});
});
});