diff --git a/src/serializable/fxs/pvm/convertSubnetValidator.test.ts b/src/serializable/fxs/pvm/convertSubnetValidator.test.ts new file mode 100644 index 000000000..30f7d347a --- /dev/null +++ b/src/serializable/fxs/pvm/convertSubnetValidator.test.ts @@ -0,0 +1,13 @@ +import { + convertSubnetValidator, + convertSubnetValidatorBytes, +} from '../../../fixtures/pvm'; +import { testSerialization } from '../../../fixtures/utils/serializable'; +import { ConvertSubnetValidator } from './convertSubnetValidator'; + +testSerialization( + 'ConvertSubnetValidator', + ConvertSubnetValidator, + convertSubnetValidator, + convertSubnetValidatorBytes, +); diff --git a/src/vms/pvm/txs/fee/fixtures/transactions.ts b/src/vms/pvm/txs/fee/fixtures/transactions.ts index 7e1a27b0c..e822be07e 100644 --- a/src/vms/pvm/txs/fee/fixtures/transactions.ts +++ b/src/vms/pvm/txs/fee/fixtures/transactions.ts @@ -13,6 +13,8 @@ import { INTRINSIC_ADD_PERMISSIONLESS_VALIDATOR_TX_COMPLEXITIES, INTRINSIC_ADD_SUBNET_VALIDATOR_TX_COMPLEXITIES, INTRINSIC_BASE_TX_COMPLEXITIES, + INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES, + INTRINSIC_CONVERT_SUBNET_VALIDATOR_COMPLEXITIES, INTRINSIC_CREATE_CHAIN_TX_COMPLEXITIES, INTRINSIC_CREATE_SUBNET_TX_COMPLEXITIES, INTRINSIC_EXPORT_TX_COMPLEXITIES, @@ -275,6 +277,25 @@ export const TEST_TRANSACTIONS: ReadonlyArray<{ }), expectedDynamicFee: 173_600n, }, + + { + name: 'ConvertSubnetTx', + txHex: + '00000000002300003039000000000000000000000000000000000000000000000000000000000000000000000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007002386f234262960000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c00000001705f3d4415f990225d3df5ce437d7af2aa324b1bbce854ee34ab6f39882250d200000000dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000005002386f26fc0f94e000000010000000000000000a0673b4ee5ec44e57c8ab250dd7cd7b68d04421f64bd6559a4284a3ee358ff2b705f3d4415f990225d3df5ce437d7af2aa324b1bbce854ee34ab6f39882250d2000000000000000100000014c582872c37c81efa2c94ea347af49cdc23a830aa000000000000c137000000003b9aca00a3783a891cb41cadbfcf456da149f30e7af972677a162b984bef0779f254baac51ec042df1781d1295df80fb41c801269731fc6c25e1e5940dc3cb8509e30348fa712742cfdc83678acc9f95908eb98b89b28802fb559b4a2a6ff3216707c07f0ceb0b45a95f4f9a9540bbd3331d8ab4f233bffa4abb97fad9d59a1695f31b92a2b89e365facf7ab8c30de7c4a496d1e000000000000000000000000000000000000000a00000001000000000000000200000009000000011430759900fdf516cdeff6a1390dd7438585568a89c06142c44b3bf1178c4cae4bff44e955b19da08f0359d396a7a738b989bb46377e7465cd858ddd1e8dd3790100000009000000011430759900fdf516cdeff6a1390dd7438585568a89c06142c44b3bf1178c4cae4bff44e955b19da08f0359d396a7a738b989bb46377e7465cd858ddd1e8dd37901', + expectedComplexity: createDimensions({ + bandwidth: 656, + dbRead: + INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES[FeeDimensions.DBRead] + + INTRINSIC_INPUT_DB_READ, + dbWrite: + INTRINSIC_CONVERT_SUBNET_TX_COMPLEXITIES[FeeDimensions.DBWrite] + + INTRINSIC_INPUT_DB_WRITE + + INTRINSIC_OUTPUT_DB_WRITE + + INTRINSIC_CONVERT_SUBNET_VALIDATOR_COMPLEXITIES[FeeDimensions.DBWrite], + compute: 0, // TODO: Implement + }), + expectedDynamicFee: 365_600n, + }, ]; export const TEST_UNSUPPORTED_TRANSACTIONS = [