-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from muun/privkey
[WIP] PrivateKey backed by cryptography
- Loading branch information
Showing
16 changed files
with
655 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
from network import Network | ||
from privkey import PrivateKey | ||
from pubkey import PublicKey | ||
from address import Address | ||
from script import Script | ||
from hdprivkey import HDPrivateKey | ||
from network import Network | ||
import network | ||
import ecdsa | ||
# from address import Address | ||
# from script import Script | ||
# from hdprivkey import HDPrivateKey | ||
from unit import Unit | ||
from uri import URI | ||
# from uri import URI | ||
|
||
import network | ||
import privkey | ||
import pubkey | ||
import unit | ||
# import uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
|
||
class BitforgeError(Exception): | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.cause = kwargs.pop('cause', None) | ||
self.prepare(*args, **kwargs) | ||
self.message = self.__doc__.format(**self.__dict__) | ||
|
||
def prepare(self): | ||
pass | ||
def prepare(self, message=None): | ||
if message is not None: | ||
self.__doc__ = message | ||
|
||
def __str__(self): | ||
return self.message | ||
|
||
|
||
class ObjectError(BitforgeError): | ||
|
||
def prepare(self, object): | ||
self.object = object | ||
|
||
|
||
class StringError(BitforgeError): | ||
|
||
def prepare(self, string): | ||
self.string = repr(string) | ||
self.length = len(string) | ||
|
||
|
||
class NumberError(BitforgeError): | ||
|
||
def prepare(self, number): | ||
self.number = number | ||
|
||
|
||
class KeyValueError(BitforgeError): | ||
|
||
def prepare(self, key, value): | ||
self.key = key | ||
self.value = value |
Oops, something went wrong.