You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce the error during the execution, run the following code:
import os
from anchorpy import Wallet
from driftpy.keypair import load_keypair
from driftpy.drift_client import DriftClient
from solana.rpc.async_api import AsyncClient
import asyncio
keypair_file = os.path.expanduser('~/.config/solana/my-keypair.json')
keypair = load_keypair(keypair_file)
wallet = Wallet(keypair)
url = 'https://api.mainnet-beta.solana.com'
connection = AsyncClient(url)
drift_client = DriftClient(connection, wallet, 'mainnet')
async def initialize_user():
tx_sig = await drift_client.initialize_user(sub_account_id=0, name='toly')
asyncio.run(initialize_user())
Expected Behavior:
I want to initialize a user
Actual Behavior:
Encountered a ValueError: mutable default <class 'sumtypes.NONE'> for field post_only is not allowed: use default_factory
Error Message/Stack Trace: Traceback (most recent call last): File "/home/[username]/[project_directory]/initial_play.py", line 10, in <module> from driftpy.drift_client import DriftClient File "/home/[username]/[python_environment]/site-packages/driftpy/drift_client.py", line 22, in <module> from driftpy.account_subscription_config import AccountSubscriptionConfig File "/home/[username]/[python_environment]/site-packages/driftpy/account_subscription_config.py", line 6, in <module> from driftpy.accounts.bulk_account_loader import BulkAccountLoader File "/home/[username]/[python_environment]/site-packages/driftpy/accounts/__init__.py", line 1, in <module> from .get_accounts import * File "/home/[username]/[python_environment]/site-packages/driftpy/accounts/get_accounts.py", line 7, in <module> from driftpy.types import * File "/home/[username]/[python_environment]/site-packages/driftpy/types.py", line 336, in <module> @dataclass File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 1230, in dataclass return wrap(cls) File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 1220, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'sumtypes.NONE'> for field post_only is not allowed: use default_factory
The text was updated successfully, but these errors were encountered:
Environment:
To Reproduce the error during the execution, run the following code:
Expected Behavior:
I want to initialize a user
Actual Behavior:
Encountered a ValueError: mutable default <class 'sumtypes.NONE'> for field post_only is not allowed: use default_factory
Error Message/Stack Trace:
Traceback (most recent call last): File "/home/[username]/[project_directory]/initial_play.py", line 10, in <module> from driftpy.drift_client import DriftClient File "/home/[username]/[python_environment]/site-packages/driftpy/drift_client.py", line 22, in <module> from driftpy.account_subscription_config import AccountSubscriptionConfig File "/home/[username]/[python_environment]/site-packages/driftpy/account_subscription_config.py", line 6, in <module> from driftpy.accounts.bulk_account_loader import BulkAccountLoader File "/home/[username]/[python_environment]/site-packages/driftpy/accounts/__init__.py", line 1, in <module> from .get_accounts import * File "/home/[username]/[python_environment]/site-packages/driftpy/accounts/get_accounts.py", line 7, in <module> from driftpy.types import * File "/home/[username]/[python_environment]/site-packages/driftpy/types.py", line 336, in <module> @dataclass File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 1230, in dataclass return wrap(cls) File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 1220, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) File "/home/[username]/[python_environment]/site-packages/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'sumtypes.NONE'> for field post_only is not allowed: use default_factory
The text was updated successfully, but these errors were encountered: