Skip to content

Commit

Permalink
Additional tests for contract chunking in forc (#6428)
Browse files Browse the repository at this point in the history
## Description

Test should all pass once FuelLabs/fuels-rs#1483
is released

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
  • Loading branch information
sdankel committed Aug 16, 2024
1 parent d2562a5 commit 2fde7ea
Show file tree
Hide file tree
Showing 3 changed files with 489 additions and 37 deletions.
310 changes: 307 additions & 3 deletions forc-plugins/forc-client/test/data/big_contract/big_contract-abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,325 @@
"specVersion": "1",
"encodingVersion": "1",
"concreteTypes": [
{
"type": "()",
"concreteTypeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
},
{
"type": "(bool, u64)",
"concreteTypeId": "c998ca9a5f221fe7b5c66ae70c8a9562b86d964408b00d17f883c906bc1fe4be",
"metadataTypeId": 0
},
{
"type": "[bool; 3]",
"concreteTypeId": "4926d35d1a5157936b0a29bc126b8aace6d911209a5c130e9b716b0c73643ea6",
"metadataTypeId": 2
},
{
"type": "[u64; 3]",
"concreteTypeId": "776fb5a3824169d6736138565fdc20aad684d9111266a5ff6d5c675280b7e199",
"metadataTypeId": 3
},
{
"type": "b256",
"concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
},
{
"type": "bool",
"concreteTypeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
},
{
"type": "enum Location",
"concreteTypeId": "6966f221767e2951c5d68ba5e81e897449375a9f51f5e4c9e3b65f1dd7defabb",
"metadataTypeId": 4
},
{
"type": "str[4]",
"concreteTypeId": "94f0fa95c830be5e4f711963e83259fe7e8bc723278ab6ec34449e791a99b53a"
},
{
"type": "struct Person",
"concreteTypeId": "a6b272bcf0f572840e2cc1241bdcf8d42db51eeb1aead750c8e608160f83f926",
"metadataTypeId": 6
},
{
"type": "struct SimpleStruct",
"concreteTypeId": "75f7f7a06026cab5d7a70984d1fde56001e83505e3a091ff9722b92d7f56d8be",
"metadataTypeId": 7
},
{
"type": "u16",
"concreteTypeId": "29881aad8730c5ab11d275376323d8e4ff4179aae8ccb6c13fe4902137e162ef"
},
{
"type": "u256",
"concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e"
},
{
"type": "u32",
"concreteTypeId": "d7649d428b9ff33d188ecbf38a7e4d8fd167fa01b2e10fe9a8f9308e52f1d7cc"
},
{
"type": "u64",
"concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
},
{
"type": "u8",
"concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b"
}
],
"metadataTypes": [
{
"type": "(_, _)",
"metadataTypeId": 0,
"components": [
{
"name": "__tuple_element",
"typeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
},
{
"name": "__tuple_element",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
}
]
},
{
"type": "[_; 2]",
"metadataTypeId": 1,
"components": [
{
"name": "__array_element",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
}
]
},
{
"type": "[_; 3]",
"metadataTypeId": 2,
"components": [
{
"name": "__array_element",
"typeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
}
]
},
{
"type": "[_; 3]",
"metadataTypeId": 3,
"components": [
{
"name": "__array_element",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
}
]
},
{
"type": "enum Location",
"metadataTypeId": 4,
"components": [
{
"name": "Earth",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
},
{
"name": "Mars",
"typeId": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d"
}
]
},
{
"type": "str",
"metadataTypeId": 5
},
{
"type": "struct Person",
"metadataTypeId": 6,
"components": [
{
"name": "name",
"typeId": 5
},
{
"name": "age",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
},
{
"name": "alive",
"typeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
},
{
"name": "location",
"typeId": 4
},
{
"name": "some_tuple",
"typeId": 0
},
{
"name": "some_array",
"typeId": 1
},
{
"name": "some_b256",
"typeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b"
}
]
},
{
"type": "struct SimpleStruct",
"metadataTypeId": 7,
"components": [
{
"name": "a",
"typeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903"
},
{
"name": "b",
"typeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
}
]
}
],
"metadataTypes": [],
"functions": [
{
"inputs": [],
"name": "test_function",
"name": "assert_configurables",
"output": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903",
"attributes": null
},
{
"inputs": [
{
"name": "loc",
"concreteTypeId": "6966f221767e2951c5d68ba5e81e897449375a9f51f5e4c9e3b65f1dd7defabb"
}
],
"name": "enum_input_output",
"output": "6966f221767e2951c5d68ba5e81e897449375a9f51f5e4c9e3b65f1dd7defabb",
"attributes": null
},
{
"inputs": [
{
"name": "index",
"concreteTypeId": "1506e6f44c1d6291cdf46395a8e573276a4fa79e8ace3fc891e092ef32d1b0a0"
}
],
"name": "get_storage",
"output": "29881aad8730c5ab11d275376323d8e4ff4179aae8ccb6c13fe4902137e162ef",
"attributes": [
{
"name": "storage",
"arguments": [
"read"
]
}
]
},
{
"inputs": [],
"name": "large_blob",
"output": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903",
"attributes": null
},
{
"inputs": [
{
"name": "value",
"concreteTypeId": "29881aad8730c5ab11d275376323d8e4ff4179aae8ccb6c13fe4902137e162ef"
}
],
"name": "push_storage",
"output": "2e38e77b22c314a449e91fafed92a43826ac6aa403ae6a8acb6cf58239fbaf5d",
"attributes": [
{
"name": "storage",
"arguments": [
"read",
"write"
]
}
]
},
{
"inputs": [
{
"name": "person",
"concreteTypeId": "a6b272bcf0f572840e2cc1241bdcf8d42db51eeb1aead750c8e608160f83f926"
}
],
"name": "struct_input_output",
"output": "a6b272bcf0f572840e2cc1241bdcf8d42db51eeb1aead750c8e608160f83f926",
"attributes": null
}
],
"loggedTypes": [],
"messagesTypes": [],
"configurables": []
"configurables": [
{
"name": "BOOL",
"concreteTypeId": "b760f44fa5965c2474a3b471467a22c43185152129295af588b022ae50b50903",
"offset": 380112
},
{
"name": "U8",
"concreteTypeId": "c89951a24c6ca28c13fd1cfdc646b2b656d69e61a92b91023be7eb58eb914b6b",
"offset": 380232
},
{
"name": "U16",
"concreteTypeId": "29881aad8730c5ab11d275376323d8e4ff4179aae8ccb6c13fe4902137e162ef",
"offset": 380176
},
{
"name": "U32",
"concreteTypeId": "d7649d428b9ff33d188ecbf38a7e4d8fd167fa01b2e10fe9a8f9308e52f1d7cc",
"offset": 380216
},
{
"name": "U64",
"concreteTypeId": "d7649d428b9ff33d188ecbf38a7e4d8fd167fa01b2e10fe9a8f9308e52f1d7cc",
"offset": 380224
},
{
"name": "U256",
"concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e",
"offset": 380184
},
{
"name": "B256",
"concreteTypeId": "7c5ee1cecf5f8eacd1284feb5f0bf2bdea533a51e2f0c9aabe9236d335989f3b",
"offset": 380080
},
{
"name": "CONFIGURABLE_STRUCT",
"concreteTypeId": "75f7f7a06026cab5d7a70984d1fde56001e83505e3a091ff9722b92d7f56d8be",
"offset": 380136
},
{
"name": "CONFIGURABLE_ENUM",
"concreteTypeId": "6966f221767e2951c5d68ba5e81e897449375a9f51f5e4c9e3b65f1dd7defabb",
"offset": 380120
},
{
"name": "ARRAY_BOOL",
"concreteTypeId": "4926d35d1a5157936b0a29bc126b8aace6d911209a5c130e9b716b0c73643ea6",
"offset": 380048
},
{
"name": "ARRAY_U64",
"concreteTypeId": "776fb5a3824169d6736138565fdc20aad684d9111266a5ff6d5c675280b7e199",
"offset": 380056
},
{
"name": "TUPLE_BOOL_U64",
"concreteTypeId": "c998ca9a5f221fe7b5c66ae70c8a9562b86d964408b00d17f883c906bc1fe4be",
"offset": 380160
},
{
"name": "STR_4",
"concreteTypeId": "94f0fa95c830be5e4f711963e83259fe7e8bc723278ab6ec34449e791a99b53a",
"offset": 380152
}
]
}
Loading

0 comments on commit 2fde7ea

Please sign in to comment.