Skip to content

Instantly share code, notes, and snippets.

@jeremyjs
Last active January 17, 2023 18:31
Show Gist options
  • Save jeremyjs/3fd55594cdbc6069d09b5ec177ce99dd to your computer and use it in GitHub Desktop.
Save jeremyjs/3fd55594cdbc6069d09b5ec177ce99dd to your computer and use it in GitHub Desktop.
aup_update_examples
{
  "aupSchemaVersion": "1.0.0",
  "updateMetadata": {
    "aupSchemaVersion": "1.0.0",
    "md5": "e2553049ce7874ce99aa6bd35cc7cb65",
    "sha1": "ac4aa987025edc6c23ee6647011064d199afe7cc",
    "updateData": {
      "updates": [
        {
          "collection": "domains",
          "operation": "insertOne",
          "document": {
            "_id": "5e8662b7-b0fb-434e-a1d7-2ddf967959f0",
            "value": "aave.com",
            "trusted": true
          }
        },
        {
          "collection": "entities",
          "operation": "insertOne",
          "document": {
            "_id": "5b614159-cb6a-42f6-9efa-622ac201bd94",
            "name": "Aave",
            "trusted": true,
            "categoryIds": [],
            "contractIds": [],
            "domainIds": ["5e8662b7-b0fb-434e-a1d7-2ddf967959f0"],
            "urlIds": [],
            "socialProfileIds": []
          }
        }
      ]
    }
  },
  "validationMetadata": {
    "proposal": {
      "proposerId": "0c320632-a154-4ed5-b75d-11386ebf4ca6",
      "proposedAt": "2022-11-01T00:00:00Z"
    },
    "validation": {
      "initiatorId": "a79f2f10-896e-4d0c-a749-e970fe188b50",
      "initiatedAt": "2022-11-02T00:00:00Z",
      "validatedAt": "2022-11-06T00:00:00Z",
      "quorum": 3,
      "totality": 5,
      "validatorSet": {
        "a79f2f10-896e-4d0c-a749-e970fe188b50": {
          "decision": "approved",
          "decidedAt": "2022-11-02T00:00:00Z"
        },
        "b29970c8-d5ce-484c-9ac2-02d65e2099f4": {
          "decision": "approved",
          "decidedAt": "2022-11-04T00:00:00Z"
        },
        "c299875e-a2c0-412d-92a6-fc018e7ece02": {
          "decision": "denied",
          "decidedAt": "2022-11-05T00:00:00Z"
        },
        "cf3bb821-5a0c-4720-87bc-3bdda112c682": {
          "decision": "approved",
          "decidedAt": "2022-11-06T00:00:00Z"
        }
      }
    }
  }
}

updateData non-whitespace:

{"updates":[{"collection":"domains","operation":"insertOne","document":{"_id":"5e8662b7-b0fb-434e-a1d7-2ddf967959f0","value":"aave.com","trusted":true}},{"collection":"entities","operation":"insertOne","document":{"_id":"5b614159-cb6a-42f6-9efa-622ac201bd94","name":"Aave","trusted":true,"categoryIds":[],"contractIds":[],"domainIds":["5e8662b7-b0fb-434e-a1d7-2ddf967959f0"],"urlIds":[],"socialProfileIds":[]}}]}

updateData non-whitespace chars: 410 md5(updateData non-whitespace): e2553049ce7874ce99aa6bd35cc7cb65 sha1(updateData non-whitespace): ac4aa987025edc6c23ee6647011064d199afe7cc

{
  "aupSchemaVersion": "1.0.0",
  "updateMetadata": {
    "aupSchemaVersion": "1.0.0",
    "md5": "8653b32a25d6a63f9385d0a10340cd67",
    "sha1": "704ed9a8f2ee2713139d7e913f21da1d183e8963",
    "updateData": {
      "updates": [
        {
          "collection": "entities",
          "operation": "updateMany",
          "query": {
            "urlIds": { "$in": ["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"] }
          },
          "modification": {
            "$pullAll": {
              "urlIds": ["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"]
            }
          }
        },
        {
          "collection": "urls",
          "operation": "deleteOne",
          "id": "5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"
        }
      ]
    }
  },
  "validationMetadata": {
    "proposal": {
      "proposerId": "0c320632-a154-4ed5-b75d-11386ebf4ca6",
      "proposedAt": "2022-11-01T00:00:00Z"
    },
    "validation": {
      "initiatorId": "a79f2f10-896e-4d0c-a749-e970fe188b50",
      "initiatedAt": "2022-11-02T00:00:00Z",
      "validatedAt": "2022-11-06T00:00:00Z",
      "quorum": 3,
      "totality": 5,
      "validatorSet": {
        "a79f2f10-896e-4d0c-a749-e970fe188b50": {
          "decision": "approved",
          "decidedAt": "2022-11-03T00:00:00Z"
        },
        "b29970c8-d5ce-484c-9ac2-02d65e2099f4": {
          "decision": "approved",
          "decidedAt": "2022-11-04T00:00:00Z"
        },
        "c299875e-a2c0-412d-92a6-fc018e7ece02": {
          "decision": "denied",
          "decidedAt": "2022-11-05T00:00:00Z"
        },
        "cf3bb821-5a0c-4720-87bc-3bdda112c682": {
          "decision": "approved",
          "decidedAt": "2022-11-06T00:00:00Z"
        }
      }
    }
  }
}

updateData non-whitespace:

{"updates":[{"collection":"entities","operation":"updateMany","query":{"urlIds":{"$in":["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"]}},"update":{"$pullAll":{"urlIds":["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"]}}},{"collection":"urls","operation":"deleteOne","id":"5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"}]}

