From c78807a8718e2e0fd1a7083f9863f5ea1fde3543 Mon Sep 17 00:00:00 2001 From: welbon <2261238+welbon@users.noreply.github.com> Date: Tue, 21 Jan 2025 23:18:40 +0800 Subject: [PATCH] [asset-mapping] rename struct_tag_for_token to struct_tag_for_resource --- vm/types/src/account_config/resources/fungible_store.rs | 2 +- vm/types/src/state_view.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vm/types/src/account_config/resources/fungible_store.rs b/vm/types/src/account_config/resources/fungible_store.rs index b6f4f8766c..2e24a845fd 100644 --- a/vm/types/src/account_config/resources/fungible_store.rs +++ b/vm/types/src/account_config/resources/fungible_store.rs @@ -55,7 +55,7 @@ impl FungibleStoreResource { } // TODO/XXX: remove this once the MoveResource trait allows type arguments to `struct_tag`. - pub fn struct_tag_for_token() -> StructTag { + pub fn struct_tag_for_resource() -> StructTag { StructTag { address: CORE_CODE_ADDRESS, name: Self::struct_identifier(), diff --git a/vm/types/src/state_view.rs b/vm/types/src/state_view.rs index d783897bf2..c473640d12 100644 --- a/vm/types/src/state_view.rs +++ b/vm/types/src/state_view.rs @@ -126,10 +126,10 @@ pub trait StateReaderExt: StateView { let primary_store_address = fungible_store::primary_store(&address, &type_tag.address); // Get from coin store - let fungible_store_state_key = StateKey::resource( + let fungible_store_state_key = StateKey::resource_group( &primary_store_address, - &FungibleStoreResource::struct_tag_for_token(), - )?; + &FungibleStoreResource::struct_tag_for_resource(), + ); let fungible_balance = match self.get_state_value_bytes(&fungible_store_state_key)? { Some(bytes) => {