Skip to content

Commit

Permalink
chore: address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ruijialin-avalabs committed Oct 23, 2024
1 parent 0532f91 commit 60e1744
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
22 changes: 9 additions & 13 deletions src/vms/pvm/etna-builder/builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1077,19 +1077,15 @@ describe('./src/vms/pvm/etna-builder/builder.test.ts', () => {
});
});

describe.each([
{
name: 'should throw error if weight on a validator is 0',
validator: ConvertSubnetValidator.fromNative(
nodeId,
BigInt(0 * 1e9),
BigInt(0 * 1e9),
new ProofOfPossession(blsPublicKeyBytes(), blsSignatureBytes()),
PChainOwner.fromNative([testAddress1], 1),
PChainOwner.fromNative([testAddress1], 1),
),
},
])('$name', ({ validator }) => {
it('should throw error if weight on a validator is 0', () => {
const validator = ConvertSubnetValidator.fromNative(
nodeId,
BigInt(0 * 1e9),
BigInt(0 * 1e9),
new ProofOfPossession(blsPublicKeyBytes(), blsSignatureBytes()),
PChainOwner.fromNative([testAddress1], 1),
PChainOwner.fromNative([testAddress1], 1),
);
const utxos = testUtxos();
try {
newConvertSubnetTx(
Expand Down
4 changes: 2 additions & 2 deletions src/vms/pvm/etna-builder/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {
INTRINSIC_IMPORT_TX_COMPLEXITIES,
INTRINSIC_REMOVE_SUBNET_VALIDATOR_TX_COMPLEXITIES,
INTRINSIC_TRANSFER_SUBNET_OWNERSHIP_TX_COMPLEXITIES,
INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES,
getAuthComplexity,
getInputComplexity,
getOutputComplexity,
Expand All @@ -76,7 +77,6 @@ import {
import { spend } from './spend';
import { useSpendableLockedUTXOs, useUnlockedUTXOs } from './spend-reducers';
import type { ConvertSubnetValidator } from '../../../serializable/fxs/pvm/convertSubnetValidator';
import { INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES } from '../txs/fee/constants';

/**
* Creates OutputOwners used for change outputs with the specified
Expand Down Expand Up @@ -1353,7 +1353,7 @@ export type NewConvertSubnetTxProps = TxProps<{

/**
* Creates a new unsigned PVM convert subnet transaction
* (`NewConvertSubnetTx`) using calculated dynamic fees.
* (`ConvertSubnetTx`) using calculated dynamic fees.
*
* @param props {NewConvertSubnetTxProps}
* @param context {Context}
Expand Down
1 change: 1 addition & 0 deletions src/vms/pvm/txs/fee/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export {
INTRINSIC_IMPORT_TX_COMPLEXITIES,
INTRINSIC_REMOVE_SUBNET_VALIDATOR_TX_COMPLEXITIES,
INTRINSIC_TRANSFER_SUBNET_OWNERSHIP_TX_COMPLEXITIES,
INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES,
} from './constants';

export {
Expand Down

0 comments on commit 60e1744

Please sign in to comment.