updateData non-whitespace chars: 296 md5(updateData non-whitespace): 8653b32a25d6a63f9385d0a10340cd67 sha1(updateData non-whitespace): 704ed9a8f2ee2713139d7e913f21da1d183e8963

{
  "aupSchemaVersion": "1.0.0",
  "updateMetadata": {
    "aupSchemaVersion": "1.0.0",
    "md5": "e0d85143d2729790a51e71c5f9311d92",
    "sha1": "29682f7bdb2f289fcb147f79ebcdc6e3fde9309d",
    "updateData": {
      "updates": [
        {
          "collection": "networks",
          "operation": "insertOne",
          "document": {
            "_id": "15a342f9-9b2e-45f3-8462-141bd7fc9016",
            "name": "Ethereum",
            "networkId": "1",
            "chainId": "1",
            "explorerUrl": "https://etherscan.io/"
          }
        },
        {
          "collection": "contracts",
          "operation": "insertOne",
          "document": {
            "_id": "935a77ce-f774-4e84-8ef0-0dabcbcb844b",
            "networkId": "15a342f9-9b2e-45f3-8462-141bd7fc9016",
            "address": "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9",
            "name": "Aave: Lending Pool V2",
            "trusted": true,
            "auditedBy": []
          }
        },
        {
          "collection": "entityCategories",
          "operation": "insertOne",
          "document": {
            "_id": "45a31285-2319-4d76-b186-6c50e3ddecca",
            "value": "Lending Protocol"
          }
        },
        {
          "collection": "socialProfiles",
          "operation": "insertOne",
          "document": {
            "_id": "aa3e515a-3734-427d-acf0-b47f51cd2537",
            "handle": "AaveAave",
            "url": "https://twitter.com/AaveAave",
            "trusted": true
          }
        },
        {
          "collection": "urls",
          "operation": "insertOne",
          "document": {
            "_id": "5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a",
            "value": "https://golden.com/wiki/Aave-MNE8XWN",
            "trusted": true
          }
        },
        {
          "collection": "entities",
          "operation": "updateOne",
          "id": "5b614159-cb6a-42f6-9efa-622ac201bd94",
          "update": {
            "$addToSet": {
              "categoryIds": ["45a31285-2319-4d76-b186-6c50e3ddecca"],
              "contractIds": ["935a77ce-f774-4e84-8ef0-0dabcbcb844b"],
              "urlIds": ["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"],
              "socialProfileIds": ["aa3e515a-3734-427d-acf0-b47f51cd2537"]
            }
          }
        }
      ]
    }
  },
  "validationMetadata": {
    "proposal": {
      "proposerId": "0c320632-a154-4ed5-b75d-11386ebf4ca6",
      "proposedAt": "2022-11-01T00:00:00Z"
    },
    "validation": {
      "initiatorId": "a79f2f10-896e-4d0c-a749-e970fe188b50",
      "initiatedAt": "2022-11-02T00:00:00Z",
      "validatedAt": "2022-11-06T00:00:00Z",
      "quorum": 3,
      "totality": 5,
      "validatorSet": {
        "a79f2f10-896e-4d0c-a749-e970fe188b50": {
          "decision": "approved",
          "decidedAt": "2022-11-03T00:00:00Z"
        },
        "b29970c8-d5ce-484c-9ac2-02d65e2099f4": {
          "decision": "approved",
          "decidedAt": "2022-11-04T00:00:00Z"
        },
        "c299875e-a2c0-412d-92a6-fc018e7ece02": {
          "decision": "denied",
          "decidedAt": "2022-11-05T00:00:00Z"
        },
        "cf3bb821-5a0c-4720-87bc-3bdda112c682": {
          "decision": "approved",
          "decidedAt": "2022-11-06T00:00:00Z"
        }
      }
    },
  }
}

updateData non-whitespace:

{"updates":[{"collection":"networks","operation":"insertOne","document":{"_id":"15a342f9-9b2e-45f3-8462-141bd7fc9016","name":"Ethereum","networkId":"1","chainId":"1","explorerUrl":"https://etherscan.io/"}},{"collection":"contracts","operation":"insertOne","document":{"_id":"935a77ce-f774-4e84-8ef0-0dabcbcb844b","networkId":"15a342f9-9b2e-45f3-8462-141bd7fc9016","address":"0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9","name":"Aave:LendingPoolV2","trusted":true,"auditedBy":[]}},{"collection":"entityCategories","operation":"insertOne","document":{"_id":"45a31285-2319-4d76-b186-6c50e3ddecca","value":"LendingProtocol"}},{"collection":"socialProfiles","operation":"insertOne","document":{"_id":"aa3e515a-3734-427d-acf0-b47f51cd2537","handle":"AaveAave","url":"https://twitter.com/AaveAave","trusted":true}},{"collection":"urls","operation":"insertOne","document":{"_id":"5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a","value":"https://golden.com/wiki/Aave-MNE8XWN","trusted":true}},{"collection":"entities","operation":"updateOne","id":"5b614159-cb6a-42f6-9efa-622ac201bd94","update":{"$addToSet":{"categoryIds":["45a31285-2319-4d76-b186-6c50e3ddecca"],"contractIds":["935a77ce-f774-4e84-8ef0-0dabcbcb844b"],"urlIds":["5cbd2b54-8bce-4cf8-941a-b6d88c9bfe3a"],"socialProfileIds":["aa3e515a-3734-427d-acf0-b47f51cd2537"]}}}]}

updateData non-whitespace chars: 1308 md5(updateData non-whitespace): e0d85143d2729790a51e71c5f9311d92 sha1(updateData non-whitespace): 29682f7bdb2f289fcb147f79ebcdc6e3fde9309d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment