Skip to content

Commit

Permalink
Implement applications feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ivnsch committed Dec 8, 2021
1 parent 9579687 commit e049dc7
Show file tree
Hide file tree
Showing 10 changed files with 626 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ algonaut_encoding = {path = "algonaut_encoding", version = "0.3.0"}
algonaut_transaction = {path = "algonaut_transaction", version = "0.3.0"}
thiserror = "1.0.23"
rmp-serde = "0.15.5"
tokio = { version = "1.6.0", features = ["rt-multi-thread", "macros"] }

[dev-dependencies]
dotenv = "0.15.0"
Expand Down
4 changes: 2 additions & 2 deletions algonaut_client/src/kmd/v1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::extensions::reqwest::ResponseExt;
use crate::Headers;
use crate::{error::ClientError, extensions::reqwest::to_header_map};
use algonaut_core::MultisigSignature;
use algonaut_core::{Address, MultisigSignature};
use algonaut_crypto::{Ed25519PublicKey, MasterDerivationKey};
use algonaut_model::kmd::v1::{
CreateWalletRequest, CreateWalletResponse, DeleteKeyRequest, DeleteKeyResponse,
Expand Down Expand Up @@ -263,7 +263,7 @@ impl Client {
&self,
wallet_handle: &str,
wallet_password: &str,
address: &str,
address: &Address,
) -> Result<ExportKeyResponse, ClientError> {
let req = ExportKeyRequest {
wallet_handle_token: wallet_handle.to_string(),
Expand Down
1 change: 1 addition & 0 deletions algonaut_transaction/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use rand::Rng;
use ring::signature::{Ed25519KeyPair, KeyPair};
use serde::{Deserialize, Serialize};

#[derive(Debug)]
pub struct Account {
seed: [u8; 32],
address: Address,
Expand Down
2 changes: 1 addition & 1 deletion algonaut_transaction/src/api_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl From<Transaction> for ApiTransaction {
api_t.app_id = call.app_id.and_then(num_as_api_option);
api_t.on_complete =
num_as_api_option(application_call_on_complete_to_int(&call.on_complete));
api_t.accounts = call.accounts.to_owned();
api_t.accounts = call.accounts.clone().and_then(vec_as_api_option);
api_t.approval_program = call
.approval_program
.to_owned()
Expand Down
4 changes: 2 additions & 2 deletions src/kmd/v1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use algonaut_client::kmd::v1::Client;
use algonaut_core::{MultisigSignature, ToMsgPack};
use algonaut_core::{Address, MultisigSignature, ToMsgPack};
use algonaut_crypto::{Ed25519PublicKey, MasterDerivationKey};
use algonaut_model::kmd::v1::{
CreateWalletResponse, DeleteKeyResponse, DeleteMultisigResponse, ExportKeyResponse,
Expand Down Expand Up @@ -134,7 +134,7 @@ impl Kmd {
&self,
wallet_handle: &str,
wallet_password: &str,
address: &str,
address: &Address,
) -> Result<ExportKeyResponse, AlgonautError> {
Ok(self
.client
Expand Down
12 changes: 10 additions & 2 deletions tests/features_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ mod step_defs;

#[tokio::main]
async fn main() {
integration::algod::World::run(integration_path("algod")).await;
integration::abi::World::run(integration_path("abi")).await;
// algod feature: omitted, this tests v1 and we don't support it anymore
// integration::algod::World::run(integration_path("algod")).await;

// ABI not supported yet
// integration::abi::World::run(integration_path("abi")).await;

integration::applications::World::cucumber()
.max_concurrent_scenarios(1)
.run(integration_path("applications"))
.await;
}

fn integration_path(feature_name: &str) -> String {
Expand Down
Loading

0 comments on commit e049dc7

Please sign in to comment.