From 1d56e4da59d7609d3d82203c3784960255f13419 Mon Sep 17 00:00:00 2001 From: slush Date: Thu, 15 Nov 2012 10:36:18 +0000 Subject: [PATCH] Reworked directory structure --- bitkey_proto/__init__.py | 0 bitkey_proto/bitkey.proto | 154 ------------------ bitkey_proto/build.sh | 5 - __init__.py => bitkeylib/__init__.py | 0 client.py => bitkeylib/client.py | 0 {bitkey_proto => bitkeylib}/mapping.py | 0 test.py => bitkeylib/test.py | 0 transport.py => bitkeylib/transport.py | 0 .../transport_pipe.py | 0 .../transport_serial.py | 0 10 files changed, 159 deletions(-) delete mode 100644 bitkey_proto/__init__.py delete mode 100644 bitkey_proto/bitkey.proto delete mode 100755 bitkey_proto/build.sh rename __init__.py => bitkeylib/__init__.py (100%) rename client.py => bitkeylib/client.py (100%) rename {bitkey_proto => bitkeylib}/mapping.py (100%) rename test.py => bitkeylib/test.py (100%) rename transport.py => bitkeylib/transport.py (100%) rename transport_pipe.py => bitkeylib/transport_pipe.py (100%) rename transport_serial.py => bitkeylib/transport_serial.py (100%) diff --git a/bitkey_proto/__init__.py b/bitkey_proto/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/bitkey_proto/bitkey.proto b/bitkey_proto/bitkey.proto deleted file mode 100644 index 2390fe692..000000000 --- a/bitkey_proto/bitkey.proto +++ /dev/null @@ -1,154 +0,0 @@ -enum Algorithm { - BIP32 = 0; - ELECTRUM = 1; -} - -enum ScriptType { - PAYTOADDRESS = 0; - PAYTOSCRIPTHASH = 1; -} - -// Response: None or Features -message Initialize { -} - -message Features { - optional string version = 1; - optional bool otp = 2; - optional bool pin = 3; - optional bool spv = 4; - optional uint64 maxfee_kb = 5; - repeated Algorithm algo = 6; -} - -// Description: Test if another side is still alive. -// Response: None or Success -message Ping { - optional string message = 1; -} - -// Description: Response message for previous request with given id. -message Success { - optional string message = 1; -} - -// Description: Response message for previous request with given id. -message Failure { - optional int32 code = 1; - optional string message = 2; -} - -// Response: UUID or Failure -message GetUUID { -} - -message UUID { - required bytes UUID = 1; -} - -message OtpRequest { - optional string message = 1; -} - -message OtpAck { - required string otp = 1; -} - -message OtpCancel { -} - -message PinRequest { - optional string message = 1; -} - -message PinAck { - required string pin = 1; -} - -message PinCancel { -} - -// Response: OtpRequest, Entropy, Failure -message GetEntropy { - required uint32 size = 1; -} - -message Entropy { - required bytes entropy = 1; -} - -// Response: Success, OtpRequest, PinRequest, Failure -message SetMaxFeeKb { - required uint64 maxfee_kb= 1; -} - -// Response: MasterPublicKey, Failure -message GetMasterPublicKey { - required Algorithm algo = 1 [default=BIP32]; -} - -message MasterPublicKey { - required bytes key = 1; -} - -// Response: Success, OtpRequest, Failure -message LoadDevice { - required string seed = 1; - optional bool otp = 2 [default=true]; - optional string pin = 3; - optional bool spv = 4 [default=true]; -} - -// Response: Success, OtpRequest, PinRequest, Failure -message ResetDevice { -} - -message TxOutput { - required string address = 1; - repeated uint32 address_n = 2; - required uint64 amount = 3; - required ScriptType script_type = 4; - repeated bytes script_args = 5; -} - -// Response: Success, SignedInput, Failure -message TxInput { - repeated uint32 address_n = 1; - required uint64 amount = 2; - required bytes prev_hash = 3; - required uint32 prev_index = 4; - optional bytes script_sig = 5; -} - -// Response: SignedTx, Success, OtpRequest, PinRequest, Failure -message SignTx { - required Algorithm algo = 1 [default=BIP32]; - optional bool stream = 2; // enable streaming - required uint64 fee = 3; - repeated TxOutput outputs = 4; - repeated TxInput inputs = 5; - optional uint32 inputs_count = 6; // for streaming - optional bytes random = 7; -} - -message SignedTx { - repeated bytes signature = 1; -} - -/* -inputs = [] # list of TxInput -for i in inputs: - for x in inputs: - send(x) - - signature = send(SignInput(i)) -*/ - -// Response: SignedInput, Failure -message SignInput { - required TxInput input = 1; -} - -message SignedInput { - required bytes signature = 1; -} \ No newline at end of file diff --git a/bitkey_proto/build.sh b/bitkey_proto/build.sh deleted file mode 100755 index b96dd453e..000000000 --- a/bitkey_proto/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd `dirname $0` - -protoc --python_out=. bitkey.proto diff --git a/__init__.py b/bitkeylib/__init__.py similarity index 100% rename from __init__.py rename to bitkeylib/__init__.py diff --git a/client.py b/bitkeylib/client.py similarity index 100% rename from client.py rename to bitkeylib/client.py diff --git a/bitkey_proto/mapping.py b/bitkeylib/mapping.py similarity index 100% rename from bitkey_proto/mapping.py rename to bitkeylib/mapping.py diff --git a/test.py b/bitkeylib/test.py similarity index 100% rename from test.py rename to bitkeylib/test.py diff --git a/transport.py b/bitkeylib/transport.py similarity index 100% rename from transport.py rename to bitkeylib/transport.py diff --git a/transport_pipe.py b/bitkeylib/transport_pipe.py similarity index 100% rename from transport_pipe.py rename to bitkeylib/transport_pipe.py diff --git a/transport_serial.py b/bitkeylib/transport_serial.py similarity index 100% rename from transport_serial.py rename to bitkeylib/transport_serial.py