Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values in event are incorrectly displayed while creating a batch #807

Closed
4 tasks
kaustubhkapatral opened this issue Feb 25, 2022 · 0 comments · Fixed by #809
Closed
4 tasks

Values in event are incorrectly displayed while creating a batch #807

kaustubhkapatral opened this issue Feb 25, 2022 · 0 comments · Fixed by #809
Assignees
Labels
Type: Bug Something isn't working

Comments

@kaustubhkapatral
Copy link
Contributor

kaustubhkapatral commented Feb 25, 2022

Summary of Bug

There is a mismatch in regen.ecocredit.v1alpha1.EventReceive event. Values of tradeable and retired amount are swapped while being emmitted. Here is the response when create-batch cmd is executed

{
   "height":"1248",
   "txhash":"DE73F38A45B9BA469ECB866AF6122AEB4CE45DF31E783E0B7AB6E5E49564981B",
   "codespace":"",
   "code":0,
   "data":"0A470A282F726567656E2E65636F6372656469742E7631616C706861312E4D73674372656174654261746368121B0A194330312D32303232303130312D32303233303130312D303031",
   "raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/regen.ecocredit.v1alpha1.MsgCreateBatch\"}]},{\"type\":\"regen.ecocredit.v1alpha1.EventCreateBatch\",\"attributes\":[{\"key\":\"class_id\",\"value\":\"\\\"C01\\\"\"},{\"key\":\"batch_denom\",\"value\":\"\\\"C01-20220101-20230101-001\\\"\"},{\"key\":\"issuer\",\"value\":\"\\\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\\\"\"},{\"key\":\"total_amount\",\"value\":\"\\\"10000100\\\"\"},{\"key\":\"start_date\",\"value\":\"\\\"2022-01-01\\\"\"},{\"key\":\"end_date\",\"value\":\"\\\"2023-01-01\\\"\"},{\"key\":\"project_location\",\"value\":\"\\\"AB-CDE FG1 345\\\"\"}]},{\"type\":\"regen.ecocredit.v1alpha1.EventReceive\",\"attributes\":[{\"key\":\"sender\",\"value\":\"\\\"\\\"\"},{\"key\":\"recipient\",\"value\":\"\\\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\\\"\"},{\"key\":\"batch_denom\",\"value\":\"\\\"C01-20220101-20230101-001\\\"\"},{\"key\":\"tradable_amount\",\"value\":\"\\\"100\\\"\"},{\"key\":\"retired_amount\",\"value\":\"\\\"10000000\\\"\"},{\"key\":\"basket_denom\",\"value\":\"\\\"\\\"\"}]},{\"type\":\"regen.ecocredit.v1alpha1.EventRetire\",\"attributes\":[{\"key\":\"retirer\",\"value\":\"\\\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\\\"\"},{\"key\":\"batch_denom\",\"value\":\"\\\"C01-20220101-20230101-001\\\"\"},{\"key\":\"amount\",\"value\":\"\\\"100\\\"\"},{\"key\":\"location\",\"value\":\"\\\"ST-UVW XY Z12\\\"\"}]}]}]",
   "logs":[
      {
         "msg_index":0,
         "log":"",
         "events":[
            {
               "type":"message",
               "attributes":[
                  {
                     "key":"action",
                     "value":"/regen.ecocredit.v1alpha1.MsgCreateBatch"
                  }
               ]
            },
            {
               "type":"regen.ecocredit.v1alpha1.EventCreateBatch",
               "attributes":[
                  {
                     "key":"class_id",
                     "value":"\"C01\""
                  },
                  {
                     "key":"batch_denom",
                     "value":"\"C01-20220101-20230101-001\""
                  },
                  {
                     "key":"issuer",
                     "value":"\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\""
                  },
                  {
                     "key":"total_amount",
                     "value":"\"10000100\""
                  },
                  {
                     "key":"start_date",
                     "value":"\"2022-01-01\""
                  },
                  {
                     "key":"end_date",
                     "value":"\"2023-01-01\""
                  },
                  {
                     "key":"project_location",
                     "value":"\"AB-CDE FG1 345\""
                  }
               ]
            },
            {
               "type":"regen.ecocredit.v1alpha1.EventReceive",
               "attributes":[
                  {
                     "key":"sender",
                     "value":"\"\""
                  },
                  {
                     "key":"recipient",
                     "value":"\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\""
                  },
                  {
                     "key":"batch_denom",
                     "value":"\"C01-20220101-20230101-001\""
                  },
                  {
                     "key":"tradable_amount",
                     "value":"\"100\""
                  },
                  {
                     "key":"retired_amount",
                     "value":"\"10000000\""
                  },
                  {
                     "key":"basket_denom",
                     "value":"\"\""
                  }
               ]
            },
            {
               "type":"regen.ecocredit.v1alpha1.EventRetire",
               "attributes":[
                  {
                     "key":"retirer",
                     "value":"\"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc\""
                  },
                  {
                     "key":"batch_denom",
                     "value":"\"C01-20220101-20230101-001\""
                  },
                  {
                     "key":"amount",
                     "value":"\"100\""
                  },
                  {
                     "key":"location",
                     "value":"\"ST-UVW XY Z12\""
                  }
               ]
            }
         ]
      }
   ],
   "info":"",
   "gas_wanted":"200000",
   "gas_used":"88899",
   "tx":{
      "@type":"/cosmos.tx.v1beta1.Tx",
      "body":{
         "messages":[
            {
               "@type":"/regen.ecocredit.v1alpha1.MsgCreateBatch",
               "issuer":"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc",
               "class_id":"C01",
               "issuance":[
                  {
                     "recipient":"regen108fuazrugwhvf9sxknn2r5nyv24vaetaensyhc",
                     "tradable_amount":"10000000",
                     "retired_amount":"100",
                     "retirement_location":"ST-UVW XY Z12"
                  }
               ],
               "metadata":"Y2FyYm9uLWNyZWRpdA==",
               "start_date":"2022-01-01T00:00:00Z",
               "end_date":"2023-01-01T00:00:00Z",
               "project_location":"AB-CDE FG1 345"
            }
         ],
         "memo":"",
         "timeout_height":"0",
         "extension_options":[
            
         ],
         "non_critical_extension_options":[
            
         ]
      },
      "auth_info":{
         "signer_infos":[
            {
               "public_key":{
                  "@type":"/cosmos.crypto.secp256k1.PubKey",
                  "key":"AyqNQ+/abYo+K+ojOn/OtuO/ZmfjKGAyEsJF1ICv2ntD"
               },
               "mode_info":{
                  "single":{
                     "mode":"SIGN_MODE_DIRECT"
                  }
               },
               "sequence":"10"
            }
         ],
         "fee":{
            "amount":[
               {
                  "denom":"uregen",
                  "amount":"100"
               }
            ],
            "gas_limit":"200000",
            "payer":"",
            "granter":""
         }
      },
      "signatures":[
         "wdJSPjlrO0t6warT+DD3nP33pZEAnRAnZSfpcfQUccozQsEMcA9qqYkXxQMRQVF26L3nCYirxX03J3VRFvELJg=="
      ]
   },
   "timestamp":"2022-02-25T10:12:47Z"
}

Version

2.1.0 and v3.0.0-rc

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@aleem1314 aleem1314 added the Type: Bug Something isn't working label Feb 25, 2022
@robert-zaremba robert-zaremba self-assigned this Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants