Skip to content

Commit 1317df8

Browse files
Feat/xcm precompile update (#996)
* add xtokens, update multilocation * update version * remove xcm-precompile from astar runtime * random proof size for weights * add logs * add WeightV2 struct, implement EvmData traits * minor changes * fix bug * typo fix and refactor * cleaning interface * add xcm const to primitives * fmt and refactor * refactor and remove old xcmv2.sol * remove old funcs and edits * update Action for Weightv2 * max weight info added * send_xcm into xcmv2 * refactor, weight unlimite logic change * add fee description and other fix
1 parent 192dbe6 commit 1317df8

File tree

12 files changed

+1934
-309
lines changed

12 files changed

+1934
-309
lines changed

Cargo.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

precompiles/utils/src/bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<K: Kind, S: Get<u32>> EvmData for BoundedBytesString<K, S> {
135135
writer.write_pointer(
136136
EvmDataWriter::new()
137137
.write(U256::from(length))
138-
.write(value)
138+
.write_raw_bytes(&value)
139139
.build(),
140140
);
141141
}

precompiles/utils/src/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl EvmDataWriter {
285285

286286
/// Write arbitrary bytes.
287287
/// Doesn't handle any alignement checks, prefer using `write` instead if possible.
288-
fn write_raw_bytes(mut self, value: &[u8]) -> Self {
288+
pub fn write_raw_bytes(mut self, value: &[u8]) -> Self {
289289
self.data.extend_from_slice(value);
290290
self
291291
}

precompiles/utils/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use sp_std::{marker::PhantomData, vec, vec::Vec};
4141

4242
pub mod bytes;
4343
pub mod data;
44+
pub mod xcm;
4445

4546
pub use data::{Address, Bytes, EvmData, EvmDataReader, EvmDataWriter};
4647
pub use precompile_utils_macro::{generate_function_selector, keccak256};

0 commit comments

Comments
 (0)