mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 16:51:04 +00:00
c0dd845b39
Signed-off-by: xermicus <cyrill@parity.io>
40 lines
1.0 KiB
Rust
40 lines
1.0 KiB
Rust
//! The LLVM module build.
|
|
|
|
use std::collections::BTreeMap;
|
|
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
/// The LLVM module build.
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Build {
|
|
/// The PolkaVM text assembly.
|
|
pub assembly_text: String,
|
|
/// The metadata hash.
|
|
pub metadata_hash: Option<[u8; revive_common::BYTE_LENGTH_WORD]>,
|
|
/// The PolkaVM binary bytecode.
|
|
pub bytecode: Vec<u8>,
|
|
/// The PolkaVM bytecode hash.
|
|
pub bytecode_hash: String,
|
|
/// The hash-to-full-path mapping of the contract factory dependencies.
|
|
pub factory_dependencies: BTreeMap<String, String>,
|
|
}
|
|
|
|
impl Build {
|
|
/// A shortcut constructor.
|
|
pub fn new(
|
|
assembly_text: String,
|
|
metadata_hash: Option<[u8; revive_common::BYTE_LENGTH_WORD]>,
|
|
bytecode: Vec<u8>,
|
|
bytecode_hash: String,
|
|
) -> Self {
|
|
Self {
|
|
assembly_text,
|
|
metadata_hash,
|
|
bytecode,
|
|
bytecode_hash,
|
|
factory_dependencies: BTreeMap::new(),
|
|
}
|
|
}
|
|
}
|