Skip to content

Commit

Permalink
feature: add maxTxSize to ProtocolParametersRequiredByWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Sep 20, 2021
1 parent 161d8b5 commit a9a5d16
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/blockfrost/src/BlockfrostToOgmios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const BlockfrostToOgmios = {
currentWalletProtocolParameters: (
blockfrost: Responses['epoch_param_content']
): ProtocolParametersRequiredByWallet => ({
maxTxSize: Number(blockfrost.max_tx_size),
minFeeCoefficient: blockfrost.min_fee_a,
minFeeConstant: blockfrost.min_fee_b,
stakeKeyDeposit: Number(blockfrost.key_deposit),
Expand Down
2 changes: 2 additions & 0 deletions packages/blockfrost/test/blockfrostProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ describe('blockfrostProvider', () => {
protocol_major_ver: 5,
protocol_minor_ver: 0,
min_pool_cost: '340000000',
max_tx_size: '16384',
max_val_size: '1000',
max_collateral_inputs: 1,
coins_per_utxo_word: '0'
Expand All @@ -313,6 +314,7 @@ describe('blockfrostProvider', () => {
poolDeposit: 500_000_000,
protocolVersion: { major: 5, minor: 0 },
minPoolCost: 340_000_000,
maxTxSize: 16_384,
maxValueSize: 1000,
maxCollateralInputs: 1,
coinsPerUtxoWord: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type GraphqlCurrentWalletProtocolParameters = {
maxValSize: string;
keyDeposit: number;
maxCollateralInputs: number;
maxTxSize: number;
minFeeA: number;
minFeeB: number;
minPoolCost: number;
Expand Down Expand Up @@ -46,6 +47,7 @@ export const CardanoGraphqlToOgmios = {
...params,
maxValueSize: Number(params.maxValSize),
stakeKeyDeposit: params.keyDeposit,
maxTxSize: params.maxTxSize,
minFeeCoefficient: params.minFeeA,
minFeeConstant: params.minFeeB
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const cardanoGraphqlDbSyncProvider = (uri: string): CardanoProvider => {
currentEpoch {
protocolParams {
coinsPerUtxoWord
maxTxSize
maxValSize
keyDeposit
maxCollateralInputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ describe('cardanoGraphqlDbSyncProvider', () => {
currentEpoch: {
protocolParams: {
coinsPerUtxoWord: 34_482,
maxTxSize: 16_384,
maxValSize: '5000',
keyDeposit: 2_000_000,
maxCollateralInputs: 3,
Expand All @@ -203,6 +204,7 @@ describe('cardanoGraphqlDbSyncProvider', () => {

expect(response).toMatchObject<ProtocolParametersRequiredByWallet>({
coinsPerUtxoWord: 34_482,
maxTxSize: 16_384,
maxValueSize: 5000,
stakeKeyDeposit: 2_000_000,
maxCollateralInputs: 3,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Provider/CardanoProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Tx } from '../Transaction';
export type ProtocolParametersRequiredByWallet = Pick<
ProtocolParametersAlonzo,
| 'coinsPerUtxoWord'
| 'maxTxSize'
| 'maxValueSize'
| 'stakeKeyDeposit'
| 'maxCollateralInputs'
Expand Down

0 comments on commit a9a5d16

Please sign in to comment.