Skip to content

Commit

Permalink
rebase main and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pause125 committed Jul 8, 2024
1 parent ad91e4d commit 53856c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/rooch-rpc-api/src/api/rooch_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::jsonrpc_types::{
AccessPathView, AnnotatedFunctionResultView, BalanceInfoPageView, BytesView, EventOptions,
EventPageView, ExecuteTransactionResponseView, FieldKeyView, FunctionCallView, H256View,
IndexerEventPageView, IndexerObjectStatePageView, ModuleABIView, ObjectIDVecView, ObjectIDView,
ObjectStateFilterView, ObjectStateView, QueryOptions, StateOptions, StatePageView, StrView,
StructTagView, TransactionWithInfoPageView, TxOptions,
ObjectStateFilterView, ObjectStateView, QueryOptions, RoochAddressView, StateOptions,
StatePageView, StrView, StructTagView, TransactionWithInfoPageView, TxOptions,
};
use crate::RpcResult;
use jsonrpsee::proc_macros::rpc;
Expand Down
10 changes: 6 additions & 4 deletions crates/rooch-rpc-server/src/server/rooch_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use move_core_types::{
use moveos_types::{
access_path::AccessPath,
h256::H256,
move_std::string::MoveString,
moveos_std::{
display::{get_object_display_id, get_resource_display_id, RawDisplay},
move_module::MoveModule,
Expand All @@ -24,9 +25,10 @@ use rooch_rpc_api::jsonrpc_types::{
transaction_view::{TransactionFilterView, TransactionWithInfoView},
AccessPathView, AnnotatedMoveStructView, BalanceInfoPageView, DisplayFieldsView, EventOptions,
EventPageView, ExecuteTransactionResponseView, FunctionCallView, H256View,
IndexerEventPageView, IndexerObjectStatePageView, IndexerObjectStateView, ObjectIDVecView,
ObjectStateFilterView, ObjectStateView, QueryOptions, RoochOrBitcoinAddressView, StateKVView,
StateOptions, StatePageView, StrView, StructTagView, TransactionWithInfoPageView, TxOptions,
IndexerEventPageView, IndexerObjectStatePageView, IndexerObjectStateView, ModuleABIView,
ObjectIDVecView, ObjectStateFilterView, ObjectStateView, QueryOptions, RoochAddressView,
RoochOrBitcoinAddressView, StateKVView, StateOptions, StatePageView, StrView, StructTagView,
TransactionWithInfoPageView, TxOptions,
};
use rooch_rpc_api::{
api::rooch_api::RoochAPIServer,
Expand Down Expand Up @@ -639,7 +641,7 @@ impl RoochAPIServer for RoochServer {

Ok(match module {
Some(m) => {
let move_module = m.cast::<MoveModule>()?;
let move_module = m.value_as_df::<MoveString, MoveModule>()?.value;
Some(ModuleABIView::try_parse_from_module_bytes(
&move_module.byte_codes,
)?)
Expand Down
2 changes: 2 additions & 0 deletions crates/testsuite/features/cmd.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Feature: Rooch CLI integration tests
Then assert: "{{$.rpc[-1][0].object_type}} == '0x2::module_store::Package'"
Then cmd: "rpc request --method rooch_listFieldStates --params '["0x2214495c6abca5dd5a2bf0f2a28a74541ff10c89818a1244af24c4874325ebdb", null, "2", {"decode": false, "showDisplay": false}]' --json"
Then assert: "{{$.rpc[-1].has_next_page}} == true"
Then cmd: "rpc request --method rooch_getModuleABI --params '["0x2", "display"]'"
Then assert: "{{$.rpc[-1].name}} == 'display'"
Then stop the server

@serial
Expand Down

0 comments on commit 53856c5

Please sign in to comment.