927: Add gettx command and have send command return the tx hash. #78

Merged
telackey merged 4 commits from telackey/927 into main 2024-08-20 03:19:49 +00:00
Member

To support cerc-io/stack-orchestrator#927, add a new token command gettx to inspect a previous transaction, and adjust the output of send to include the tx details.

For example:

❯ laconic registry tokens send --address laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu --type alnt --quantity 1000
{
  "tx": {
    "hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC",
    "height": 343369,
    "index": 0,
    "code": 0,
    "log": "",
    "sender": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s",
    "recipient": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu",
    "amount": "1000alnt"
  },
  "accounts": [
    {
      "address": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s",
      "pubKey": "AvOh0Hdjj5/YKMTPEm/oLgvpg4gIP1vB4d1NhBMq6/+B",
      "number": 3,
      "sequence": 91,
      "balance": [
        {
          "type": "alnt",
          "quantity": 1.2899999999709944e+22
        }
      ]
    },
    {
      "address": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu",
      "pubKey": "A7XYVHLemQYUjXe6VnSDlcyzLnpdJ8CE8zvDiZtgxqnT",
      "number": 1,
      "sequence": 1,
      "balance": [
        {
          "type": "alnt",
          "quantity": 1.289999999991e+22
        }
      ]
    }
  ]
}
❯ laconic registry tokens gettx --hash 977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC
{
  "hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC",
  "height": 343369,
  "index": 0,
  "code": 0,
  "log": "",
  "sender": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s",
  "recipient": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu",
  "amount": "1000alnt",
  "raw": "0A91010A8E010A1C2F636F736D6F732E62616E6B2E763162657461312E4D736753656E64126E0A2E6C61636F6E696331347763303777613372377270707275343367396A786B7A68716E686D76666D34646765793673122E6C61636F6E6963317971706337637966657470676D71746B6B30756B657675676561617539703063776D6A6C73751A0C0A04616C6E7412043130303012680A500A460A1F2F636F736D6F732E63727970746F2E736563703235366B312E5075624B657912230A2102F3A1D077638F9FD828C4CF126FE82E0BE98388083F5BC1E1DD4D84132AEBFF8112040A020801185A12140A0E0A04616C6E7412063430303030301080B5181A4088DF7BA4B63EA68E185AB2887C9EC29EBC4158874BC037816B8494AD36D3B2433B5223CECC336D4624BB7FEF4DBB4A8B5F4707ACD8E55443312009E9473DF821"
}
To support https://git.vdb.to/cerc-io/stack-orchestrator/issues/927, add a new token command `gettx` to inspect a previous transaction, and adjust the output of `send` to include the tx details. For example: ``` ❯ laconic registry tokens send --address laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu --type alnt --quantity 1000 { "tx": { "hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC", "height": 343369, "index": 0, "code": 0, "log": "", "sender": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s", "recipient": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu", "amount": "1000alnt" }, "accounts": [ { "address": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s", "pubKey": "AvOh0Hdjj5/YKMTPEm/oLgvpg4gIP1vB4d1NhBMq6/+B", "number": 3, "sequence": 91, "balance": [ { "type": "alnt", "quantity": 1.2899999999709944e+22 } ] }, { "address": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu", "pubKey": "A7XYVHLemQYUjXe6VnSDlcyzLnpdJ8CE8zvDiZtgxqnT", "number": 1, "sequence": 1, "balance": [ { "type": "alnt", "quantity": 1.289999999991e+22 } ] } ] } ``` ``` ❯ laconic registry tokens gettx --hash 977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC { "hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC", "height": 343369, "index": 0, "code": 0, "log": "", "sender": "laconic14wc07wa3r7rppru43g9jxkzhqnhmvfm4dgey6s", "recipient": "laconic1yqpc7cyfetpgmqtkk0ukevugeaau9p0cwmjlsu", "amount": "1000alnt", "raw": "0A91010A8E010A1C2F636F736D6F732E62616E6B2E763162657461312E4D736753656E64126E0A2E6C61636F6E696331347763303777613372377270707275343367396A786B7A68716E686D76666D34646765793673122E6C61636F6E6963317971706337637966657470676D71746B6B30756B657675676561617539703063776D6A6C73751A0C0A04616C6E7412043130303012680A500A460A1F2F636F736D6F732E63727970746F2E736563703235366B312E5075624B657912230A2102F3A1D077638F9FD828C4CF126FE82E0BE98388083F5BC1E1DD4D84132AEBFF8112040A020801185A12140A0E0A04616C6E7412063430303030301080B5181A4088DF7BA4B63EA68E185AB2887C9EC29EBC4158874BC037816B8494AD36D3B2433B5223CECC336D4624BB7FEF4DBB4A8B5F4707ACD8E55443312009E9473DF821" } ```
telackey added 1 commit 2024-08-20 00:34:05 +00:00
Add gettx command and have send command return the tx hash.
Some checks failed
Lint / lint (18.x) (pull_request) Successful in 1m8s
Tests / cli_tests (18.x) (pull_request) Failing after 9m2s
617a49fa12
telackey requested review from dboreham 2024-08-20 00:34:29 +00:00
dboreham requested changes 2024-08-20 01:06:20 +00:00
Dismissed
dboreham left a comment
Owner

Looks like the send coins test failed (understandable), and could we have a test for the gettx command?

Looks like the send coins test failed (understandable), and could we have a test for the gettx command?
telackey added 1 commit 2024-08-20 02:52:41 +00:00
tokens send test
All checks were successful
Lint / lint (18.x) (pull_request) Successful in 1m9s
Tests / cli_tests (18.x) (pull_request) Successful in 9m1s
3a02e91413
telackey added 1 commit 2024-08-20 02:56:23 +00:00
Check tx details
All checks were successful
Lint / lint (18.x) (pull_request) Successful in 1m10s
Tests / cli_tests (18.x) (pull_request) Successful in 8m55s
b0fd95cf11
telackey added 1 commit 2024-08-20 03:00:11 +00:00
gettx test
All checks were successful
Lint / lint (18.x) (pull_request) Successful in 1m10s
Tests / cli_tests (18.x) (pull_request) Successful in 8m54s
7708406771
Author
Member

Looks like the send coins test failed (understandable), and could we have a test for the gettx command?

Tests added.

> Looks like the send coins test failed (understandable), and could we have a test for the gettx command? Tests added.
telackey requested review from dboreham 2024-08-20 03:18:15 +00:00
dboreham approved these changes 2024-08-20 03:18:52 +00:00
telackey merged commit c67961869b into main 2024-08-20 03:19:49 +00:00
telackey deleted branch telackey/927 2024-08-20 03:19:50 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconic-registry-cli#78
No description provided.