Skip to content

Commit

Permalink
Use milestone to determine message timestamps (#495)
Browse files Browse the repository at this point in the history
* Use milestone to determine message timestamps

* Fixed failing test

* Added cache for milestone response

* Added optional url parameter for get_node_info (#523)

* fix: reverts first iteration polling logic (#538)

* clippy fix

* Java binding fix

* fix: duplicated declaration

* cleanup

* fix: clippy

* fmt

* remove copy derive

* fix: java build

Co-authored-by: Charlie Varley <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2021
1 parent 68cdbd6 commit 0bdf04d
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 95 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chrono = { version = "0.4", features = ["serde"] }
futures = "0.3"
getset = "0.1"
hex = "0.4"
iota-core = { git = "https://github.com/iotaledger/iota.rs", rev = "8f14d53075222c91560db24478695a7db2238f16", features = ["mqtt"] }
iota-core = { git = "https://github.com/iotaledger/iota.rs", rev = "f84c97ddccb4a4323d300b32cc6028ff9eabe98b", features = ["mqtt"] }
log = "0.4"
once_cell = "1.5"
serde = { version = "1.0", features = ["derive"] }
Expand Down
52 changes: 26 additions & 26 deletions bindings/java/native/Cargo.lock

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

2 changes: 1 addition & 1 deletion bindings/java/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build = "build.rs"

[dependencies]
iota-wallet = { path = "../../../", version = "0.1.0" }
iota-core = { git = "https://github.com/iotaledger/iota.rs", rev = "8f14d53075222c91560db24478695a7db2238f16", features = ["mqtt"] }
iota-core = { git = "https://github.com/iotaledger/iota.rs", rev = "f84c97ddccb4a4323d300b32cc6028ff9eabe98b", features = ["mqtt"] }
bee-message = { git = "https://github.com/iotaledger/bee.git", branch = "chrysalis-pt-2" }
log = "0.4.6"
chrono = "0.4.6"
Expand Down
1 change: 0 additions & 1 deletion bindings/java/native/src/java_glue.rs.in
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ foreign_class!(
class TreasuryTransactionPayload {
self_type TreasuryTransactionPayload;
private constructor = empty;
fn TreasuryTransactionPayload::input(&self) -> MessageId;
fn TreasuryTransactionPayload::output(&self) -> u64;
}
);
9 changes: 7 additions & 2 deletions bindings/java/native/src/types/info_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ use iota::{
pub struct NodeInfoWrapper {
#[getset(get = "pub")]
url: String,
#[getset(get_copy = "pub")]
nodeinfo: InfoResponse,
}

impl NodeInfoWrapper {
pub fn nodeinfo(&self) -> InfoResponse {
self.nodeinfo.clone()
}
}

impl From<RustNodeInfoWrapper> for NodeInfoWrapper {
fn from(info: RustNodeInfoWrapper) -> Self {
Self {
Expand All @@ -38,7 +43,7 @@ impl From<RustNodeInfoWrapper> for NodeInfoWrapper {
}
}

#[derive(PartialEq, Getters, CopyGetters, Copy)]
#[derive(Clone, PartialEq, Getters, CopyGetters)]
pub struct InfoResponse {
#[getset(get = "pub")]
name: String,
Expand Down
11 changes: 2 additions & 9 deletions bindings/java/native/src/types/treasury.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2020 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_wallet::message::{MessageId, TreasuryTransactionPayload as TreasuryTransactionPayloadRust};
use iota_wallet::message::{TreasuryTransactionPayload as TreasuryTransactionPayloadRust};

use iota::{Input, Output};
use iota::Output;

pub struct TreasuryTransactionPayload {
payload: TreasuryTransactionPayloadRust,
Expand All @@ -16,13 +16,6 @@ impl From<TreasuryTransactionPayloadRust> for TreasuryTransactionPayload {
}

impl TreasuryTransactionPayload {
pub fn input(&self) -> MessageId {
if let Input::Treasury(payload) = self.payload.input() {
return payload.message_id().clone();
}
unreachable!()
}

pub fn output(&self) -> u64 {
if let Output::Treasury(payload) = self.payload.output() {
return payload.amount();
Expand Down
Loading

0 comments on commit 0bdf04d

Please sign in to comment.