mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-25 21:25:08 +00:00
remove superfluous byte swap in linkersymbol builtin translation (#455)
- Remove the superfluous byte swap in the `linkersymbol` builtin translation. - Support testing the `linkersymbol` builtin translation in the runner specs. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
1 parent
2d85ca9755
commit
289af875db
12 files changed
+498
-345
No files matched your search
@@ -38,6 +38,8 @@ use polkadot_sdk::{
|
||||
sp_keystore::{testing::MemoryKeystore, KeystoreExt},
|
||||
sp_runtime::AccountId32,
|
||||
};
|
||||
#[cfg(feature = "resolc")]
|
||||
use revive_solc_json_interface::SolcStandardJsonInputSettingsLibraries;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::runtime::*;
|
||||
@@ -271,6 +273,8 @@ pub enum Code {
|
||||
path: Option<std::path::PathBuf>,
|
||||
solc_optimizer: Option<bool>,
|
||||
contract: String,
|
||||
#[serde(default)]
|
||||
libraries: SolcStandardJsonInputSettingsLibraries,
|
||||
},
|
||||
/// Read the contract blob from disk
|
||||
Path(std::path::PathBuf),
|
||||
@@ -294,6 +298,7 @@ impl From<Code> for pallet_revive::Code {
|
||||
path,
|
||||
contract,
|
||||
solc_optimizer,
|
||||
libraries,
|
||||
} => {
|
||||
let Some(path) = path else {
|
||||
panic!("Solidity source of contract '{contract}' missing path");
|
||||
@@ -306,6 +311,7 @@ impl From<Code> for pallet_revive::Code {
|
||||
&source_code,
|
||||
solc_optimizer.unwrap_or(true),
|
||||
revive_llvm_context::OptimizerSettings::cycles(),
|
||||
libraries,
|
||||
))
|
||||
}
|
||||
Code::Path(path) => pallet_revive::Code::Upload(std::fs::read(path).unwrap()),
|
||||
|
||||
@@ -316,6 +316,7 @@ impl Specs {
|
||||
path: Some(path),
|
||||
solc_optimizer,
|
||||
contract,
|
||||
libraries,
|
||||
} = code
|
||||
else {
|
||||
panic!("the differential runner requires Code::Solidity source");
|
||||
@@ -335,6 +336,7 @@ impl Specs {
|
||||
&contract,
|
||||
&solidity_source,
|
||||
solc_optimizer.unwrap_or(true),
|
||||
libraries,
|
||||
)),
|
||||
Err(err) => panic!(
|
||||
"failed to read solidity source\n . path: '{}'\n . error: {:?}",
|
||||
|
||||
Reference in new issue
Block a user