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

fix deserialize proposal actions #951

Merged
Changes from 2 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
18 changes: 10 additions & 8 deletions crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::pin::Pin;
use core::str;
use std::time::Duration;

use borsh::{from_slice, to_vec};
use borsh::{from_slice, to_vec, BorshDeserialize};
use calimero_blobstore::config::BlobStoreConfig;
use calimero_blobstore::{BlobManager, FileSystem};
use calimero_context::config::ContextConfig;
Expand All @@ -31,10 +31,13 @@ use calimero_runtime::Constraint;
use calimero_server::config::ServerConfig;
use calimero_store::config::StoreConfig;
use calimero_store::db::RocksDB;
use calimero_store::entry::{Borsh, Codec};
MatejVukosav marked this conversation as resolved.
Show resolved Hide resolved
use calimero_store::key::ContextMeta as ContextMetaKey;
use calimero_store::Store;
use camino::Utf8PathBuf;
use eyre::{bail, eyre, Result as EyreResult};
use futures_util::sink::Buffer;
use futures_util::SinkExt;
use libp2p::gossipsub::{IdentTopic, Message, TopicHash};
use libp2p::identity::Keypair;
use rand::{thread_rng, Rng};
Expand Down Expand Up @@ -438,14 +441,13 @@ impl Node {
application_id: context.application_id,
});
};
for (proposal_id, actions) in &outcome.proposals {
// todo deserialize actions into Vec<ProposalAction>
let action = ProposalAction::Transfer {
receiver_id: "vuki.testnet".into(),
amount: 0,
};
let actions = vec![action];

for (proposal_id, actions) in &outcome.proposals {
let actions: Vec<ProposalAction> = BorshDeserialize::deserialize(&mut &actions[..])
MatejVukosav marked this conversation as resolved.
Show resolved Hide resolved
.map_err(|e| {
error!(%e, "Failed to deserialize proposal actions.");
CallError::InternalError
})?;
drop(
self.ctx_manager
.propose(
Expand Down
Loading