Skip to content

Commit

Permalink
fix: add missing error codes to network options test
Browse files Browse the repository at this point in the history
  • Loading branch information
guido-ta committed Jan 21, 2021
1 parent 172454b commit e65d40f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
@@ -1,10 +1,10 @@
import { FastifyRequest } from 'fastify';
import { NetworkService } from '../services/network-service';
import { CardanoNode } from '../utils/cardano/cli/cardano-node';
import { MIDDLEWARE_VERSION, OPERATION_TYPES, ROSETTA_VERSION, SUCCESS_OPERATION_STATE } from '../utils/constants';
import { mapToNetworkList, mapToNetworkStatusResponse } from '../utils/data-mapper';
import { ErrorFactory } from '../utils/errors';
import { withNetworkValidation } from './controllers-helper';
import { CardanoNode } from '../utils/cardano/cli/cardano-node';

/* eslint-disable camelcase */
export interface NetworkController {
Expand Down
2 changes: 1 addition & 1 deletion cardano-rosetta-server/src/server/utils/errors.ts
Expand Up @@ -128,7 +128,7 @@ const invalidOperationTypeError: CreateErrorFunction = type => buildApiError(Err
const tokenBundleAssetsMissingError: CreateErrorFunction = type =>
buildApiError(Errors.TOKEN_BUNDLE_ASSETS_MISSING, false, type);
const tokenAssetValueMissingError: CreateErrorFunction = type =>
buildApiError(Errors.TOKEN_BUNDLE_ASSETS_MISSING, false, type);
buildApiError(Errors.TOKEN_ASSET_VALUE_MISSING, false, type);

export const ErrorFactory = {
blockNotFoundError,
Expand Down
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import { Pool } from 'pg';
import { FastifyInstance } from 'fastify';
import StatusCodes from 'http-status-codes';
import { setupDatabase, setupServer, testInvalidNetworkParameters } from '../utils/test-utils';
import { Pool } from 'pg';
import packageJson from '../../../package.json';
import { CARDANO, MAINNET, OPERATION_TYPES } from '../../../src/server/utils/constants';
import { setupDatabase, setupServer, testInvalidNetworkParameters } from '../utils/test-utils';
import { generateNetworkPayload } from './common';
import packageJson from '../../../package.json';

const NETWORK_OPTIONS_ENDPOINT = '/network/options';

Expand Down Expand Up @@ -94,6 +94,16 @@ const allow = {
message: 'Pool key hash is required for stake delegation',
retriable: false
},
{
code: 4021,
message: 'Assets are required for output operation token bundle',
retriable: false
},
{
code: 4022,
message: 'Asset value is required for token asset',
retriable: false
},
{
code: 5000,
message: 'An error occurred',
Expand Down

0 comments on commit e65d40f

Please sign in to comment.