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

Add Type field for wallet events #122

Merged
merged 1 commit into from
May 17, 2024

Conversation

n8maninger
Copy link
Member

@n8maninger n8maninger commented May 17, 2024

Removes the eventData interface and the custom json encoding in favor of a field on the Event struct. This does remove the limited guarantees we have about the data aligning with the type, but in practice its not a significant enough downside to justify the custom marshalling.

@alexfreska this will break the UI... Again.. Actually, it will not

{
  "id": "h:a0f44763dbb2d2f95eec0f20f18bda75e7026297b6172f73449f3c3d67c2099c",
  "index": {
    "height": 997,
    "id": "bid:000000004d7b155547e163ea4933c28cf2171c43c0c02e50c04f6718f6af37f0"
  },
  "timestamp": "2023-01-16T02:06:49Z",
  "maturityHeight": 997,
  "relevant": null,
  "type": "transaction",
  "data": {
    "siacoinInputs": [
      {
        "id": "h:35b81e41f594d7faeb88bd8eaac2eaa68ce99fe1c8fe5f0cba8fafa65ab3a70e",
        "leafIndex": 0,
        "merkleProof": null,
        "siacoinOutput": {
          "value": "1000000000000000000000000000000000000",
          "address": "addr:3d7f707d05f2e0ec7ccc9220ed7c8af3bc560fbee84d068c2cc28151d617899e1ee8bc069946"
        },
        "maturityHeight": 0
      }
    ],
    "siacoinOutputs": [
      {
        "id": "h:674c765a9708e24528549c2ecf9c6cc99501a1d4909b9aa18ec64f14bccfef41",
        "leafIndex": 2133,
        "merkleProof": null,
        "siacoinOutput": {
          "value": "100000000000022500000000000000000000",
          "address": "addr:70cd9249053dc5d575aa74385a730fbe16b1c7997ddadc37a5d9abc8dbf12017cbd4bb3c48da"
        },
        "maturityHeight": 0
      },
      {
        "id": "h:4e4dc8a4b2147ba5783d803e645be14c54f1276f45a76c1cad060e41ded3733f",
        "leafIndex": 2134,
        "merkleProof": null,
        "siacoinOutput": {
          "value": "899999999999977500000000000000000000",
          "address": "addr:6f2ff24633525e854d0106031daf6cc666d5b8610ff9fbbd676a1d1a95903c794e054de7a634"
        },
        "maturityHeight": 0
      }
    ],
    "siafundInputs": [],
    "siafundOutputs": [],
    "fileContracts": null,
    "v2FileContracts": null,
    "hostAnnouncements": null,
    "fee": "0"
  }
}

@n8maninger n8maninger merged commit 0a0e235 into master May 17, 2024
9 checks passed
@n8maninger n8maninger deleted the nate/remove-annoying-event-interface branch May 17, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant