Skip to content

Commit a469113

Browse files
authored
[release] Release 0.11.0 (#52)
* [release] Release 0.11.0 Update changelog since 0.11.0 was not released yet * [examples] Change funding 0 to funding 1 * [examples] Remove behavior depending on accounts not existing * [balance] Add ability to get balance of other coins * [deps] Update dependencies * [ci] Update poetry to 2.1.3 * [examples] Fix faucet 0 tokens * [examples] Fix script path & disable multisig test * [format] Fix formatting
1 parent c7526ea commit a469113

File tree

14 files changed

+267
-192
lines changed

14 files changed

+267
-192
lines changed

.github/actions/python-setup/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
# Install Poetry.
1919
- uses: snok/install-poetry@d45b6d76012debf457ab49dffc7fb7b2efe8071d # pin@v1.3.3
2020
with:
21-
version: 1.2.2
21+
version: 2.1.3
2222

2323
- name: Install poetry project
2424
if: inputs.pyproject_directory != ''

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ All notable changes to the Aptos Python SDK will be captured in this file. This
44

55
## Unreleased
66

7-
- **[Breaking Change]**: `ed25519` and `secp256k1` private key's `__str__` will now return the AIP-80 compliant string
8-
97
## 0.11.0
108

9+
- **[Breaking Change]**: `ed25519` and `secp256k1` private key's `__str__` will now return the AIP-80 compliant string
1110
- `PrivateKey.format_private_key` can now format a AIP-80 compliant private key
1211
- Removed strictness warnnings for `PrivateKey.parse_hex_input`
1312
- Make HTTP2 default
1413
- Update all dependencies
14+
- Add ability for `account_balance` with other coins
15+
- Upgrade to Poetry 2.1.3
1516

1617
## 0.10.0
1718

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ examples:
3737
examples_cli:
3838
poetry run python -m examples.hello_blockchain
3939
# poetry run python -m examples.large_package_publisher CURRENTLY BROKEN -- OUT OF GAS
40-
poetry run python -m examples.multisig
40+
#poetry run python -m examples.multisig CURRENTLY BROKEN requires aptos-core checkout
4141
poetry run python -m examples.object_code_deployment
4242
poetry run python -m examples.your_coin
4343

aptos_sdk/async_client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,24 @@ async def account(
117117
return response.json()
118118

119119
async def account_balance(
120-
self, account_address: AccountAddress, ledger_version: Optional[int] = None
120+
self,
121+
account_address: AccountAddress,
122+
ledger_version: Optional[int] = None,
123+
coin_type: Optional[str] = None,
121124
) -> int:
122125
"""
123126
Fetch the Aptos coin balance associated with the account.
124127
125128
:param account_address: Address of the account, with or without a '0x' prefix.
126129
:param ledger_version: Ledger version to get state of account. If not provided, it will be the latest version.
130+
:param coin_type: Coin type to get balance for, defaults to "0x1::aptos_coin::AptosCoin".
127131
:return: The Aptos coin balance associated with the account
128132
"""
133+
coin_type = coin_type or "0x1::aptos_coin::AptosCoin"
129134
result = await self.view_bcs_payload(
130135
"0x1::coin",
131136
"balance",
132-
[TypeTag(StructTag.from_str("0x1::aptos_coin::AptosCoin"))],
137+
[TypeTag(StructTag.from_str(coin_type))],
133138
[TransactionArgument(account_address, Serializer.struct)],
134139
ledger_version,
135140
)

examples/integration_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ async def test_multikey(self):
8181
async def test_multisig(self):
8282
from . import multisig
8383

84+
# This test is currently broken, needs an aptos core checkout
85+
return
8486
await multisig.main(False)
8587

8688
async def test_read_aggreagtor(self):

examples/multikey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def main():
5252

5353
# :!:>section_3
5454
alice_fund = faucet_client.fund_account(alice_address, 100_000_000)
55-
bob_fund = faucet_client.fund_account(bob.address(), 0) # <:!:section_3
55+
bob_fund = faucet_client.fund_account(bob.address(), 1) # <:!:section_3
5656
await asyncio.gather(*[alice_fund, bob_fund])
5757

5858
print("\n=== Initial Balances ===")

examples/multisig.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ async def main(should_wait_input=True):
417417
# :!:>section_12
418418
print("\n=== Invoking Move script ===")
419419

420-
with open(f"{build_path}bytecode_scripts/set_and_transfer_0.mv", "rb") as f:
420+
with open(
421+
f"{packages_dir}/upgrade/build/UpgradeAndGovern/bytecode_scripts/set_and_transfer_0.mv",
422+
"rb",
423+
) as f:
421424
script_code = f.read()
422425

423426
payload = Script(

examples/secp256k1_ecdsa_transfer_coin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def main():
2626

2727
# :!:>section_3
2828
alice_fund = faucet_client.fund_account(alice.address(), 100_000_000)
29-
bob_fund = faucet_client.fund_account(bob.address(), 0) # <:!:section_3
29+
bob_fund = faucet_client.fund_account(bob.address(), 1) # <:!:section_3
3030
await asyncio.gather(*[alice_fund, bob_fund])
3131

3232
print("\n=== Initial Balances ===")

examples/simulate_transfer_coin.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@ async def main():
4545
alice, TransactionPayload(payload)
4646
)
4747

48-
print("\n=== Simulate before creating Bob's Account ===")
49-
output = await rest_client.simulate_transaction(transaction, alice)
50-
assert output[0]["vm_status"] != "Executed successfully", "This shouldn't succeed"
51-
print(json.dumps(output, indent=4, sort_keys=True))
52-
5348
print("\n=== Simulate after creating Bob's Account ===")
54-
await faucet_client.fund_account(bob.address(), 0)
49+
await faucet_client.fund_account(bob.address(), 1)
5550
output = await rest_client.simulate_transaction(transaction, alice)
5651
assert output[0]["vm_status"] == "Executed successfully", "This should succeed"
5752
print(json.dumps(output, indent=4, sort_keys=True))

examples/transfer_coin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def main():
3030

3131
# :!:>section_3
3232
alice_fund = faucet_client.fund_account(alice.address(), 100_000_000)
33-
bob_fund = faucet_client.fund_account(bob.address(), 0) # <:!:section_3
33+
bob_fund = faucet_client.fund_account(bob.address(), 1) # <:!:section_3
3434
await asyncio.gather(*[alice_fund, bob_fund])
3535

3636
print("\n=== Initial Balances ===")

0 commit comments

Comments
 (0)