Skip to content

Commit

Permalink
Feat/xcm precompile update (#996)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gitofdeepanshu committed Oct 4, 2023
1 parent 192dbe6 commit 1317df8
Show file tree
Hide file tree
Showing 12 changed files with 1,934 additions and 309 deletions.
6 changes: 5 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion precompiles/utils/src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<K: Kind, S: Get<u32>> EvmData for BoundedBytesString<K, S> {
writer.write_pointer(
EvmDataWriter::new()
.write(U256::from(length))
.write(value)
.write_raw_bytes(&value)
.build(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion precompiles/utils/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl EvmDataWriter {

/// Write arbitrary bytes.
/// Doesn't handle any alignement checks, prefer using `write` instead if possible.
fn write_raw_bytes(mut self, value: &[u8]) -> Self {
pub fn write_raw_bytes(mut self, value: &[u8]) -> Self {
self.data.extend_from_slice(value);
self
}
Expand Down
1 change: 1 addition & 0 deletions precompiles/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use sp_std::{marker::PhantomData, vec, vec::Vec};

pub mod bytes;
pub mod data;
pub mod xcm;

pub use data::{Address, Bytes, EvmData, EvmDataReader, EvmDataWriter};
pub use precompile_utils_macro::{generate_function_selector, keccak256};
Expand Down
Loading

0 comments on commit 1317df8

Please sign in to comment.