Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
wax
Commits
c81ad1b4
Commit
c81ad1b4
authored
3 months ago
by
Jakub Ziebinski
Browse files
Options
Downloads
Patches
Plain Diff
Add the wax_options module
parent
8566d8df
No related branches found
No related tags found
1 merge request
!230
Implementation of the python wax interface
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
python/wax/__init__.py
+2
-0
2 additions, 0 deletions
python/wax/__init__.py
python/wax/interfaces.py
+6
-1
6 additions, 1 deletion
python/wax/interfaces.py
python/wax/wax_factory.py
+5
-2
5 additions, 2 deletions
python/wax/wax_factory.py
python/wax/wax_options.py
+12
-0
12 additions, 0 deletions
python/wax/wax_options.py
with
25 additions
and
3 deletions
python/wax/__init__.py
+
2
−
0
View file @
c81ad1b4
...
...
@@ -72,11 +72,13 @@ from .wax_result import (
)
from
.interfaces
import
IWaxBaseInterface
from
.wax_factory
import
create_wax_foundation
from
.wax_options
import
WaxOptions
__version__
=
"
0.0.0
"
__all__
=
[
"
IWaxBaseInterface
"
,
"
WaxOptions
"
,
"
create_wax_foundation
"
,
"
python_error_code
"
,
"
python_result
"
,
...
...
This diff is collapsed.
Click to expand it.
python/wax/interfaces.py
+
6
−
1
View file @
c81ad1b4
...
...
@@ -15,7 +15,7 @@ if TYPE_CHECKING:
NaiAsset
,
VestsNaiAssetConvertible
,
)
from
wax._private.models.basic
import
AccountName
,
Hex
,
PublicKey
,
Signature
from
wax._private.models.basic
import
AccountName
,
ChainId
,
Hex
,
PublicKey
,
Signature
from
wax._private.models.brain_key_data
import
BrainKeyData
from
wax._private.models.operations
import
Operation
from
wax._private.models.private_key_data
import
PrivateKeyData
...
...
@@ -37,6 +37,11 @@ class IManabarData(ABC):
class
IWaxBaseInterface
(
ABC
):
@property
@abstractmethod
def
chain_id
(
self
)
->
ChainId
:
"""
Returns the chain id.
"""
@property
@abstractmethod
def
config
(
self
)
->
ChainConfig
:
...
...
This diff is collapsed.
Click to expand it.
python/wax/wax_factory.py
+
5
−
2
View file @
c81ad1b4
...
...
@@ -3,11 +3,14 @@ from __future__ import annotations
from
typing
import
TYPE_CHECKING
from
wax._private.base_api
import
WaxBaseApi
from
wax.wax_options
import
WaxOptions
if
TYPE_CHECKING
:
from
wax.interfaces
import
IWaxBaseInterface
def
create_wax_foundation
()
->
IWaxBaseInterface
:
def
create_wax_foundation
(
options
:
WaxOptions
|
None
=
None
)
->
IWaxBaseInterface
:
"""
Factory function to provide wax base interface functionality.
"""
return
WaxBaseApi
(
_private
=
True
)
chain_id
=
options
.
chain_id
if
options
is
not
None
else
WaxOptions
().
chain_id
return
WaxBaseApi
(
chain_id
,
_private
=
True
)
This diff is collapsed.
Click to expand it.
python/wax/wax_options.py
0 → 100644
+
12
−
0
View file @
c81ad1b4
from
__future__
import
annotations
from
dataclasses
import
dataclass
,
field
from
wax._private.models.basic
import
ChainId
@dataclass
class
WaxOptions
:
chain_id
:
ChainId
=
field
(
default_factory
=
lambda
:
ChainId
(
"
18dcf0a285365fc58b71f18b3d3fec954aa0c141c44e4e5cb4cf777b9eab274e
"
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment