Skip to content

Commit

Permalink
Fix error code
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 committed Aug 22, 2023
1 parent 1164768 commit f5c6f73
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 84 deletions.
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compiled_package_info:
StarcoinAssociation: "0x0000000000000000000000000a550c18"
StarcoinFramework: "0x00000000000000000000000000000001"
VMReserved: "0x00000000000000000000000000000000"
source_digest: DEAD5E4489A0087D5ECEDCE704BCF29BF0E73B77A305D5324A9F453D3803B69B
source_digest: 43D3D1EFB0689A52B0DADED8DDB3DED2C03C392683B42CE1E28CE538D1F7CA6E
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file modified build/StarcoinFramework/bytecode_modules/EasyGas.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/TransactionManager.mv
Binary file not shown.
72 changes: 0 additions & 72 deletions build/StarcoinFramework/docs/TransactionManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,6 @@



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EADDRESS_AND_AUTH_KEY_MISMATCH">EADDRESS_AND_AUTH_KEY_MISMATCH</a>: u64 = 105;
</code></pre>



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EADDRESS_PUBLIC_KEY_INCONSISTENT">EADDRESS_PUBLIC_KEY_INCONSISTENT</a>: u64 = 104;
</code></pre>



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EBAD_TRANSACTION_FEE_TOKEN">EBAD_TRANSACTION_FEE_TOKEN</a>: u64 = 18;
</code></pre>



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


Expand All @@ -118,24 +91,6 @@



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED">EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED</a>: u64 = 103;
</code></pre>



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EMALFORMED_AUTHENTICATION_KEY">EMALFORMED_AUTHENTICATION_KEY</a>: u64 = 102;
</code></pre>



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


Expand Down Expand Up @@ -190,33 +145,6 @@



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_ERR_SIGNER_ALREADY_DELEGATED">ERR_SIGNER_ALREADY_DELEGATED</a>: u64 = 107;
</code></pre>



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_ERR_TOKEN_NOT_ACCEPT">ERR_TOKEN_NOT_ACCEPT</a>: u64 = 106;
</code></pre>



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



<pre><code><b>const</b> <a href="TransactionManager.md#0x1_TransactionManager_EWITHDRAWAL_CAPABILITY_ALREADY_EXTRACTED">EWITHDRAWAL_CAPABILITY_ALREADY_EXTRACTED</a>: u64 = 101;
</code></pre>



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


Expand Down
Binary file modified build/StarcoinFramework/source_maps/EasyGas.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/EasyGasScript.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/TransactionManager.mvsm
Binary file not shown.
5 changes: 2 additions & 3 deletions sources/EasyGas.move
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module EasyGas {
use StarcoinFramework::CoreAddresses;
use StarcoinFramework::GenesisSignerCapability;
use StarcoinFramework::PriceOracle;

const EBAD_TRANSACTION_FEE_TOKEN: u64 = 18;
struct STCToken<phantom TokenType: store> has copy, store, drop {}

struct GasTokenEntry has key, store, drop {
Expand Down Expand Up @@ -81,10 +81,9 @@ module EasyGas {
let token_type_info = type_of<TokenType>();
let genesis = CoreAddresses::GENESIS_ADDRESS();
let gas_token_entry = borrow_global<GasTokenEntry>(genesis);
//TODO:error code define
assert!(module_name(&token_type_info) == *&gas_token_entry.module_name && account_address(
&token_type_info
) == *&gas_token_entry.account_address && struct_name(&token_type_info) == *&gas_token_entry.struct_name, 100);
) == *&gas_token_entry.account_address && struct_name(&token_type_info) == *&gas_token_entry.struct_name, EBAD_TRANSACTION_FEE_TOKEN);
gas_token_entry.data_source
}

Expand Down
8 changes: 0 additions & 8 deletions sources/TransactionManager.move
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,7 @@ module TransactionManager {
const EPROLOGUE_SEQUENCE_NUMBER_TOO_BIG: u64 = 9;
const EINSUFFICIENT_BALANCE: u64 = 10;
const ECOIN_DEPOSIT_IS_ZERO: u64 = 15;
const EBAD_TRANSACTION_FEE_TOKEN: u64 = 18;
const EDEPRECATED_FUNCTION: u64 = 19;
const EWITHDRAWAL_CAPABILITY_ALREADY_EXTRACTED: u64 = 101;
const EMALFORMED_AUTHENTICATION_KEY: u64 = 102;
const EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED: u64 = 103;
const EADDRESS_PUBLIC_KEY_INCONSISTENT: u64 = 104;
const EADDRESS_AND_AUTH_KEY_MISMATCH: u64 = 105;
const ERR_TOKEN_NOT_ACCEPT: u64 = 106;
const ERR_SIGNER_ALREADY_DELEGATED: u64 = 107;
const EPROLOGUE_SIGNER_ALREADY_DELEGATED: u64 = 200;

public fun txn_prologue_v2<TokenType: store>(
Expand Down

0 comments on commit f5c6f73

Please sign in to comment.