Crates.io | tesseract-protocol-test |
lib.rs | tesseract-protocol-test |
version | 0.5.6 |
source | src |
created_at | 2023-12-18 19:07:05.822 |
updated_at | 2023-12-18 20:34:48.635316 |
description | Tesseract protocol for testing tessract, transports, etc. Useful when you don't want to handle real transactions yet. |
homepage | https://github.com/tesseract-one/ |
repository | https://github.com/tesseract-one/Tesseract.rs |
max_upload_size | |
id | 1073576 |
size | 8,387 |
use tesseract::client::Tesseract;
use tesseract::client::delegate::SingleTransportDelegate;
use tesseract_protocol_test::Test;
let client_tesseract = Tesseract::new(client::delegate::SingleTransportDelegate::arc())
.transport(your_transport_here);
let client_service = client_tesseract.service(Test::Protocol); //you can start calling methods of protocol
tesseract_protocol_test::Test::Protocol
#[async_trait]
pub trait TestService {
async fn sign_transaction(self: Arc<Self>, transaction: &str) -> Result<String>;
}
Requests wallet to sign a string. Returns a signed string.
let signed = Arc::clone(&client_service).sign_transaction("testTransaction"); //signed is a Future<Result<String, Error>>