Skip to content

Commit

Permalink
Fixing schemas for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Zajkowski committed Dec 10, 2024
1 parent e942507 commit 19d57b7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 57 deletions.
47 changes: 16 additions & 31 deletions resources/test/rpc_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"name": "transaction",
"value": {
"Version1": {
"hash": "c4e359a70070d31d50d9d59782f76bb244ca8c24fef78fffa40577a98f004982",
"hash": "e6bc93a30584fefced99be08c1861164b357c74e4904b5d2e7146896aaaaf843",
"payload": {
"initiator_addr": {
"PublicKey": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
Expand All @@ -186,10 +186,8 @@
[
"source",
{
"cl_type": {
"Option": "URef"
},
"bytes": "010a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"cl_type": "URef",
"bytes": "0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"parsed": "uref-0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a-007"
}
],
Expand Down Expand Up @@ -229,7 +227,7 @@
"approvals": [
{
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"signature": "0156559645f690954c8b4f870e362fa5af1f25d2ca109c4c13b02b25a6d7cef413b077dbccf0bedeabdf318aef777c387dc706c10f99a78de754dc2aad9f8ac107"
"signature": "0124fd45fa4ad49f048d116ba86fa84cecc8e4a1c49cbae824db97472a9f5de6c63e6e77723e55d00b78605ee9a69a27ea23a73e47d29d0778534e053f18ca4101"
}
]
}
Expand All @@ -241,7 +239,7 @@
"value": {
"api_version": "2.0.0",
"transaction_hash": {
"Version1": "c4e359a70070d31d50d9d59782f76bb244ca8c24fef78fffa40577a98f004982"
"Version1": "e6bc93a30584fefced99be08c1861164b357c74e4904b5d2e7146896aaaaf843"
}
}
}
Expand Down Expand Up @@ -483,7 +481,7 @@
{
"name": "transaction_hash",
"value": {
"Version1": "c4e359a70070d31d50d9d59782f76bb244ca8c24fef78fffa40577a98f004982"
"Version1": "e6bc93a30584fefced99be08c1861164b357c74e4904b5d2e7146896aaaaf843"
}
},
{
Expand All @@ -497,7 +495,7 @@
"api_version": "2.0.0",
"transaction": {
"Version1": {
"hash": "c4e359a70070d31d50d9d59782f76bb244ca8c24fef78fffa40577a98f004982",
"hash": "e6bc93a30584fefced99be08c1861164b357c74e4904b5d2e7146896aaaaf843",
"payload": {
"initiator_addr": {
"PublicKey": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
Expand All @@ -517,10 +515,8 @@
[
"source",
{
"cl_type": {
"Option": "URef"
},
"bytes": "010a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"cl_type": "URef",
"bytes": "0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"parsed": "uref-0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a-007"
}
],
Expand Down Expand Up @@ -560,7 +556,7 @@
"approvals": [
{
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"signature": "0156559645f690954c8b4f870e362fa5af1f25d2ca109c4c13b02b25a6d7cef413b077dbccf0bedeabdf318aef777c387dc706c10f99a78de754dc2aad9f8ac107"
"signature": "0124fd45fa4ad49f048d116ba86fa84cecc8e4a1c49cbae824db97472a9f5de6c63e6e77723e55d00b78605ee9a69a27ea23a73e47d29d0778534e053f18ca4101"
}
]
}
Expand Down Expand Up @@ -6234,7 +6230,7 @@
],
"properties": {
"SmartContract": {
"$ref": "#/components/schemas/TransactionRuntime"
"$ref": "#/components/schemas/ContractRuntimeTag"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -6274,23 +6270,12 @@
}
]
},
"TransactionRuntime": {
"ContractRuntimeTag": {
"description": "Runtime used to execute a Transaction.",
"oneOf": [
{
"description": "The Casper Version 1 Virtual Machine.",
"type": "string",
"enum": [
"VmCasperV1"
]
},
{
"description": "The Casper Version 2 Virtual Machine.",
"type": "string",
"enum": [
"VmCasperV2"
]
}
"type": "string",
"enum": [
"VmCasperV1",
"VmCasperV2"
]
},
"PackageHash": {
Expand Down
33 changes: 10 additions & 23 deletions resources/test/speculative_rpc_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"name": "transaction",
"value": {
"Version1": {
"hash": "c4e359a70070d31d50d9d59782f76bb244ca8c24fef78fffa40577a98f004982",
"hash": "e6bc93a30584fefced99be08c1861164b357c74e4904b5d2e7146896aaaaf843",
"payload": {
"initiator_addr": {
"PublicKey": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
Expand All @@ -194,10 +194,8 @@
[
"source",
{
"cl_type": {
"Option": "URef"
},
"bytes": "010a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"cl_type": "URef",
"bytes": "0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a07",
"parsed": "uref-0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a-007"
}
],
Expand Down Expand Up @@ -237,7 +235,7 @@
"approvals": [
{
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"signature": "0156559645f690954c8b4f870e362fa5af1f25d2ca109c4c13b02b25a6d7cef413b077dbccf0bedeabdf318aef777c387dc706c10f99a78de754dc2aad9f8ac107"
"signature": "0124fd45fa4ad49f048d116ba86fa84cecc8e4a1c49cbae824db97472a9f5de6c63e6e77723e55d00b78605ee9a69a27ea23a73e47d29d0778534e053f18ca4101"
}
]
}
Expand Down Expand Up @@ -2762,7 +2760,7 @@
],
"properties": {
"SmartContract": {
"$ref": "#/components/schemas/TransactionRuntime"
"$ref": "#/components/schemas/ContractRuntimeTag"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -2802,23 +2800,12 @@
}
]
},
"TransactionRuntime": {
"ContractRuntimeTag": {
"description": "Runtime used to execute a Transaction.",
"oneOf": [
{
"description": "The Casper Version 1 Virtual Machine.",
"type": "string",
"enum": [
"VmCasperV1"
]
},
{
"description": "The Casper Version 2 Virtual Machine.",
"type": "string",
"enum": [
"VmCasperV2"
]
}
"type": "string",
"enum": [
"VmCasperV1",
"VmCasperV2"
]
},
"PackageHash": {
Expand Down
6 changes: 3 additions & 3 deletions rpc_sidecar/src/rpcs/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,8 +1420,8 @@ mod tests {
},
testing::TestRng,
AccessRights, AddressableEntity, AvailableBlockRange, Block, ByteCode, ByteCodeHash,
ByteCodeKind, Contract, ContractWasm, ContractWasmHash, EntityKind, NamedKeys, PackageHash,
ProtocolVersion, TestBlockBuilder, TransactionRuntime,
ByteCodeKind, Contract, ContractRuntimeTag, ContractWasm, ContractWasmHash, EntityKind,
NamedKeys, PackageHash, ProtocolVersion, TestBlockBuilder,
};
use pretty_assertions::assert_eq;
use rand::Rng;
Expand Down Expand Up @@ -2027,7 +2027,7 @@ mod tests {
rng.gen(),
AssociatedKeys::default(),
ActionThresholds::default(),
EntityKind::SmartContract(TransactionRuntime::VmCasperV2),
EntityKind::SmartContract(ContractRuntimeTag::VmCasperV2),
);
let addr: EntityAddr = rng.gen();

Expand Down

0 comments on commit 19d57b7

Please sign in to comment.