Foreign API documentation and small cleanup (#31)

* verify slate messages documentation

* rustfmt

* foreign API documentation

* rustfmt
This commit is contained in:
Yeastplume
2019-03-29 08:46:12 +00:00
committed by GitHub
parent f756b10d78
commit 7b8fe92f53
13 changed files with 360 additions and 88 deletions
+5 -5
View File
@@ -353,7 +353,7 @@ impl WalletCommAdapter for KeybaseWalletCommAdapter {
let blob = Slate::deserialize_upgrade(&msg);
match blob {
Ok(message) => {
let mut slate: Slate = message.clone().into();
let slate: Slate = message.clone().into();
let tx_uuid = slate.id;
// Reject multiple recipients channel for safety
@@ -382,15 +382,15 @@ impl WalletCommAdapter for KeybaseWalletCommAdapter {
let res = {
let mut w = wallet.lock();
w.open_with_credentials()?;
let r = foreign::receive_tx(&mut *w, &mut slate, None, None, false);
let r = foreign::receive_tx(&mut *w, &slate, None, None, false);
w.close()?;
r
};
match res {
// Reply to the same channel with topic SLATE_SIGNED
Ok(_) => {
let slate = slate
.serialize_to_version(Some(slate.version_info.orig_version))?;
Ok(s) => {
let slate =
s.serialize_to_version(Some(slate.version_info.orig_version))?;
// TODO: Send the same version of slate that was sent to us
let success = send(slate, channel, SLATE_SIGNED, TTL);
+1 -1
View File
@@ -217,7 +217,7 @@ where
let mut w = wallet.1.lock();
w.open_with_credentials()?;
// receive tx
foreign::receive_tx(&mut *w, &mut slate, None, None, false)?;
slate = foreign::receive_tx(&mut *w, &slate, None, None, false)?;
w.close()?;
}