Skip to content

Commit

Permalink
Revert "[Feature] Public Native name_of function (#107)"
Browse files Browse the repository at this point in the history
This reverts commit 7263b0a.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent e54e65c commit 562910a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 68 deletions.
5 changes: 1 addition & 4 deletions build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: TreasuryWithdrawDaoProposal
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: TypeInfo
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: U256
: StarcoinFramework
Expand All @@ -306,7 +303,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: 695F4208154FB109E223367B79D9AD3C30261C91BF6F595A3B9D2226BC5103B0
source_digest: 2F6686B5BAFFE5E5DEB6F001CD6D0D8FA93121DB944E71F0E3DCBAB51D81FA90
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file modified build/StarcoinFramework/bytecode_modules/Token.mv
Binary file not shown.
1 change: 0 additions & 1 deletion build/StarcoinFramework/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ This is the root document for the Move StarcoinFramework module documentation. T
- [`0x1::Treasury`](Treasury.md#0x1_Treasury)
- [`0x1::TreasuryScripts`](TreasuryScripts.md#0x1_TreasuryScripts)
- [`0x1::TreasuryWithdrawDaoProposal`](TreasuryWithdrawDaoProposal.md#0x1_TreasuryWithdrawDaoProposal)
- [`0x1::TypeInfo`](TypeInfo.md#0x1_TypeInfo)
- [`0x1::U256`](U256.md#0x1_U256)
- [`0x1::UpgradeModuleDaoProposal`](UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal)
- [`0x1::VMConfig`](VMConfig.md#0x1_VMConfig)
Expand Down
29 changes: 2 additions & 27 deletions build/StarcoinFramework/docs/Token.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Token implementation of Starcoin.
- [Function `is_same_token`](#0x1_Token_is_same_token)
- [Function `token_address`](#0x1_Token_token_address)
- [Function `token_code`](#0x1_Token_token_code)
- [Function `type_of`](#0x1_Token_type_of)
- [Function `name_of`](#0x1_Token_name_of)
- [Function `name_of_token`](#0x1_Token_name_of_token)
- [Module Specification](#@Module_Specification_1)
Expand Down Expand Up @@ -1710,30 +1709,6 @@ does not matter for the verification of callers.



</details>

<a name="0x1_Token_type_of"></a>

## Function `type_of`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="Token.md#0x1_Token_type_of">type_of</a>&lt;T&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>friend</b>) <b>fun</b> <a href="Token.md#0x1_Token_type_of">type_of</a>&lt;T&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;){
<a href="Token.md#0x1_Token_name_of">name_of</a>&lt;T&gt;()
}
</code></pre>



</details>

<a name="0x1_Token_name_of"></a>
Expand All @@ -1743,7 +1718,7 @@ does not matter for the verification of callers.
Return Token's module address, module name, and type name of <code>TokenType</code>.


<pre><code><b>fun</b> <a href="Token.md#0x1_Token_name_of">name_of</a>&lt;TokenType&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;)
<pre><code><b>fun</b> <a href="Token.md#0x1_Token_name_of">name_of</a>&lt;TokenType: store&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;)
</code></pre>


Expand All @@ -1752,7 +1727,7 @@ Return Token's module address, module name, and type name of <code>TokenType</co
<summary>Implementation</summary>


<pre><code><b>native</b> <b>fun</b> <a href="Token.md#0x1_Token_name_of">name_of</a>&lt;TokenType&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;);
<pre><code><b>native</b> <b>fun</b> <a href="Token.md#0x1_Token_name_of">name_of</a>&lt;TokenType: store&gt;(): (<b>address</b>, vector&lt;u8&gt;, vector&lt;u8&gt;);
</code></pre>


Expand Down
Binary file modified build/StarcoinFramework/source_maps/Token.mvsm
Binary file not shown.
7 changes: 1 addition & 6 deletions sources/Token.move
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Token {
use StarcoinFramework::Errors;
use StarcoinFramework::Math;

friend StarcoinFramework::TypeInfo;
spec module {
pragma verify;
pragma aborts_if_is_strict;
Expand Down Expand Up @@ -505,12 +504,8 @@ module Token {
/// does not matter for the verification of callers.
spec fun spec_token_code<TokenType>(): TokenCode;

public (friend) fun type_of<T>(): (address, vector<u8>, vector<u8>){
name_of<T>()
}

/// Return Token's module address, module name, and type name of `TokenType`.
native fun name_of<TokenType>(): (address, vector<u8>, vector<u8>);
native fun name_of<TokenType: store>(): (address, vector<u8>, vector<u8>);

spec name_of {
pragma opaque = true;
Expand Down
30 changes: 0 additions & 30 deletions sources/TypeInfo.move

This file was deleted.

0 comments on commit 562910a

Please sign in to comment.