Skip to content

Commit

Permalink
Merge pull request #22 from octopus-network/v2.2.0
Browse files Browse the repository at this point in the history
Upgrade to v2.2.0
  • Loading branch information
riversyang authored Sep 13, 2022
2 parents 1602cc3 + a620912 commit 2dad407
Show file tree
Hide file tree
Showing 44 changed files with 1,959 additions and 1,394 deletions.
327 changes: 111 additions & 216 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appchain-anchor-wrapper"
version = "2.1.1"
version = "2.2.0"
authors = ["Octopus Network"]
edition = "2021"

Expand All @@ -13,6 +13,7 @@ near-primitives = "0.5.0"
near-units = "0.2.0"
hex = "0.4.2"
num-format = "0.4.0"
parity-scale-codec = "2.0.0"
secp256k1-test = { package = "secp256k1", version = "0.20.3", features = ["rand-std", "recovery"] }
beefy-light-client = { git = "https://github.com/octopus-network/beefy-light-client.git", branch = "main" }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
Expand All @@ -24,7 +25,7 @@ mock-oct-token = { path = "./mock-oct-token" }
wrapped-appchain-token = { git = "https://github.com/octopus-network/wrapped-appchain-token.git", branch = "v2.0.0" }
wrapped-appchain-nft = { git = "https://github.com/octopus-network/wrapped-appchain-nft.git", branch = "main" }
tokio = { version = "1.14", features = ["full"] }
workspaces = "0.3"
workspaces = "0.4"

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion appchain-anchor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appchain-anchor"
version = "2.1.1"
version = "2.2.0"
authors = ["Octopus Network"]
edition = "2021"

Expand Down
16 changes: 9 additions & 7 deletions appchain-anchor/src/anchor_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ impl AnchorViewer for AppchainAnchor {
ANCHOR_VERSION.to_string()
}
//
fn get_appchain_template_type(&self) -> AppchainTemplateType {
self.appchain_template_type.clone()
}
//
fn get_owner_pk(&self) -> PublicKey {
self.owner_pk.clone()
}
Expand Down Expand Up @@ -60,11 +64,6 @@ impl AnchorViewer for AppchainAnchor {
.get()
.unwrap()
.index_range(),
index_range_of_anchor_event_history: self
.anchor_event_histories
.get()
.unwrap()
.index_range(),
index_range_of_staking_history: self.staking_histories.get().unwrap().index_range(),
nonce_range_of_appchain_messages: IndexRange {
start_index: U64::from(u64::from(appchain_messages.min_nonce())),
Expand Down Expand Up @@ -489,7 +488,10 @@ impl AnchorViewer for AppchainAnchor {
&self,
validator_id_in_appchain: String,
) -> Option<ValidatorProfile> {
let formatted_id = AccountIdInAppchain::new(Some(validator_id_in_appchain.clone()));
let formatted_id = AccountIdInAppchain::new(
Some(validator_id_in_appchain.clone()),
&self.appchain_template_type,
);
formatted_id.assert_valid();
self.validator_profiles
.get()
Expand Down Expand Up @@ -547,7 +549,7 @@ impl AnchorViewer for AppchainAnchor {
//
fn get_appchain_message_of(&self, nonce: u32) -> Option<AppchainMessage> {
let appchain_messages = self.appchain_messages.get().unwrap();
appchain_messages.get_message(nonce)
appchain_messages.get_message(&nonce)
}
//
fn get_appchain_messages(
Expand Down
Loading

0 comments on commit 2dad407

Please sign in to comment.