Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gmeta): gmeta crate removed completely #4347

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 4 additions & 92 deletions Cargo.lock

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

7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ members = [
"examples/messenger",
"examples/mul-by-const",
"examples/ncompose",
"examples/new-meta",
"examples/node",
"examples/out-of-memory",
"examples/piggy-bank",
Expand Down Expand Up @@ -88,8 +87,6 @@ members = [
"gcli",
"gclient",
"gcore",
"gmeta",
"gmeta/codegen",
"gprimitives",
"gsdk",
"gsdk/codegen",
Expand Down Expand Up @@ -228,8 +225,6 @@ gstd-codegen = { path = "gstd/codegen" }
gring = { path = "utils/gring" }
gsys = { path = "gsys" }
gtest = { path = "gtest" }
gmeta = { path = "gmeta" }
gmeta-codegen = { path = "gmeta/codegen" }
gprimitives = { path = "gprimitives", default-features = false }
gear-authorship = { path = "node/authorship" }
gear-core-backend = { path = "core-backend", default-features = false }
Expand Down Expand Up @@ -466,9 +461,7 @@ demo-init-fail-sender = { path = "examples/init-fail-sender" }
demo-init-wait = { path = "examples/init-wait", default-features = false }
demo-init-wait-reply-exit = { path = "examples/init-wait-reply-exit" }
demo-messenger = { path = "examples/messenger" }
demo-meta-io = { path = "examples/new-meta/io" }
demo-mul-by-const = { path = "examples/mul-by-const" }
demo-new-meta = { path = "examples/new-meta" }
demo-node = { path = "examples/node" }
demo-out-of-memory = { path = "examples/out-of-memory" }
demo-piggy-bank = { path = "examples/piggy-bank", features = ["debug"] }
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ doc:
@ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \
-p galloc -p gclient -p gcore -p gear-core-backend \
-p gear-core -p gear-core-processor -p gear-lazy-pages -p gear-core-errors \
-p gmeta -p gtest -p gear-wasm-builder -p gear-common \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why were other removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops misclick.... thank you

-p pallet-gear -p pallet-gear-gas -p pallet-gear-messenger -p pallet-gear-payment \
-p pallet-gear-program -p pallet-gear-rpc-runtime-api -p pallet-gear-rpc -p pallet-gear-scheduler -p gsdk
@ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \
Expand Down
1 change: 0 additions & 1 deletion examples/fungible-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repository.workspace = true
[dependencies]
gstd.workspace = true
hashbrown.workspace = true
gmeta.workspace = true
ft-io = { path = "io" }

[dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion examples/fungible-token/io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ repository.workspace = true

[dependencies]
gstd.workspace = true
gmeta.workspace = true
36 changes: 24 additions & 12 deletions examples/fungible-token/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,8 @@
#![no_std]

use core::ops::Range;
use gmeta::{In, InOut, Metadata, Out};
use gstd::{prelude::*, ActorId};

pub struct FungibleTokenMetadata;

impl Metadata for FungibleTokenMetadata {
type Init = In<InitConfig>;
type Handle = InOut<FTAction, FTEvent>;
type Others = ();
type Reply = ();
type Signal = ();
type State = Out<IoFungibleToken>;
}

#[derive(Debug, Decode, Encode, TypeInfo)]
#[codec(crate = gstd::codec)]
#[scale_info(crate = gstd::scale_info)]
Expand Down Expand Up @@ -92,3 +80,27 @@ pub struct IoFungibleToken {
pub allowances: Vec<(ActorId, Vec<(ActorId, u128)>)>,
pub decimals: u8,
}

impl InitConfig {
pub fn test_sequence() -> Self {
InitConfig {
name: "MyToken".to_string(),
symbol: "MTK".to_string(),
decimals: 18,
initial_capacity: None,
}
}
}

impl IoFungibleToken {
pub fn test_sequence() -> Self {
IoFungibleToken {
name: "MyToken".to_string(),
symbol: "MTK".to_string(),
total_supply: 0,
balances: vec![],
allowances: vec![],
decimals: 18,
}
}
}
2 changes: 2 additions & 0 deletions examples/fungible-token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#![cfg_attr(not(feature = "std"), no_std)]

pub use ft_io::*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case you can deprecate io crate at all

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in the next pr I should redo the example so that I don't inflate the size of this pr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved types to lib.rs


#[cfg(feature = "std")]
mod code {
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
Expand Down
33 changes: 0 additions & 33 deletions examples/new-meta/Cargo.toml

This file was deleted.

23 changes: 0 additions & 23 deletions examples/new-meta/build.rs

This file was deleted.

14 changes: 0 additions & 14 deletions examples/new-meta/io/Cargo.toml

This file was deleted.

Loading
Loading