Skip to content

Commit

Permalink
fix: use fresh error schema and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denbite committed Jan 29, 2024
1 parent 219d6c0 commit b306c53
Show file tree
Hide file tree
Showing 6 changed files with 518 additions and 465 deletions.
3 changes: 2 additions & 1 deletion packages/accounts/test/account_multisig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const BN = require('bn.js');
const fs = require('fs');
const semver = require('semver');

const { Account2FA, MULTISIG_DEPOSIT, MULTISIG_GAS } = require('../lib');
const { Account2FA, MULTISIG_DEPOSIT, MULTISIG_GAS, MultisigStateStatus } = require('../lib');
const testUtils = require('./test-utils');

const { functionCall, transfer } = actionCreators;
Expand Down Expand Up @@ -47,6 +47,7 @@ const getAccount2FA = async (account, keyMapping = ({ public_key: publicKey }) =
account2fa.getRecoveryMethods = () => ({
data: keys.map(keyMapping)
});
account2fa.checkMultisigCodeAndStateStatus = () => ({ codeStatus: 1, stateStatus: MultisigStateStatus.STATE_NOT_INITIALIZED });
await account2fa.deployMultisig([...fs.readFileSync('./test/wasm/multisig.wasm')]);
return account2fa;
};
Expand Down
3 changes: 1 addition & 2 deletions packages/accounts/test/providers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ describe('providers', () => {
expect(response).toEqual({
block_height: expect.any(Number),
block_hash: expect.any(String),
proof: expect.any(Array),
values: [
{ key: 'bmFtZQ==', proof: expect.any(Array), value: 'aGVsbG8=' }
{ key: 'bmFtZQ==', value: 'aGVsbG8=' }
]
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/fetch_error_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const https = require('https');
const fs = require('fs');

const ERROR_SCHEMA_URL =
'https://raw.githubusercontent.com/nearprotocol/nearcore/4c1149974ccf899dbcb2253a3e27cbab86dc47be/chain/jsonrpc/res/rpc_errors_schema.json';
const TARGET_SCHEMA_FILE_PATH = `${process.argv[2] || process.cwd()}/src/errors/rpc_error_schema.json'`;
'https://raw.githubusercontent.com/near/nearcore/master/chain/jsonrpc/res/rpc_errors_schema.json';
const TARGET_SCHEMA_FILE_PATH = `${process.argv[2] || process.cwd()}/src/errors/rpc_error_schema.json`;

https
.get(ERROR_SCHEMA_URL, resp => {
Expand Down
Loading

0 comments on commit b306c53

Please sign in to comment.