Skip to content

Instantly share code, notes, and snippets.

Motivation

Smart-contract users may need to know what happened in case of error reply (handle_reply entrypoint) and system signal (handle_signal entrypoint).

Expected realization of error types must be generalized and stabilized because:

  1. Mainly, such types are returned from sys-calls which must return backward-compatible data across runtime upgrades after network release.
  2. We use a lot of generics for Ext (sys-calls buisness logic), Environment (backend unification) and mock tests.
@ark0f
ark0f / bevy_top_left.rs
Last active January 6, 2023 17:54
DOES NOT WARK BECAUSE OF FLICKERING; Top left origin with pixel-perfect scaling in 2D in Bevy
fn setup(mut commands: Commands) {
let mut camera = OrthographicCameraBundle::new_2d();
camera.orthographic_projection.window_origin = WindowOrigin::BottomLeft;
camera.orthographic_projection.scaling_mode = ScalingMode::WindowSize;
commands.spawn(camera);
}
fn top_left_origin(
windows: Res<Windows>,

Keybase proof

I hereby claim:

  • I am ark0f on github.
  • I am ark0f (https://keybase.io/ark0f) on keybase.
  • I have a public key ASB-EH8GCynGzW5jij0Zl2pAKY1FnHxcUhLQhXaw8ziOgQo

To claim this, I am signing this object: