mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 12:51:01 +00:00
@@ -9,12 +9,12 @@ use serde::Serialize;
|
||||
pub struct Metadata {
|
||||
/// The bytecode hash mode.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub bytecode_hash: Option<revive_llvm_context::EraVMMetadataHash>,
|
||||
pub bytecode_hash: Option<revive_llvm_context::PolkaVMMetadataHash>,
|
||||
}
|
||||
|
||||
impl Metadata {
|
||||
/// A shortcut constructor.
|
||||
pub fn new(bytecode_hash: revive_llvm_context::EraVMMetadataHash) -> Self {
|
||||
pub fn new(bytecode_hash: revive_llvm_context::PolkaVMMetadataHash) -> Self {
|
||||
Self {
|
||||
bytecode_hash: Some(bytecode_hash),
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@ impl ExtraMetadata {
|
||||
/// Returns the recursive function reference for the specified tag.
|
||||
pub fn get(
|
||||
&self,
|
||||
block_key: &revive_llvm_context::EraVMFunctionBlockKey,
|
||||
block_key: &revive_llvm_context::PolkaVMFunctionBlockKey,
|
||||
) -> Option<&RecursiveFunction> {
|
||||
for function in self.recursive_functions.iter() {
|
||||
match block_key.code_type {
|
||||
revive_llvm_context::EraVMCodeType::Deploy => {
|
||||
revive_llvm_context::PolkaVMCodeType::Deploy => {
|
||||
if let Some(creation_tag) = function.creation_tag {
|
||||
if num::BigUint::from(creation_tag) == block_key.tag {
|
||||
return Some(function);
|
||||
}
|
||||
}
|
||||
}
|
||||
revive_llvm_context::EraVMCodeType::Runtime => {
|
||||
revive_llvm_context::PolkaVMCodeType::Runtime => {
|
||||
if let Some(runtime_tag) = function.runtime_tag {
|
||||
if num::BigUint::from(runtime_tag) == block_key.tag {
|
||||
return Some(function);
|
||||
|
||||
@@ -15,18 +15,18 @@ use self::bytecode::DeployedBytecode;
|
||||
use self::extra_metadata::ExtraMetadata;
|
||||
|
||||
/// The `solc --standard-json` output contract EVM data.
|
||||
/// It is replaced by EraVM data after compiling.
|
||||
/// It is replaced by PolkaVM data after compiling.
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EVM {
|
||||
/// The contract EVM legacy assembly code.
|
||||
#[serde(rename = "legacyAssembly")]
|
||||
pub assembly: Option<Assembly>,
|
||||
/// The contract EraVM assembly code.
|
||||
/// The contract PolkaVM assembly code.
|
||||
#[serde(rename = "assembly")]
|
||||
pub assembly_text: Option<String>,
|
||||
/// The contract bytecode.
|
||||
/// Is reset by that of EraVM before yielding the compiled project artifacts.
|
||||
/// Is reset by that of PolkaVM before yielding the compiled project artifacts.
|
||||
pub bytecode: Option<Bytecode>,
|
||||
/// The contract deployed bytecode.
|
||||
pub deployed_bytecode: Option<DeployedBytecode>,
|
||||
@@ -39,7 +39,7 @@ pub struct EVM {
|
||||
}
|
||||
|
||||
impl EVM {
|
||||
/// Sets the EraVM assembly and bytecode.
|
||||
/// Sets the PolkaVM assembly and bytecode.
|
||||
pub fn modify(&mut self, assembly_text: String, bytecode: String) {
|
||||
self.assembly_text = Some(assembly_text);
|
||||
self.bytecode = Some(Bytecode::new(bytecode));
|
||||
|
||||
@@ -35,7 +35,7 @@ pub struct Contract {
|
||||
/// The contract optimized IR code.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub ir_optimized: Option<String>,
|
||||
/// The contract EraVM bytecode hash.
|
||||
/// The contract PolkaVM bytecode hash.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub hash: Option<String>,
|
||||
/// The contract factory dependencies.
|
||||
|
||||
@@ -166,12 +166,12 @@ impl Output {
|
||||
let mut messages = Vec::new();
|
||||
for (path, source) in sources.iter() {
|
||||
if let Some(ast) = source.ast.as_ref() {
|
||||
let mut eravm_messages =
|
||||
let mut polkavm_messages =
|
||||
Source::get_messages(ast, version, pipeline, suppressed_warnings);
|
||||
for message in eravm_messages.iter_mut() {
|
||||
for message in polkavm_messages.iter_mut() {
|
||||
message.push_contract_path(path.as_str());
|
||||
}
|
||||
messages.extend(eravm_messages);
|
||||
messages.extend(polkavm_messages);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user