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

Contracts info endpoint #542

Merged
merged 4 commits into from
May 28, 2024
Merged

Contracts info endpoint #542

merged 4 commits into from
May 28, 2024

Conversation

tdroxler
Copy link
Member

Some examples:

curl -s 'http://localhost:9090/contracts/29VTmL2Hc9Uq2NnVQN8GeXiPFKr9guHeTTaL2ZzNDSaiB/info' | jq
[
  {
    "parent": "yAEfa2Aw495wcfb6up8wtnriStQ5VsGVh4xgJrZpnBbm",
    "creationBlockHash": "000000000001b1b4dbce66c957b35f05812faab7226e1d3d98711cf89502a0f0",
    "creationTxHash": "96858d80612d09dd25013491e9271f2b694717302fc6ef707a22be0fc8bbb273",
    "creationTimestamp": 1709727660363,
    "creationEventOrder": 6,
    "destructionBlockHash": null,
    "destructionTxHash": null,
    "destructionTimestamp": null,
    "destructionEventOrder": null,
    "category": "0003",
    "interfaceId": "non-fungible"
  }
]

The second one we can see the contract was destroyed and recreated:

curl -s 'http://localhost:9090/contracts/285FUvYcqmtx8WEJXa8sZPG9zRfyB7FockScnZcXDbHvo/info' | jq
[
  {
    "parent": "21ixd5J8qVjcAHkGsSsDTnjcgk85dZLSFvdtiCzYkuqBD",
    "creationBlockHash": "00000000000238b6362498d705ede972c632f62dab3e187b95dd108a77173cb0",
    "creationTxHash": "90f9e9bd27ffaf1bac5a07b68d9aef31123c6f2eb7fa5808e99034f89f297987",
    "creationTimestamp": 1711406997640,
    "creationEventOrder": 1,
    "destructionBlockHash": null,
    "destructionTxHash": null,
    "destructionTimestamp": null,
    "destructionEventOrder": null,
    "category": "0003",
    "interfaceId": "non-fungible"
  },
  {
    "parent": "21ixd5J8qVjcAHkGsSsDTnjcgk85dZLSFvdtiCzYkuqBD",
    "creationBlockHash": "0000000000017bf9046a116d34f5cc140ed9ba6c8cf101b7d197639904cacba0",
    "creationTxHash": "9279eaaf0919a21290e29dc4c58047676f5fa7d40454984e965b712d8e8d565c",
    "creationTimestamp": 1709841055748,
    "creationEventOrder": 5,
    "destructionBlockHash": "000000000000594f1ef510569386b99c0629770398d3a2cebcd05821074b07b0",
    "destructionTxHash": "aec473777deaa1b53853d38d9482e27170c51c27bf8f61d402bffc318ce29a7b",
    "destructionTimestamp": 1711167907766,
    "destructionEventOrder": 1,
    "category": "0003",
    "interfaceId": "non-fungible"
  }
]

@tdroxler tdroxler requested a review from h0ngcha0 May 27, 2024 13:53
@tdroxler
Copy link
Member Author

resolves: #541

We only return the latest contract info and if there are multiple info,
we also check that we return the latest one from main chain
@tdroxler tdroxler merged commit 0ff18e7 into master May 28, 2024
1 check passed
@tdroxler tdroxler deleted the contracts-info branch May 28, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant