Skip to content

Commit

Permalink
Merge branch 'development' into template-add-hex-deser-for-types
Browse files Browse the repository at this point in the history
* development:
  fix!: peer sync (tari-project#657)
  fix(vn/ui): committee bucket information (tari-project#656)
  fix(engine): return engine error from instruction invocation  (tari-project#655)
  fix(walletd): fix race condition causing transaction to be marked as invalid (tari-project#654)
  ci: double test timeout
  fix(vn-webui): fix incorrect jsonrpc address (tari-project#645)
  fix: add feeclaim_xxx address parsing (tari-project#648)
  • Loading branch information
sdbondi committed Aug 16, 2023
2 parents 7a2ccc3 + d9b11b4 commit 74eb0a0
Show file tree
Hide file tree
Showing 65 changed files with 905 additions and 707 deletions.
2 changes: 1 addition & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.ci]
slow-timeout = { period = "30s", terminate-after=4 }
slow-timeout = { period = "60s", terminate-after=4 }

[profile.ci.junit] # this can be some other profile, too
path = "junit.xml"
Expand Down
59 changes: 41 additions & 18 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions applications/tari_dan_wallet_cli/src/command/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub struct SubmitManifestArgs {

#[derive(Debug, Args, Clone)]
pub struct SendArgs {
amount: u32,
amount: u64,
resource_address: ResourceAddress,
destination_public_key: FromHex<Vec<u8>>,
#[clap(flatten)]
Expand All @@ -147,7 +147,7 @@ pub struct SendArgs {

#[derive(Debug, Args, Clone)]
pub struct ConfidentialTransferArgs {
amount: u32,
amount: u64,
destination_public_key: FromHex<Vec<u8>>,
#[clap(flatten)]
common: CommonSubmitArgs,
Expand Down Expand Up @@ -370,7 +370,7 @@ pub async fn handle_send(args: SendArgs, client: &mut WalletDaemonClient) -> Res
let resp = client
.accounts_transfer(TransferRequest {
account: source_account_name,
amount: Amount::from(amount),
amount: Amount::try_from(amount)?,
resource_address,
destination_public_key,
fee,
Expand Down Expand Up @@ -402,7 +402,7 @@ pub async fn handle_confidential_transfer(
let resp = client
.accounts_confidential_transfer(ConfidentialTransferRequest {
account: source_account,
amount: Amount::from(amount),
amount: Amount::try_from(amount)?,
resource_address: resource_address.unwrap_or(CONFIDENTIAL_TARI_RESOURCE_ADDRESS),
validator_public_key: destination_public_key,
fee: common.fee.map(|f| f.try_into()).transpose()?,
Expand Down
2 changes: 2 additions & 0 deletions applications/tari_indexer/src/json_rpc/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,12 @@ impl JsonRpcHandlers {
),
)
})?;

let response = GetEpochManagerStatsResponse {
current_epoch,
current_block_height,
is_valid,
committee_shard: None,
};
Ok(JsonRpcResponse::success(answer_id, response))
}
Expand Down
61 changes: 27 additions & 34 deletions applications/tari_indexer/src/p2p/services/comms_peer_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ impl PeerProvider for CommsPeerProvider {
match self.peer_manager.find_by_public_key(addr).await? {
Some(peer) => Ok(DanPeer {
identity: peer.public_key,
addresses: peer
claims: peer
.addresses
.addresses()
.iter()
.filter_map(|a| {
let claim = a.source.peer_identity_claim().cloned();
claim.map(|claim| (a.address().clone(), claim))
})
.filter_map(|a| a.source.peer_identity_claim().cloned())
.collect(),
}),
None => Err(CommsPeerProviderError::PeerNotFound),
Expand All @@ -74,36 +71,36 @@ impl PeerProvider for CommsPeerProvider {
Box::new(self.peer_manager.all().await.unwrap().into_iter().map(|p| {
Ok(DanPeer {
identity: p.public_key,
addresses: p
claims: p
.addresses
.addresses()
.iter()
.filter_map(|a| {
let claim = a.source.peer_identity_claim().cloned();
claim.map(|claim| (a.address().clone(), claim))
})
.filter_map(|a| a.source.peer_identity_claim().cloned())
.collect(),
})
}))
}

async fn add_peer(&self, peer: DanPeer<Self::Addr>) -> Result<(), Self::Error> {
let node_id = NodeId::from_public_key(&peer.identity);
let addresses = MultiaddressesWithStats::new(
peer.claims
.iter()
.flat_map(|claim| {
claim.addresses.iter().map(|addr| {
MultiaddrWithStats::new(addr.clone(), PeerAddressSource::FromAnotherPeer {
peer_identity_claim: claim.clone(),
source_peer: peer.identity.clone(),
})
})
})
.collect(),
);
self.peer_manager
.add_peer(Peer::new(
peer.identity.clone(),
peer.identity,
node_id,
MultiaddressesWithStats::new(
peer.addresses
.iter()
.map(|(addr, claim)| {
MultiaddrWithStats::new(addr.clone(), PeerAddressSource::FromAnotherPeer {
peer_identity_claim: claim.clone(),
source_peer: peer.identity.clone(),
})
})
.collect(),
),
addresses,
PeerFlags::NONE,
PeerFeatures::NONE,
vec![],
Expand All @@ -122,16 +119,15 @@ impl PeerProvider for CommsPeerProvider {
peer.identity.clone(),
node_id,
MultiaddressesWithStats::new(
peer.addresses
peer.claims
.iter()
.map(|(addr, claim)| {
MultiaddrWithStats::new(
addr.clone(),
tari_comms::net_address::PeerAddressSource::FromAnotherPeer {
.flat_map(|claim| {
claim.addresses.iter().map(|addr| {
MultiaddrWithStats::new(addr.clone(), PeerAddressSource::FromAnotherPeer {
peer_identity_claim: claim.clone(),
source_peer: peer.identity.clone(),
},
)
})
})
})
.collect(),
),
Expand All @@ -156,14 +152,11 @@ impl PeerProvider for CommsPeerProvider {
match self.peer_manager.find_by_node_id(node_id).await? {
Some(peer) => Ok(DanPeer {
identity: peer.public_key,
addresses: peer
claims: peer
.addresses
.addresses()
.iter()
.filter_map(|a| {
let claim = a.source.peer_identity_claim().cloned();
claim.map(|claim| (a.address().clone(), claim))
})
.filter_map(|a| a.source.peer_identity_claim().cloned())
.collect(),
}),
None => Err(CommsPeerProviderError::PeerNotFound),
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_indexer_web_ui/src/utils/json_rpc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function getCommsStats() {
return await jsonRpc('get_comms_stats');
}
async function getAllVns(epoch: number) {
return await jsonRpc('get_all_vns', epoch);
return await jsonRpc('get_network_validators', {epoch});
}
async function getConnections() {
return await jsonRpc('get_connections');
Expand Down
1 change: 1 addition & 0 deletions applications/tari_validator_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ clap = { version = "3.2.5", features = ["env"] }
config = "0.13.0"
futures = { version = "^0.3.1" }
include_dir = "0.7.2"
indexmap = "2.0.0"
json5 = "0.2.2"
libsqlite3-sys = { version = "0.25", features = ["bundled"] }
lmdb-zero = "0.4.4"
Expand Down
Loading

0 comments on commit 74eb0a0

Please sign in to comment.