Skip to content

Commit 54c0ec3

Browse files
Merge pull request #918 from multiversx/cleanup
cleanup
2 parents 47a79d3 + 62c60f0 commit 54c0ec3

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

vmhost/vmhooks/generate/eiGenWriteRustOpcodeCost.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,7 @@ import (
99

1010
const useStatements = `
1111
use serde::{Deserialize, Serialize};
12-
use std::fs;
13-
use std::path::Path;
1412
15-
use crate::GasSchedule;
16-
17-
`
18-
19-
const configStruct = `
20-
#[derive(Deserialize)]
21-
struct Config {
22-
#[serde(rename = "WASMOpcodeCost")]
23-
wasm_opcode_cost: OpcodeCost,
24-
}
25-
26-
`
27-
28-
const implBlock = `impl OpcodeCost {
29-
pub fn new(gas_schedule: GasSchedule) -> Self {
30-
let schedule_path = Path::new(env!("CARGO_MANIFEST_DIR"))
31-
.join("schedules")
32-
.join(gas_schedule.to_string());
33-
34-
Self::from_file(schedule_path).unwrap()
35-
}
36-
37-
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, std::io::Error> {
38-
let content = fs::read_to_string(path)?;
39-
Self::from_toml_str(&content)
40-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()))
41-
}
42-
43-
pub fn from_toml_str(content: &str) -> Result<Self, toml::de::Error> {
44-
let config: Config = toml::from_str(content)?;
45-
Ok(config.wasm_opcode_cost)
46-
}
47-
}
4813
`
4914

5015
// WriteRustOpcodeCost generates code for opcode_cost.rs
@@ -75,6 +40,4 @@ func WriteRustOpcodeCost(out *eiGenWriter) {
7540
out.WriteString(fmt.Sprintf(" pub opcode_%s: u32,\n", strings.ToLower(line)))
7641
}
7742
out.WriteString("}\n")
78-
out.WriteString(configStruct)
79-
out.WriteString(implBlock)
8043
}

0 commit comments

Comments
 (0)