Closed dominious1 closed 8 months ago
Generated files added after adding new parameter.
Generated files added after adding new parameter.
Great!
As I remember there were some problems with protobuf files when they were generated with too new protobuf. Please provide some information how You generated those files, what is Your OS? What version is of protoc
in Your system?
And one more think - please correct DCO: when You click "Details" You will see commands how to fix
Fantastic pull request. Thank you.
To make sure that everything is working I checked:
main
(all changes are merged)mkdir checking_internship
cd checking_internship
python -m venv $(pwd)/venv
source ./venv/bin/activate
pip3 install git+https://github.com/dominious1/iroha-python.git@addtitleparamtoAddAssetQuantity
code.py
(code.zip)
Most important part of the file is running the function:
def add_coin_to_admin_with_description(asset: str, amount='1000.00', desc=''):
"""
Add provided amount of specific units to admin account
"""
tx = iroha.transaction([
iroha.command('AddAssetQuantity',
asset_id=asset, amount=amount, description=desc)
])
IrohaCrypto.sign_transaction(tx, ADMIN_PRIVATE_KEY)
send_transaction_and_print_status(tx)
transactions {
payload {
reduced_payload {
commands {
add_asset_quantity {
asset_id: "coin#domain"
amount: "102"
description: "Testing description"
}
}
creator_account_id: "admin@test"
created_time: 1707045588320
quorum: 1
}
}
signatures {
public_key: "313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910"
signature: "7a904afaaa208fdb9ec0695e4c6f6acb3f36578d2af46741c143a9e3726b8de0b1b71fc323bdc0c27fbbdbe939298393476dd5b89d1e390e424004185a8cb101"
}
}
jq '.blockV1.payload.transactions[0].payload.reducedPayload' < 0000000000000004
{
"commands": [
{
"addAssetQuantity": {
"assetId": "coin#domain",
"amount": "102",
"description": "Testing description"
}
}
],
"creatorAccountId": "admin@test",
"createdTime": "1707045588320",
"quorum": 1
}
IMO it is done - fully working!
Introduce an optional
title
parameter to the commands.proto bufs GRPC forAddAssetQuantity
andSubtractAssetQuantity
. This enhancement facilitates a more flexible and comprehensive feature set, aligning with evolving requirements and ensuring seamless integration with the protobuf-based GRPC implementation.Technology stack:
To regenerate files based on predefined protobufs I used iroha-python/scripts/compile-proto.py
This is part of internship project: https://wiki.hyperledger.org/display/INTERN/Iroha+1%3A+extend+queries+with+optional+arguments
Link to PR to iroha repository compatible with those changes: https://github.com/hyperledger/iroha/pull/4003