Skip to content

Commit

Permalink
[jsonrpc] Rename QuorumDriverApi to RpcGatewayApi (MystenLabs#2905)
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfind authored Jul 1, 2022
1 parent 0fdd770 commit 08253d7
Show file tree
Hide file tree
Showing 10 changed files with 649 additions and 649 deletions.
2 changes: 1 addition & 1 deletion crates/sui-gateway/src/rpc_gateway_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use sui_json_rpc_api::rpc_types::{
GetObjectDataResponse, GetRawObjectDataResponse, RPCTransactionRequestParams, SuiObjectInfo,
SuiTypeTag, TransactionEffectsResponse, TransactionResponse,
};
use sui_json_rpc_api::QuorumDriverApiClient;
use sui_json_rpc_api::RpcBcsApiClient;
use sui_json_rpc_api::RpcGatewayApiClient;
use sui_json_rpc_api::RpcTransactionBuilderClient;
use sui_json_rpc_api::TransactionBytes;
use sui_json_rpc_api::WalletSyncApiClient;
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-gateway/src/unit_tests/rpc_server_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sui_json_rpc_api::rpc_types::{
GetObjectDataResponse, TransactionEffectsResponse, TransactionResponse,
};
use sui_json_rpc_api::{
QuorumDriverApiClient, RpcReadApiClient, RpcTransactionBuilderClient, TransactionBytes,
RpcGatewayApiClient, RpcReadApiClient, RpcTransactionBuilderClient, TransactionBytes,
WalletSyncApiClient,
};
use sui_types::sui_serde::Base64;
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-json-rpc-api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use jsonrpsee::http_client::{HttpClient, HttpClientBuilder};

pub use crate::QuorumDriverApiClient;
pub use crate::RpcFullNodeReadApiClient;
pub use crate::RpcGatewayApiClient;
pub use crate::RpcReadApiClient;
pub use crate::RpcTransactionBuilderClient;
use crate::WalletSyncApiClient;
Expand All @@ -22,7 +22,7 @@ impl SuiRpcClient {
pub fn read_api(&self) -> &impl RpcReadApiClient {
&self.client
}
pub fn quorum_driver(&self) -> &impl QuorumDriverApiClient {
pub fn quorum_driver(&self) -> &impl RpcGatewayApiClient {
&self.client
}
pub fn wallet_sync_api(&self) -> &impl WalletSyncApiClient {
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-json-rpc-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub mod rpc_types;

type GatewayTxSeqNumber = u64;

#[open_rpc(namespace = "sui", tag = "Quorum Driver API")]
#[open_rpc(namespace = "sui", tag = "Gateway Transaction Execution API")]
#[rpc(server, client, namespace = "sui")]
pub trait QuorumDriverApi {
pub trait RpcGatewayApi {
/// Execute the transaction using the transaction data, signature and public key.
#[method(name = "executeTransaction")]
async fn execute_transaction(
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-json-rpc/src/gateway_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use sui_json_rpc_api::rpc_types::{
};
use sui_json_rpc_api::rpc_types::{RPCTransactionRequestParams, SuiTypeTag};
use sui_json_rpc_api::{
QuorumDriverApiServer, RpcReadApiServer, RpcTransactionBuilderServer, TransactionBytes,
RpcGatewayApiServer, RpcReadApiServer, RpcTransactionBuilderServer, TransactionBytes,
WalletSyncApiServer,
};
use sui_open_rpc::Module;
Expand Down Expand Up @@ -68,7 +68,7 @@ impl TransactionBuilderImpl {
}

#[async_trait]
impl QuorumDriverApiServer for RpcGatewayImpl {
impl RpcGatewayApiServer for RpcGatewayImpl {
async fn execute_transaction(
&self,
tx_bytes: Base64,
Expand All @@ -93,7 +93,7 @@ impl SuiRpcModule for RpcGatewayImpl {
}

fn rpc_doc_module() -> Module {
sui_json_rpc_api::QuorumDriverApiOpenRpc::module_doc()
sui_json_rpc_api::RpcGatewayApiOpenRpc::module_doc()
}
}

Expand Down
48 changes: 24 additions & 24 deletions crates/sui-open-rpc/samples/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
"type": "0x2::devnet_nft::DevNetNFT",
"has_public_transfer": true,
"fields": {
"description": "An NFT created by the wallet Command Line Tool",
"description": "An NFT created by the Sui Command Line Tool",
"id": {
"id": "0x336034749debf6d4565a3b647003576a53970979",
"id": "0x0bd2ba409b00487652fe84aa1ffe61cb1623062f",
"version": 1
},
"name": "Example NFT",
"url": "ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty"
}
},
"owner": {
"AddressOwner": "0x21a7ff8e69effaa7d8730c781396649c53221ea9"
"AddressOwner": "0xdc52485e122facb4d819b21919c40aca227e5c45"
},
"previousTransaction": "9Dezp9GRTUgnGMyuVtfTKJoZwKCcaFrh7QEoM/OoLBI=",
"previousTransaction": "yEWyNUPES5w51ajzZwjaNCmnc9VqOHFqhBA/8XiU8js=",
"storageRebate": 25,
"reference": {
"objectId": "0x336034749debf6d4565a3b647003576a53970979",
"objectId": "0x0bd2ba409b00487652fe84aa1ffe61cb1623062f",
"version": 1,
"digest": "cHj9KwDfHF8IAg4NsKHKgouYiMUl6c0HBhrRQ9L6i2c="
"digest": "oAMl9wvIW2VXlXIpKCf2NpDH/dlXoNvyJQmZxWWasZ8="
}
}
},
Expand All @@ -38,20 +38,20 @@
"fields": {
"balance": 100000,
"id": {
"id": "0x04f70e789b08425e27af33fd40a01b4852c0a2a2",
"id": "0x1082f41ab1d8a3d6405120916a7b14affb4d84c4",
"version": 0
}
}
},
"owner": {
"AddressOwner": "0x21a7ff8e69effaa7d8730c781396649c53221ea9"
"AddressOwner": "0xdc52485e122facb4d819b21919c40aca227e5c45"
},
"previousTransaction": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"storageRebate": 0,
"reference": {
"objectId": "0x04f70e789b08425e27af33fd40a01b4852c0a2a2",
"objectId": "0x1082f41ab1d8a3d6405120916a7b14affb4d84c4",
"version": 0,
"digest": "N0LLy9GOiIQMxrZBeiV+38muo1v8pMUt2mKsv/Tynng="
"digest": "hTzUORcgQzCgmeRarZnxsv42NttcZD8IKIJK+Gfv6tQ="
}
}
},
Expand All @@ -61,16 +61,16 @@
"data": {
"dataType": "package",
"disassembled": {
"m1": "// Move bytecode v5\nmodule bc82ccab6390dffbc46b5a29f714f03dee3c3042.m1 {\nstruct Forge has store, key {\n\tid: VersionedID,\n\tswords_created: u64\n}\nstruct Sword has store, key {\n\tid: VersionedID,\n\tmagic: u64,\n\tstrength: u64\n}\n\ninit(Arg0: &mut TxContext) {\nB0:\n\t0: CopyLoc[0](Arg0: &mut TxContext)\n\t1: Call[6](new_id(&mut TxContext): VersionedID)\n\t2: LdU64(0)\n\t3: Pack[0](Forge)\n\t4: StLoc[1](loc0: Forge)\n\t5: MoveLoc[1](loc0: Forge)\n\t6: MoveLoc[0](Arg0: &mut TxContext)\n\t7: FreezeRef\n\t8: Call[7](sender(&TxContext): address)\n\t9: Call[0](transfer<Forge>(Forge, address))\n\t10: Ret\n}\npublic magic(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[0](Sword.magic: u64)\n\t2: ReadRef\n\t3: Ret\n}\npublic strength(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[1](Sword.strength: u64)\n\t2: ReadRef\n\t3: Ret\n}\nentry public sword_create(Arg0: &mut Forge, Arg1: u64, Arg2: u64, Arg3: address, Arg4: &mut TxContext) {\nB0:\n\t0: MoveLoc[4](Arg4: &mut TxContext)\n\t1: Call[6](new_id(&mut TxContext): VersionedID)\n\t2: MoveLoc[1](Arg1: u64)\n\t3: MoveLoc[2](Arg2: u64)\n\t4: Pack[1](Sword)\n\t5: StLoc[5](loc0: Sword)\n\t6: MoveLoc[5](loc0: Sword)\n\t7: MoveLoc[3](Arg3: address)\n\t8: Call[1](transfer<Sword>(Sword, address))\n\t9: CopyLoc[0](Arg0: &mut Forge)\n\t10: ImmBorrowField[2](Forge.swords_created: u64)\n\t11: ReadRef\n\t12: LdU64(1)\n\t13: Add\n\t14: MoveLoc[0](Arg0: &mut Forge)\n\t15: MutBorrowField[2](Forge.swords_created: u64)\n\t16: WriteRef\n\t17: Ret\n}\nentry public sword_transfer(Arg0: Sword, Arg1: address) {\nB0:\n\t0: MoveLoc[0](Arg0: Sword)\n\t1: MoveLoc[1](Arg1: address)\n\t2: Call[1](transfer<Sword>(Sword, address))\n\t3: Ret\n}\npublic swords_created(Arg0: &Forge): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Forge)\n\t1: ImmBorrowField[2](Forge.swords_created: u64)\n\t2: ReadRef\n\t3: Ret\n}\n}"
"m1": "// Move bytecode v5\nmodule 118179de4325e2414502a867ad540379127d6799.m1 {\nstruct Forge has store, key {\n\tid: VersionedID,\n\tswords_created: u64\n}\nstruct Sword has store, key {\n\tid: VersionedID,\n\tmagic: u64,\n\tstrength: u64\n}\n\ninit(Arg0: &mut TxContext) {\nB0:\n\t0: CopyLoc[0](Arg0: &mut TxContext)\n\t1: Call[6](new_id(&mut TxContext): VersionedID)\n\t2: LdU64(0)\n\t3: Pack[0](Forge)\n\t4: StLoc[1](loc0: Forge)\n\t5: MoveLoc[1](loc0: Forge)\n\t6: MoveLoc[0](Arg0: &mut TxContext)\n\t7: FreezeRef\n\t8: Call[7](sender(&TxContext): address)\n\t9: Call[0](transfer<Forge>(Forge, address))\n\t10: Ret\n}\npublic magic(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[0](Sword.magic: u64)\n\t2: ReadRef\n\t3: Ret\n}\npublic strength(Arg0: &Sword): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Sword)\n\t1: ImmBorrowField[1](Sword.strength: u64)\n\t2: ReadRef\n\t3: Ret\n}\nentry public sword_create(Arg0: &mut Forge, Arg1: u64, Arg2: u64, Arg3: address, Arg4: &mut TxContext) {\nB0:\n\t0: MoveLoc[4](Arg4: &mut TxContext)\n\t1: Call[6](new_id(&mut TxContext): VersionedID)\n\t2: MoveLoc[1](Arg1: u64)\n\t3: MoveLoc[2](Arg2: u64)\n\t4: Pack[1](Sword)\n\t5: StLoc[5](loc0: Sword)\n\t6: MoveLoc[5](loc0: Sword)\n\t7: MoveLoc[3](Arg3: address)\n\t8: Call[1](transfer<Sword>(Sword, address))\n\t9: CopyLoc[0](Arg0: &mut Forge)\n\t10: ImmBorrowField[2](Forge.swords_created: u64)\n\t11: ReadRef\n\t12: LdU64(1)\n\t13: Add\n\t14: MoveLoc[0](Arg0: &mut Forge)\n\t15: MutBorrowField[2](Forge.swords_created: u64)\n\t16: WriteRef\n\t17: Ret\n}\nentry public sword_transfer(Arg0: Sword, Arg1: address) {\nB0:\n\t0: MoveLoc[0](Arg0: Sword)\n\t1: MoveLoc[1](Arg1: address)\n\t2: Call[1](transfer<Sword>(Sword, address))\n\t3: Ret\n}\npublic swords_created(Arg0: &Forge): u64 {\nB0:\n\t0: MoveLoc[0](Arg0: &Forge)\n\t1: ImmBorrowField[2](Forge.swords_created: u64)\n\t2: ReadRef\n\t3: Ret\n}\n}"
}
},
"owner": "Immutable",
"previousTransaction": "GJy6L14ZkUSFRIoLL3lFQLVYdE07/fSDhZ8ur1wzOf0=",
"previousTransaction": "AVmhUrbv7Iv8EwxSIu7Cs7iFc46/SNGZX41ThUkLhG4=",
"storageRebate": 0,
"reference": {
"objectId": "0xbc82ccab6390dffbc46b5a29f714f03dee3c3042",
"objectId": "0x118179de4325e2414502a867ad540379127d6799",
"version": 1,
"digest": "xvkwb5SoaRAFuqPXAinDjj4JJOTF2uSshFo3a35ad98="
"digest": "PMjjXIrtCL5CVDOJWcKmzANPm3NhNMPXOIYL2uLDJIo="
}
}
},
Expand All @@ -79,22 +79,22 @@
"details": {
"data": {
"dataType": "moveObject",
"type": "0x5d85408454e4c25572f507a00a72c1b6991903ca::hero::Hero",
"type": "0x71ab228f180775d32e95c7ba95041848e3698209::hero::Hero",
"has_public_transfer": true,
"fields": {
"experience": 0,
"game_id": "0xdc344c9963845ae381a527c57bebbb5250b3c726",
"game_id": "0xfe0f5647a0c0c804e7ee54a925cdcf6c24a80678",
"hp": 100,
"id": {
"id": "0xc39ed5af6ef1adcdc03405b217a9c91e8ce5e270",
"id": "0x9edfd17f4fbc3ca5c29facd62cf4cbfb39f4610a",
"version": 1
},
"sword": {
"type": "0x5d85408454e4c25572f507a00a72c1b6991903ca::hero::Sword",
"type": "0x71ab228f180775d32e95c7ba95041848e3698209::hero::Sword",
"fields": {
"game_id": "0xdc344c9963845ae381a527c57bebbb5250b3c726",
"game_id": "0xfe0f5647a0c0c804e7ee54a925cdcf6c24a80678",
"id": {
"id": "0x071975e38a5da041cf02c18e086c840746cc2a0e",
"id": "0xddf21644d621fe49ebc130612373067412f230a8",
"version": 0
},
"magic": 10,
Expand All @@ -104,14 +104,14 @@
}
},
"owner": {
"AddressOwner": "0x21a7ff8e69effaa7d8730c781396649c53221ea9"
"AddressOwner": "0xdc52485e122facb4d819b21919c40aca227e5c45"
},
"previousTransaction": "aZk9v8eyHqeOoM8kHt1WnNh6SyONhhBTJyvcHr/Gt4E=",
"previousTransaction": "bp4Vtg+mzWlYVGgHkpIWOvDoezzyTtkYyjKlHrV4LEo=",
"storageRebate": 22,
"reference": {
"objectId": "0xc39ed5af6ef1adcdc03405b217a9c91e8ce5e270",
"objectId": "0x9edfd17f4fbc3ca5c29facd62cf4cbfb39f4610a",
"version": 1,
"digest": "Akl35JweSnHq7QDuoGPfkiiBQAmnWeD6YQANufQfSrU="
"digest": "DCifhfr8avIyct8n6kwhUGeMH78xZRBR694pT0LIGb0="
}
}
}
Expand Down
Loading

0 comments on commit 08253d7

Please sign in to comment.