@@ -145,7 +145,7 @@ module owned_vault::owned_vault {
145145 abort 0
146146 };
147147
148- vault.token_type_to_treasury.add (type_name::get <T >(). into_string (). into_bytes (), TreasuryCapWithMetadata {
148+ vault.token_type_to_treasury.add (type_name::with_defining_ids <T >(), TreasuryCapWithMetadata {
149149 id: object::new (ctx),
150150 cap: capability,
151151 metadata: metadata::new (
@@ -167,14 +167,14 @@ module owned_vault::owned_vault {
167167 beneficiary: vector <u8 >,
168168 ctx: &mut TxContext ,
169169 ) {
170- let token = type_name::get <T >(). into_string (). into_bytes ();
170+ let token = type_name::with_defining_ids <T >();
171171 let cap: &TreasuryCapWithMetadata <T > = vault.token_type_to_treasury.borrow (token);
172172
173173 assert !(cap.metadata.owner () == ctx.sender (), E_UNAUTHORIZED );
174174
175175 vault.fungible_counterparties.add (
176176 FungibleLane {
177- token,
177+ token: token. into_string (). into_bytes () ,
178178 path,
179179 channel,
180180 base_token
@@ -191,7 +191,7 @@ module owned_vault::owned_vault {
191191 whitelist: bool ,
192192 ctx: &mut TxContext ,
193193 ) {
194- let token = type_name::get <T >(). into_string ();
194+ let token = type_name::with_defining_ids <T >();
195195 let cap: &TreasuryCapWithMetadata <T > = vault.token_type_to_treasury.borrow (token);
196196
197197 assert !(cap.metadata.owner () == ctx.sender (), E_UNAUTHORIZED );
@@ -200,7 +200,7 @@ module owned_vault::owned_vault {
200200 assert !(hash.length () == 32 , E_INVALID_PACKET_HASH );
201201
202202 let whitelist_key = IntentWhitelistKey {
203- token: token.into_bytes (),
203+ token: token.into_string (). into_bytes (),
204204 packet_hash: hash
205205 };
206206
@@ -229,7 +229,7 @@ module owned_vault::owned_vault {
229229 intent: bool ,
230230 ctx: &mut TxContext ,
231231 ): (vector <u8 >, u64 ) {
232- if (type_name::get <T >().into_string ().into_bytes () != quote_token) {
232+ if (type_name::with_defining_ids <T >().into_string ().into_bytes () != quote_token) {
233233 return (vector ::empty (), E_INVALID_QUOTE_TOKEN )
234234 };
235235
@@ -283,7 +283,7 @@ module owned_vault::owned_vault {
283283 // We could just return a mutable ref to the `TreasuryCap<T>` but it's not allowed in the MoveVM to return a mutable reference
284284 // from a PTB command.
285285 public fun release_treasury_cap <T >(vault: &mut OwnedVault , ctx: &TxContext ): (TreasuryCap <T >, TreasuryCapReleaseCtx <T >) {
286- let token = type_name::get <T >(). into_string (). into_bytes ();
286+ let token = type_name::with_defining_ids <T >();
287287 let cap: TreasuryCapWithMetadata <T > = vault.token_type_to_treasury.remove (token);
288288
289289 assert !(ctx.sender () == cap.metadata.owner (), E_UNAUTHORIZED );
@@ -305,7 +305,7 @@ module owned_vault::owned_vault {
305305 public fun give_back_treasury_cap <T >(vault: &mut OwnedVault , cap: TreasuryCap <T >, handle: TreasuryCapReleaseCtx <T >, ctx: &mut TxContext ) {
306306 assert !(ctx.sender () == handle.metadata.owner (), E_UNAUTHORIZED );
307307
308- let token = type_name::get <T >(). into_string (). into_bytes ();
308+ let token = type_name::with_defining_ids <T >();
309309 let TreasuryCapReleaseCtx {
310310 metadata
311311 } = handle;
@@ -337,7 +337,7 @@ module owned_vault::owned_vault {
337337 public fun get_metadata <T >(
338338 vault: &OwnedVault ,
339339 ): &Metadata {
340- let typename_t = type_name::get <T >(). into_string (). into_bytes ();
340+ let typename_t = type_name::with_defining_ids <T >();
341341 let cap: &TreasuryCapWithMetadata <T > = vault.token_type_to_treasury.borrow (typename_t);
342342
343343 &cap.metadata
@@ -346,7 +346,7 @@ module owned_vault::owned_vault {
346346 fun borrow_mut_treasury_cap <T >(
347347 vault: &mut OwnedVault
348348 ): &mut TreasuryCap <T > {
349- let key = type_name::get <T >(). into_string (). into_bytes ();
349+ let key = type_name::with_defining_ids <T >();
350350 if (!vault.token_type_to_treasury.contains (key)) {
351351 abort E_NO_TREASURY_CAPABILITY
352352 };
0 commit comments