Skip to main content

platform_version/version/drive_versions/
v6.rs

1use crate::version::drive_versions::drive_address_funds_method_versions::v1::DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V1;
2use crate::version::drive_versions::drive_contract_group_method_versions::v1::DRIVE_CONTRACT_GROUP_METHOD_VERSIONS_V1;
3use crate::version::drive_versions::drive_contract_method_versions::v2::DRIVE_CONTRACT_METHOD_VERSIONS_V2;
4use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1;
5use crate::version::drive_versions::drive_document_method_versions::v2::DRIVE_DOCUMENT_METHOD_VERSIONS_V2;
6use crate::version::drive_versions::drive_group_method_versions::v1::DRIVE_GROUP_METHOD_VERSIONS_V1;
7use crate::version::drive_versions::drive_group_method_versions::DriveShieldedMethodVersions;
8use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1;
9use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1;
10use crate::version::drive_versions::drive_state_transition_method_versions::v2::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V2;
11use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1;
12use crate::version::drive_versions::drive_token_method_versions::v1::DRIVE_TOKEN_METHOD_VERSIONS_V1;
13use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1;
14use crate::version::drive_versions::drive_vote_method_versions::v2::DRIVE_VOTE_METHOD_VERSIONS_V2;
15use crate::version::drive_versions::{
16    DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion,
17    DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions,
18    DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion,
19    DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions,
20    DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions,
21    DriveProveMethodVersions, DriveSavedBlockTransactionsMethodVersions,
22    DriveSystemEstimationCostsMethodVersions, DriveVersion,
23};
24use grovedb_version::version::v2::GROVE_V2;
25
26/// This was introduced in protocol v11 (2.2).
27/// v11 was done for 2 reasons
28///     * platform addresses
29///     * identity update conversion
30pub const DRIVE_VERSION_V6: DriveVersion = DriveVersion {
31    structure: DRIVE_STRUCTURE_V1,
32    methods: DriveMethodVersions {
33        initialization: DriveInitializationMethodVersions {
34            create_initial_state_structure: 2,
35        },
36        credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1,
37        protocol_upgrade: DriveProtocolUpgradeVersions {
38            clear_version_information: 0,
39            fetch_versions_with_counter: 0,
40            fetch_proved_versions_with_counter: 0,
41            fetch_validator_version_votes: 0,
42            fetch_proved_validator_version_votes: 0,
43            remove_validators_proposed_app_versions: 0,
44            update_validator_proposed_app_version: 0,
45        },
46        prove: DriveProveMethodVersions {
47            prove_elements: 0,
48            prove_multiple_state_transition_results: 0,
49            prove_state_transition: 0,
50        },
51        balances: DriveBalancesMethodVersions {
52            add_to_system_credits: 0,
53            add_to_system_credits_operations: 0,
54            remove_from_system_credits: 0,
55            remove_from_system_credits_operations: 0,
56            calculate_total_credits_balance: 1, // Changed because we now add the address trees
57        },
58        document: DRIVE_DOCUMENT_METHOD_VERSIONS_V2, // Changed
59        vote: DRIVE_VOTE_METHOD_VERSIONS_V2,
60        contract: DRIVE_CONTRACT_METHOD_VERSIONS_V2,
61        fees: DriveFeesMethodVersions { calculate_fee: 0 },
62        estimated_costs: DriveEstimatedCostsMethodVersions {
63            add_estimation_costs_for_levels_up_to_contract: 0,
64            add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0,
65            add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0,
66            add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0,
67        },
68        asset_lock: DriveAssetLockMethodVersions {
69            add_asset_lock_outpoint: 0,
70            add_estimation_costs_for_adding_asset_lock: 0,
71            fetch_asset_lock_outpoint_info: 0,
72        },
73        verify: DRIVE_VERIFY_METHOD_VERSIONS_V1,
74        identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1,
75        token: DRIVE_TOKEN_METHOD_VERSIONS_V1,
76        platform_system: DrivePlatformSystemMethodVersions {
77            estimation_costs: DriveSystemEstimationCostsMethodVersions {
78                for_total_system_credits_update: 0,
79            },
80        },
81        operations: DriveOperationsMethodVersion {
82            rollback_transaction: 0,
83            drop_cache: 0,
84            commit_transaction: 0,
85            apply_partial_batch_low_level_drive_operations: 0,
86            apply_partial_batch_grovedb_operations: 0,
87            apply_batch_low_level_drive_operations: 0,
88            apply_batch_grovedb_operations: 0,
89        },
90        state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V2, //changed
91        batch_operations: DriveBatchOperationsMethodVersion {
92            convert_drive_operations_to_grove_operations: 0,
93            apply_drive_operations: 0,
94        },
95        platform_state: DrivePlatformStateMethodVersions {
96            fetch_platform_state_bytes: 0,
97            store_platform_state_bytes: 0,
98            fetch_platform_state_recent_bytes: 0,
99            store_platform_state_recent_bytes: 0,
100            fetch_platform_state_entries_bytes: 0,
101            store_platform_state_entry_bytes: 0,
102            delete_platform_state_entry: 0,
103        },
104        fetch: DriveFetchMethodVersions { fetch_elements: 0 },
105        prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions {
106            fetch_single: 0,
107            prove_single: 0,
108            add_prefunded_specialized_balance: 0,
109            add_prefunded_specialized_balance_operations: 1,
110            deduct_from_prefunded_specialized_balance: 1,
111            deduct_from_prefunded_specialized_balance_operations: 0,
112            estimated_cost_for_prefunded_specialized_balance_update: 0,
113            empty_prefunded_specialized_balance: 0,
114        },
115        group: DRIVE_GROUP_METHOD_VERSIONS_V1,
116        contract_group: DRIVE_CONTRACT_GROUP_METHOD_VERSIONS_V1,
117        address_funds: DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V1,
118        shielded: DriveShieldedMethodVersions {
119            insert_note: 0,
120            insert_nullifiers: 0,
121            update_total_balance: 0,
122            record_anchor_if_changed: 0,
123            prune_anchors: 0,
124            has_anchor: 0,
125            has_nullifier: 0,
126            read_total_balance: 0,
127            notes_count: 0,
128        },
129        saved_block_transactions: DriveSavedBlockTransactionsMethodVersions {
130            store_address_balances: 0,
131            fetch_address_balances: 0,
132            prove_compacted_address_balance_changes: 0,
133            compact_address_balances: 0,
134            cleanup_expired_address_balances: 0,
135            max_blocks_before_compaction: 64,
136            max_addresses_before_compaction: 2048,
137        },
138    },
139    grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1,
140    grove_version: GROVE_V2,
141};