Skip to content

Commit

Permalink
fix: added schemas for abi
Browse files Browse the repository at this point in the history
  • Loading branch information
frolvanya committed Jan 15, 2025
1 parent f4c0f4f commit 9bd4358
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 77 deletions.
80 changes: 45 additions & 35 deletions near/Cargo.lock

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

1 change: 1 addition & 0 deletions near/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ strum_macros = "0.26"
near-workspaces = "0.16.0"
tokio = "1.40"
anyhow = "1"
schemars = "0.8"
alloy-sol-types = "0.8"
ethereum-types = { version = "0.15.1", default-features = false, features = ["rlp", "serialize"] }
rlp = "0.6"
Expand Down
18 changes: 1 addition & 17 deletions near/omni-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,14 @@ publish = false
[lib]
crate-type = ["cdylib", "rlib"]

# fields to configure build with WASM reproducibility, according to specs
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
[package.metadata.near.reproducible_build]
# docker image, descriptor of build environment
image = "sourcescan/cargo-near:0.13.2-rust-1.84.0"
# tag after colon above serves only descriptive purpose; image is identified by digest
image_digest = "sha256:b41cb89907f92b114da9e2be4e109bff30ab792c22ddcbd2a4cff8e340cb9acb"
# list of environment variables names, whose values, if set, will be used as external build parameters
# in a reproducible manner
# supported by `sourcescan/cargo-near:0.10.1-rust-1.82.0` image or later images
passed_env = []
# build command inside of docker container
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
# the command may be any combination of flags of `cargo-near`,
# supported by respective version of binary inside the container besides `--no-locked` flag
container_build_command = ["cargo", "near", "build", "non-reproducible-wasm", "--locked"]

[dependencies]
near-sdk.workspace = true
near-contract-standards.workspace = true
hex.workspace = true
borsh.workspace = true
serde.workspace = true
near-plugins.workspace = true
schemars.workspace = true
omni-types.workspace = true

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion near/omni-bridge/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use near_contract_standards::storage_management::{StorageBalance, StorageBalance
use near_sdk::{assert_one_yocto, borsh};
use near_sdk::{env, near_bindgen, AccountId, NearToken};
use omni_types::TransferId;
use schemars::JsonSchema;

use crate::{
require, BorshDeserialize, BorshSerialize, ChainKind, Contract, ContractExt, Deserialize, Fee,
Expand All @@ -11,7 +12,7 @@ use crate::{
pub const BRIDGE_TOKEN_INIT_BALANCE: NearToken = NearToken::from_near(3);
pub const NEP141_DEPOSIT: NearToken = NearToken::from_yoctonear(1_250_000_000_000_000_000_000);

#[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize, Debug, Clone)]
#[derive(JsonSchema, BorshDeserialize, BorshSerialize, Serialize, Deserialize, Debug, Clone)]
pub struct TransferMessageStorageValue {
pub message: TransferMessage,
pub owner: AccountId,
Expand Down
3 changes: 2 additions & 1 deletion near/omni-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ authors = ["Near Inc <[email protected]>"]
edition = "2021"

[dependencies]
near-sdk.workspace = true
near-sdk = { workspace = true, features = ["abi"] }
near-contract-standards.workspace = true
hex.workspace = true
borsh.workspace = true
serde.workspace = true
strum_macros.workspace = true
ethereum-types.workspace = true
rlp.workspace = true
schemars.workspace = true
alloy-sol-types = "0.8"
alloy-sol-macro = "0.8"
alloy-primitives = { version = "0.8", features = ["rlp"] }
Expand Down
Loading

0 comments on commit 9bd4358

Please sign in to comment.