Skip to content

Commit

Permalink
chore: 0.0.3 release with wow token deploy error handling (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase authored Nov 9, 2024
1 parent dec1a60 commit 000f308
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 73 deletions.
6 changes: 6 additions & 0 deletions cdp-agentkit-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## [0.0.3] - 2024-11-09

### Added

- Enhanced `wow_create_token` action error handling.

## [0.0.2] - 2024-11-07

### Added
Expand Down
27 changes: 15 additions & 12 deletions cdp-agentkit-core/cdp_agentkit_core/actions/wow/create_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,21 @@ def wow_create_token(wallet: Wallet, name: str, symbol: str) -> str:
"""
factory_address = get_factory_address(wallet.network_id)

invocation = wallet.invoke_contract(
contract_address=factory_address,
method="deploy",
abi=WOW_FACTORY_ABI,
args={
"_tokenCreator": wallet.default_address.address_id,
"_platformReferrer": "0x0000000000000000000000000000000000000000",
"_tokenURI": GENERIC_TOKEN_METADATA_URI,
"_name": name,
"_symbol": symbol,
},
).wait()
try:
invocation = wallet.invoke_contract(
contract_address=factory_address,
method="deploy",
abi=WOW_FACTORY_ABI,
args={
"_tokenCreator": wallet.default_address.address_id,
"_platformReferrer": "0x0000000000000000000000000000000000000000",
"_tokenURI": GENERIC_TOKEN_METADATA_URI,
"_name": name,
"_symbol": symbol,
},
).wait()
except Exception as e:
return f"Error creating Zora Wow ERC20 memecoin {e!s}"

return f"Created WoW ERC20 memecoin {name} with symbol {symbol} on network {wallet.network_id}.\nTransaction hash for the token creation: {invocation.transaction.transaction_hash}\nTransaction link for the token creation: {invocation.transaction.transaction_link}"

Expand Down
2 changes: 1 addition & 1 deletion cdp-agentkit-core/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

project = 'CDP Agentkit - Core'
author = 'Coinbase Developer Platform'
release = '0.0.2'
release = '0.0.3'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
44 changes: 22 additions & 22 deletions cdp-agentkit-core/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cdp-agentkit-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdp-agentkit-core"
version = "0.0.2"
version = "0.0.3"
description = "CDP Agentkit core primitives"
authors = ["John Peterson <john.peterson@coinbase.com>"]
readme = "README.md"
Expand Down
Empty file.
14 changes: 8 additions & 6 deletions cdp-agentkit-core/tests/actions/wow/test_create_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ def test_create_token_api_error(wallet_factory):
with patch.object(
mock_wallet, "invoke_contract", side_effect=Exception("API error")
) as mock_invoke:
with pytest.raises(Exception, match="API error"):
wow_create_token(
mock_wallet,
MOCK_NAME,
MOCK_SYMBOL,
)
action_response = wow_create_token(
mock_wallet,
MOCK_NAME,
MOCK_SYMBOL,
)

expected_response = "Error creating Zora Wow ERC20 memecoin API error"

assert action_response == expected_response
mock_invoke.assert_called_once_with(
contract_address=get_factory_address(MOCK_NETWORK_ID),
method="deploy",
Expand Down
7 changes: 7 additions & 0 deletions cdp-langchain/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## [0.0.2] - 2024-11-07

### Added

- Bump dependency `cdp-agentkit-core` to version `0.0.3`.


## [0.0.2] - 2024-11-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion cdp-langchain/cdp_langchain/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"
2 changes: 1 addition & 1 deletion cdp-langchain/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

project = 'CDP Agentkit - LangChain'
author = 'Coinbase Developer Platform'
release = '0.0.2'
release = '0.0.3'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
54 changes: 27 additions & 27 deletions cdp-langchain/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cdp-langchain/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdp-langchain"
version = "0.0.2"
version = "0.0.3"
description = "CDP Agentkit Langchain Extension"
authors = ["John Peterson <john.peterson@coinbase.com>"]
readme = "README.md"
Expand All @@ -15,7 +15,7 @@ langchain-openai = "^0.2.4"
langgraph = "^0.2.39"
cdp-sdk = "^0.10.3"
pydantic = "^2.0"
cdp-agentkit-core = "^0.0.2"
cdp-agentkit-core = "^0.0.3"

[tool.poetry.group.dev.dependencies]
ruff = "^0.7.1"
Expand Down

0 comments on commit 000f308

Please sign in to comment.