Skip to content

Commit

Permalink
Merge pull request #2 from ritual-net/dev
Browse files Browse the repository at this point in the history
merge: `dev` -> `main` to cut `v0.1.0`
  • Loading branch information
anish-ritual authored Mar 20, 2024
2 parents 5904600 + d5288d6 commit a402db4
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 27 deletions.
11 changes: 4 additions & 7 deletions ar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,10 @@ class ArweaveNetworkException(ArweaveException):

ArweaveTransactionException = ArweaveException

from .arweave_lib import arql
from .block import Block
from .bundle import ANS104BundleHeader, ANS104DataItemHeader, Bundle, DataItem
from .peer import Peer
from .wallet import Wallet
from .transaction import Transaction
from .block import Block
from .chunk import Chunk
from .stream import PeerStream, GatewayStream
from .arweave_lib import arql
from .manifest import Manifest
from .bundle import Bundle, DataItem, ANS104BundleHeader, ANS104DataItemHeader
from .wallet import Wallet

5 changes: 2 additions & 3 deletions ar/arweave_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
# You should have received a copy of the GNU General Public License along with
# PyArweave. If not, see <https://www.gnu.org/licenses/>.

import json
from .peer import Peer

from . import DEFAULT_API_URL
from .peer import Peer
from .transaction import Transaction

TRANSACTION_DATA_LIMIT_IN_BYTES = 2000000

Expand Down
9 changes: 4 additions & 5 deletions ar/block.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import fractions
import io
from ar.utils import (
arbinenc, arintenc, arbindec, arintdec, b64enc_if_not_str, b64enc, b64dec
)

from ar.utils import arbindec, arbinenc, arintdec, arintenc, b64dec, b64enc_if_not_str
from ar.utils.deep_hash import deep_hash
from .chunk import Chunk

from . import FORK_2_4, FORK_2_5
from .transaction import Transaction
from . import FORK_2_4

# note: there are actually three different block formats in chain history,
# according to https://docs.arweave.org/developers/server/http-api#block-format
Expand Down
4 changes: 2 additions & 2 deletions ar/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def fromjson(cls, json):
@classmethod
def frombytes(cls, data):
stream = io.BytesIO(data)
return self.fromstream(stream)
return cls.fromstream(stream)

@classmethod
def fromstream(cls, stream):
Expand Down Expand Up @@ -161,7 +161,7 @@ def raw_public_key(self):
return self.raw_owner

@property
def public_key(Self):
def public_key(self):
return self.owner

@property
Expand Down
3 changes: 2 additions & 1 deletion ar/chunk.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import io

from .utils import arbinenc, arbindec, b64enc, b64dec
from .utils import arbindec, arbinenc, b64dec, b64enc
from .utils.merkle import Node as MerkleNode


class Chunk:
def __init__(self, data = None, data_path = None, tx_path = None, packing = 'unpacked'):
self.data = data
Expand Down
5 changes: 4 additions & 1 deletion ar/stream.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import io, ar
import io

import ar


class PeerStream(io.RawIOBase):
@classmethod
Expand Down
5 changes: 3 additions & 2 deletions ar/utils/ans104_signers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from Crypto.Util.number import bytes_to_long, long_to_bytes
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
from Crypto.Signature import pss
from Crypto.Util.number import bytes_to_long, long_to_bytes


class Signer:
owner_length = None
Expand All @@ -14,7 +15,7 @@ def sign(cls, private_key, raw_data):
raise NotImplementedError(cls.__name__ + '.sign')

@classmethod
def verify(public_key, raw_data, raw_signature):
def verify(cls, public_key, raw_data, raw_signature):
raise NotImplementedError(cls.__name__ + '.verify')

@classmethod
Expand Down
14 changes: 8 additions & 6 deletions ar/wallet.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import json
from jose import jwk
from jose.utils import base64url_decode

from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_PSS
from Crypto.Hash import SHA256
from jose import jwk
from jose.utils import base64url_decode

from . import DEFAULT_API_URL
from .peer import Peer
from .utils import (
winston_to_ar,
owner_to_address,
winston_to_ar,
)
from . import DEFAULT_API_URL
from .peer import Peer


class Wallet(object):
Expand Down

0 comments on commit a402db4

Please sign in to comment.