Skip to content

Commit

Permalink
fix construction metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Madhur Shrimal <madhur.shrimal@gmail.com>
  • Loading branch information
Madhur Shrimal authored and shrimalmadhur committed Dec 2, 2022
1 parent 1c25df7 commit 4deda80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Expand Up @@ -181,9 +181,8 @@ const configure = (
logger.debug(`[constructionMetadata] suggested fee is ${suggestedFee}`);
// eslint-disable-next-line camelcase
return {
metadata: { ttl: ttl.toString() },
suggested_fee: [mapAmount(suggestedFee.toString())],
protocol_parameters: protocolParameters
metadata: { ttl: ttl.toString(), protocol_parameters: protocolParameters },
suggested_fee: [mapAmount(suggestedFee.toString())]
};
},
request.log,
Expand Down
1 change: 0 additions & 1 deletion cardano-rosetta-server/src/types/rosetta-types.d.ts
Expand Up @@ -401,7 +401,6 @@ declare namespace Components {
protocol_parameters?: ProtocolParameters;
};
suggested_fee?: /* Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency. */ Amount[];
protocol_parameters?: ProtocolParameters;
}
/**
* ConstructionParseRequest is the input to the `/construction/parse` endpoint. It allows the caller to parse either an unsigned or signed transaction.
Expand Down
Expand Up @@ -53,7 +53,8 @@ describe(CONSTRUCTION_METADATA_ENDPOINT, () => {
expect(response.statusCode).toEqual(StatusCodes.OK);
expect(response.json()).toEqual({
metadata: {
ttl: (latestBlockSlot + relativeTtl).toString()
ttl: (latestBlockSlot + relativeTtl).toString(),
protocol_parameters: LATEST_EPOCH_PROTOCOL_PARAMS
},
suggested_fee: [
{
Expand All @@ -67,8 +68,7 @@ describe(CONSTRUCTION_METADATA_ENDPOINT, () => {
linearFeeParameters.minFeeB
).toString()
}
],
protocol_parameters: LATEST_EPOCH_PROTOCOL_PARAMS
]
});
});

Expand Down

0 comments on commit 4deda80

Please sign in to comment.