Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

run with python version 3.10, get issue. #33

Closed
frankkeepgoing opened this issue May 4, 2022 · 4 comments
Closed

run with python version 3.10, get issue. #33

frankkeepgoing opened this issue May 4, 2022 · 4 comments

Comments

@frankkeepgoing
Copy link

thanks for your code, but i think some issue from my end, suppose the JSON part can't parse

My code :

privkey = seed_to_privkey(seed, path="m/44'/118'/0'/0/0")
tx = Transaction(
    privkey=privkey,
    account_num=account_number,
    sequence=1,
    fee=0,
    gas=80000,
    memo="",
    sync_mode='BROADCAST_MODE_SYNC',
    chain_id='korellia'
)
tx.add_transfer(
    recipient="kyve13nwxn4tuszwk6s93vk73xxe6xwf3ssauk5hhde", amount=10000
)
pushable_tx= tx.get_pushable()

api_base_url = "https://api.korellia.kyve.network"
headers = {'content-type': 'application/json'}
result = requests.post(api_base_url + "/cosmos/tx/v1beta1/txs", data=pushable_tx, proxies=proxies,headers=headers)
print(result.status_code, result.text)

The result :

400 {
  "code": 3,
  "message": "invalid empty tx",
  "details": [
  ]
}

the Json print:

{
  "tx": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "kyve1t5jjcj9terudp8serzcrsud86zgq8ad5zxxxx",
          "to_address": "kyve13nwxn4tuszwk6s93vk73xxe6xwf3ssaukxxxx",
          "amount": [
            {
              "denom": "uatom",
              "amount": "10000"
            }
          ]
        }
      }
    ],
    "fee": {
      "gas": "80000",
      "amount": [
        {
          "denom": "uatom",
          "amount": "0"
        }
      ]
    },
    "memo": "",
    "signatures": [
      {
        "signature": "yZ1Muoe1fQTdwD9wM56hs0mCJEO6S9sxDPEQaCxuL/ZF86zXRqlXMaip0wyKPh1isghjsichoUVoJPLN+KYHTA==",
        "pub_key": {
          "type": "tendermint/PubKeySecp256k1",
          "value": "A38+HgWr2p+qRCvMRuAMwNw6S3gdcGOoprByctGzqhrv"
        },
        "account_number": "26553",
        "sequence": "1"
      }
    ]
  },
  "mode": "BROADCAST_MODE_SYNC"
}
@ctrl-Felix
Copy link

There has been some fundamental changes in how the transaction needs to be submitted. That's why the current version isn't working anymore.

#32 is currently the pr for a fix. You could install it directly from the branch if you want or wait until it's completed and merged

@frankkeepgoing
Copy link
Author

Thanks a lot, The first transfer transaciton already on chain,

and one more query, #32 will include below delegate related support ?

{
  "txBody": {
    "messages": [
      {
        "type_url": "/kyve.registry.v1beta1.MsgDelegatePool",
        "value": "CitreXZlMTNud3huNHR1c3p3azZzOTN2azczeHhlNnh3ZjNzc2F1azVoaGRlEAAaK2t5dmUxYWVuZjhoODYzZGY4eGFxMmFobjZ5bDR4ZTA3dWwzcTA5ZjM2NzMggJTr3AM="
      }
    ],
    "memo": "",
    "timeoutHeight": "0",
    "extensionOptions": [],
    "nonCriticalExtensionOptions": []
  },
  "authInfo": {
    "signerInfos": [
      {
        "publicKey": {
          "typeUrl": "/cosmos.crypto.secp256k1.PubKey",
          "value": "CiED3/YCpuxOCZWLCbryNINRhy4ccbQaIFTeavu+Exhq+4E="
        },
        "modeInfo": {
          "single": {
            "mode": "SIGN_MODE_DIRECT"
          }
        },
        "sequence": "170"
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "tkyve",
          "amount": "0"
        }
      ],
      "gasLimit": "458845",
      "payer": "",
      "granter": ""
    }
  },
  "chainId": "korellia",
  "accountNumber": "11647"
}

@ctrl-Felix
Copy link

No, it won't. But I think we need some sort of possibility to add custom transaction types to the transaction

@frankkeepgoing
Copy link
Author

thanks again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants