-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
29 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
group_imports = "StdExternalCrate" | ||
imports_granularity = "Preserve" | ||
reorder_imports = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
src/contracts_caller/memory_page_fact_registry/register_continuous_memorypage.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 9 additions & 20 deletions
29
src/contracts_caller/memory_page_fact_registry/sample_register_memory.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
use std::fs::File; | ||
use std::io::BufReader; | ||
|
||
use crate::contracts_caller::memory_page_fact_registry::types::register_continuous_memorypage::ContinuousMemorypage; | ||
use crate::contracts_caller::memory_page_fact_registry::types::register_continuous_page_batch::MemoryPageEntries; | ||
|
||
pub fn sample_register_continuous_page_batch() -> anyhow::Result<MemoryPageEntries> { | ||
let file_path = | ||
"src/data_samples/memory_page_fact_registry/register_continuous_page_batch.json" | ||
.to_string(); | ||
let input_file = File::open(file_path)?; | ||
let reader = BufReader::new(input_file); | ||
let memory_page_entries: MemoryPageEntries = serde_json::from_reader(reader)?; | ||
let byte = include_bytes!( | ||
"../../data_samples/memory_page_fact_registry/register_continuous_page_batch.json" | ||
); | ||
let memory_page_entries: MemoryPageEntries = serde_json::from_slice(byte)?; | ||
Ok(memory_page_entries) | ||
} | ||
|
||
pub fn sample_register_continuous_page() -> anyhow::Result<ContinuousMemorypage> { | ||
let file_path = | ||
"src/data_samples/memory_page_fact_registry/register_memory_page.json".to_string(); | ||
let input_file = File::open(file_path)?; | ||
let reader = BufReader::new(input_file); | ||
let continuous_memmory_page: ContinuousMemorypage = serde_json::from_reader(reader)?; | ||
let byte = | ||
include_bytes!("../../data_samples/memory_page_fact_registry/register_memory_page.json"); | ||
let continuous_memmory_page: ContinuousMemorypage = serde_json::from_slice(byte)?; | ||
Ok(continuous_memmory_page) | ||
} | ||
|
||
pub fn sample_large_data_register_continuous_page_batch() -> anyhow::Result<MemoryPageEntries> { | ||
let file_path = | ||
"src/data_samples/memory_page_fact_registry/large_data_register_continuous_page_batch.json" | ||
.to_string(); | ||
let input_file = File::open(file_path)?; | ||
let reader = BufReader::new(input_file); | ||
let memory_page_entries: MemoryPageEntries = serde_json::from_reader(reader)?; | ||
let byte = include_bytes!("../../data_samples/memory_page_fact_registry/large_data_register_continuous_page_batch.json"); | ||
let memory_page_entries: MemoryPageEntries = serde_json::from_slice(byte)?; | ||
Ok(memory_page_entries) | ||
} |
3 changes: 2 additions & 1 deletion
3
src/contracts_caller/memory_page_fact_registry/types/register_continuous_page_batch.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters