SiaFoundation / walletd

A new Sia wallet
https://sia.tech/software/walletd
MIT License
15 stars 6 forks source link

Refactor wallet events to use updated types and format #134

Closed n8maninger closed 2 weeks ago

n8maninger commented 4 weeks ago

The calculation for pending transactions is wrong

n8maninger commented 4 weeks ago

@alexfreska this is also a bug in the backend, but it will end up breaking the frontend.

alexfreska commented 4 weeks ago

@alexfreska this is also a bug in the backend, but it will end up breaking the frontend.

No problem, I can put in a fix and add a test for the value in the UI e2e tests.

n8maninger commented 3 weeks ago

@alexfreska #135 has been merged, see https://github.com/SiaFoundation/walletd/pull/135#issue-2352249776 for API structure changes

alexfreska commented 3 weeks ago

@n8maninger what are the possible values of V2FileContractResolutionType?

n8maninger commented 3 weeks ago

@alexfreska

{
  "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
  "index": {
    "height": 0,
    "id": "bid:0000000000000000000000000000000000000000000000000000000000000000"
  },
  "timestamp": "0001-01-01T00:00:00Z",
  "maturityHeight": 0,
  "type": "v2ContractResolution",
  "data": {
    "parent": {
      "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
      "leafIndex": 0,
      "merkleProof": null,
      "v2FileContract": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "type": "expiration",
    "resolution": {}
  }
}
{
  "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
  "index": {
    "height": 0,
    "id": "bid:0000000000000000000000000000000000000000000000000000000000000000"
  },
  "timestamp": "0001-01-01T00:00:00Z",
  "maturityHeight": 0,
  "type": "v2ContractResolution",
  "data": {
    "parent": {
      "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
      "leafIndex": 0,
      "merkleProof": null,
      "v2FileContract": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "type": "finalization",
    "resolution": {
      "filesize": 0,
      "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
      "proofHeight": 0,
      "expirationHeight": 0,
      "renterOutput": {
        "value": "0",
        "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
      },
      "hostOutput": {
        "value": "0",
        "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
      },
      "missedHostValue": "0",
      "totalCollateral": "0",
      "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
      "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
      "revisionNumber": 0,
      "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
  }
}
{
  "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
  "index": {
    "height": 0,
    "id": "bid:0000000000000000000000000000000000000000000000000000000000000000"
  },
  "timestamp": "0001-01-01T00:00:00Z",
  "maturityHeight": 0,
  "type": "v2ContractResolution",
  "data": {
    "parent": {
      "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
      "leafIndex": 0,
      "merkleProof": null,
      "v2FileContract": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "type": "renewal",
    "resolution": {
      "finalRevision": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      },
      "newContract": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      },
      "renterRollover": "0",
      "hostRollover": "0",
      "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
  }
}
{
  "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
  "index": {
    "height": 0,
    "id": "bid:0000000000000000000000000000000000000000000000000000000000000000"
  },
  "timestamp": "0001-01-01T00:00:00Z",
  "maturityHeight": 0,
  "type": "v2ContractResolution",
  "data": {
    "parent": {
      "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
      "leafIndex": 0,
      "merkleProof": null,
      "v2FileContract": {
        "filesize": 0,
        "fileMerkleRoot": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "proofHeight": 0,
        "expirationHeight": 0,
        "renterOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "hostOutput": {
          "value": "0",
          "address": "addr:000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69"
        },
        "missedHostValue": "0",
        "totalCollateral": "0",
        "renterPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "hostPublicKey": "ed25519:0000000000000000000000000000000000000000000000000000000000000000",
        "revisionNumber": 0,
        "renterSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "hostSignature": "sig:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "type": "storage proof",
    "resolution": {
      "proofIndex": {
        "id": "h:0000000000000000000000000000000000000000000000000000000000000000",
        "leafIndex": 0,
        "merkleProof": null,
        "chainIndex": {
          "height": 0,
          "id": "bid:0000000000000000000000000000000000000000000000000000000000000000"
        }
      },
      "leaf": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "proof": null
    }
  }
}