mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
Disable CORS validation, improve logging, fix build on nightly. (#129)
* Disable CORS validation, improve logging. * Fix build from nightly API change. * Rebuilt binaries
This commit is contained in:
committed by
Robert Habermeier
parent
40c7820c31
commit
8ff246eb8a
BIN
Binary file not shown.
Binary file not shown.
@@ -585,7 +585,15 @@ impl<C: PolkadotApi, R: TableRouter> bft::Proposer for Proposer<C, R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let polkadot_block = block_builder.bake();
|
let polkadot_block = block_builder.bake();
|
||||||
info!("Proposing block [number: {}; extrinsics: [{}], parent_hash: {}]", polkadot_block.header.number, polkadot_block.extrinsics.len(), polkadot_block.header.parent_hash);
|
info!("Proposing block [number: {}; hash: {}; parent_hash: {}; extrinsics: [{}]]",
|
||||||
|
polkadot_block.header.number,
|
||||||
|
Hash::from(polkadot_block.header.blake2_256()),
|
||||||
|
polkadot_block.header.parent_hash,
|
||||||
|
polkadot_block.extrinsics.iter()
|
||||||
|
.map(|xt| format!("{}", Hash::from(xt.blake2_256())))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ")
|
||||||
|
);
|
||||||
|
|
||||||
let substrate_block = Slicable::decode(&mut polkadot_block.encode().as_slice())
|
let substrate_block = Slicable::decode(&mut polkadot_block.encode().as_slice())
|
||||||
.expect("polkadot blocks defined to serialize to substrate blocks correctly; qed");
|
.expect("polkadot blocks defined to serialize to substrate blocks correctly; qed");
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -20,17 +20,17 @@ mod __impl {
|
|||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
extern crate pwasm_libc;
|
extern crate pwasm_libc;
|
||||||
|
|
||||||
use self::alloc::heap::{Alloc, Layout, AllocErr};
|
use self::alloc::heap::{GlobalAlloc, Layout, Opaque};
|
||||||
|
|
||||||
use super::WasmAllocator;
|
use super::WasmAllocator;
|
||||||
|
|
||||||
unsafe impl<'a> Alloc for &'a WasmAllocator {
|
unsafe impl GlobalAlloc for WasmAllocator {
|
||||||
unsafe fn alloc(&mut self, layout: Layout) -> Result<*mut u8, AllocErr> {
|
unsafe fn alloc(&self, layout: Layout) -> *mut Opaque {
|
||||||
Ok(pwasm_libc::malloc(layout.size()))
|
pwasm_libc::malloc(layout.size()) as *mut Opaque
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn dealloc(&mut self, ptr: *mut u8, _layout: Layout) {
|
unsafe fn dealloc(&self, ptr: *mut Opaque, _layout: Layout) {
|
||||||
pwasm_libc::free(ptr)
|
pwasm_libc::free(ptr as *mut u8)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,5 +46,6 @@ pub fn start_http(
|
|||||||
http::ServerBuilder::new(io)
|
http::ServerBuilder::new(io)
|
||||||
.threads(4)
|
.threads(4)
|
||||||
.rest_api(http::RestApi::Unsecure)
|
.rest_api(http::RestApi::Unsecure)
|
||||||
|
.cors(http::DomainsValidation::Disabled)
|
||||||
.start_http(addr)
|
.start_http(addr)
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user