Skip to content

Commit

Permalink
[core framework] factor out DiemVersion for experimental framework us…
Browse files Browse the repository at this point in the history
…ing ChainMarker approach
  • Loading branch information
emmazzz authored and bors-libra committed Dec 17, 2021
1 parent f1a2ba1 commit 57e5fae
Show file tree
Hide file tree
Showing 63 changed files with 1,942 additions and 424 deletions.
3 changes: 3 additions & 0 deletions crates/diem-client/src/verifying_client/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ fn get_latest_metadata() -> VerifyingRequest {
.with_diem_root(&diem_root)
.map_err(Error::rpc_response)?;

if let Some(diem_version) = diem_root.get_diem_version().map_err(Error::rpc_response)? {
metadata_view.diem_version = Some(diem_version.major);
}
Ok(MethodResponse::GetMetadata(metadata_view))
});
VerifyingRequest::new(request, subrequests, callback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
compiled_package_info:
package_name: DPNFramework
address_alias_instantiation:
CoreFramework: "00000000000000000000000000000001"
CurrencyInfo: 0000000000000000000000000a550c18
DiemFramework: "00000000000000000000000000000001"
DiemRoot: 0000000000000000000000000a550c18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
compiled_package_info:
package_name: DiemCoreFramework
address_alias_instantiation:
CoreFramework: "00000000000000000000000000000001"
CurrencyInfo: 0000000000000000000000000a550c18
DiemFramework: "00000000000000000000000000000001"
DiemRoot: 0000000000000000000000000a550c18
Expand Down Expand Up @@ -165,7 +166,7 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: XUS
: DiemFramework
source_digest: 4F783BED90EEDD47C5BD281F1FCBA42B4E4D9B9577524136880596D5C6B128F1
source_digest: 384E74C5417246197B5DFFC6CE893D4D6BD1447E363DE15E726976F9F7CBFFE4
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ when executing from a fresh state.
Initializes the Diem framework.


<pre><code><b>fun</b> <a href="Genesis.md#0x1_Genesis_initialize">initialize</a>(dr_account: signer, tc_account: signer, dr_auth_key: vector&lt;u8&gt;, tc_auth_key: vector&lt;u8&gt;, initial_script_allow_list: vector&lt;vector&lt;u8&gt;&gt;, is_open_module: bool, instruction_schedule: vector&lt;u8&gt;, native_schedule: vector&lt;u8&gt;, chain_id: u8, initial_diem_version: u64, consensus_config: vector&lt;u8&gt;)
<pre><code><b>fun</b> <a href="Genesis.md#0x1_Genesis_initialize">initialize</a>(dr_account: signer, tc_account: signer, dr_auth_key: vector&lt;u8&gt;, tc_auth_key: vector&lt;u8&gt;, initial_script_allow_list: vector&lt;vector&lt;u8&gt;&gt;, is_open_module: bool, instruction_schedule: vector&lt;u8&gt;, native_schedule: vector&lt;u8&gt;, chain_id: u8, initial_diem_version: u64, consensus_config: vector&lt;u8&gt;, _config_storage_signer: signer)
</code></pre>


Expand All @@ -68,6 +68,7 @@ Initializes the Diem framework.
chain_id: u8,
initial_diem_version: u64,
consensus_config: vector&lt;u8&gt;,
_config_storage_signer: signer,
) {
<a href="Genesis.md#0x1_Genesis_initialize_internal">initialize_internal</a>(
&dr_account,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module DiemFramework::Genesis {
chain_id: u8,
initial_diem_version: u64,
consensus_config: vector<u8>,
_config_storage_signer: signer,
) {
initialize_internal(
&dr_account,
Expand Down
1 change: 1 addition & 0 deletions diem-move/diem-framework/core/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "1.5.0"

[addresses]
Std = "0x1"
CoreFramework = "0x1"
DiemFramework = "0x1"
DiemRoot = "0xA550C18"
TreasuryCompliance = "0xB1E55ED"
Expand Down
1 change: 1 addition & 0 deletions diem-move/diem-framework/core/sources/Genesis.move
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module DiemFramework::Genesis {
chain_id: u8,
initial_diem_version: u64,
consensus_config: vector<u8>,
_config_storage_signer: signer,
) {
initialize_internal(
&dr_account,
Expand Down
3 changes: 3 additions & 0 deletions diem-move/diem-framework/experimental/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ version = "1.5.0"

[addresses]
Std = "0x1"
CoreFramework = "0x1"
ConfigStorage = "0x1"
DiemFramework = "0x1"
BARS = "0x06505CCD81E562B524D8F656ABD92A15"
ExperimentalFramework = "0x1"
DiemRoot = "0xA550C18"
TreasuryCompliance = "0xB1E55ED"
CurrencyInfo = "0xA550C18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ compiled_package_info:
package_name: DiemExperimental
address_alias_instantiation:
BARS: 06505ccd81e562b524d8f656abd92a15
ConfigStorage: "00000000000000000000000000000001"
CoreFramework: "00000000000000000000000000000001"
CurrencyInfo: 0000000000000000000000000a550c18
DiemFramework: "00000000000000000000000000000001"
DiemRoot: 0000000000000000000000000a550c18
ExperimentalFramework: "00000000000000000000000000000001"
Std: "00000000000000000000000000000001"
TreasuryCompliance: 0000000000000000000000000b1e55ed
VMReserved: "00000000000000000000000000000000"
Expand Down Expand Up @@ -81,7 +84,7 @@ compiled_package_info:
: DiemFramework
? address: "00000000000000000000000000000001"
name: DiemVersion
: DiemFramework
: CoreFramework
? address: "00000000000000000000000000000001"
name: DualAttestation
: DiemFramework
Expand All @@ -91,6 +94,9 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: Event
: Std
? address: "00000000000000000000000000000001"
name: ExperimentalVersion
: ExperimentalFramework
? address: "00000000000000000000000000000001"
name: FixedPoint32
: Std
Expand Down Expand Up @@ -175,7 +181,7 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: XUS
: DiemFramework
source_digest: 1954EFD06232AEBE28628FD75906C88D2E873D3500B3500EA11A118CCDB70B2C
source_digest: AFCAE53ED557D9315BB6E33C8F10CBBCCADD795F28403FA1FFAA8A5711A968EB
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 57e5fae

Please sign in to comment.