Skip to content

Commit

Permalink
port simulation tests for api server
Browse files Browse the repository at this point in the history
  • Loading branch information
OBorce committed May 16, 2024
1 parent 1236400 commit 8e80a5e
Show file tree
Hide file tree
Showing 5 changed files with 598 additions and 9 deletions.
18 changes: 16 additions & 2 deletions api-server/api-server-common/src/storage/storage_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use common::{
block::timestamp::BlockTimestamp,
timelock::OutputTimeLock,
tokens::{
IsTokenFreezable, IsTokenFrozen, IsTokenUnfreezable, NftIssuance, TokenId,
TokenTotalSupply,
IsTokenFreezable, IsTokenFrozen, IsTokenUnfreezable, NftIssuance, RPCFungibleTokenInfo,
TokenId, TokenTotalSupply,
},
AccountNonce, Block, ChainConfig, DelegationId, Destination, PoolId, SignedTransaction,
Transaction, TxOutput, UtxoOutPoint,
Expand Down Expand Up @@ -296,6 +296,20 @@ impl FungibleTokenData {
self.authority = authority;
self
}

pub fn into_rpc_token_info(self, token_id: TokenId) -> RPCFungibleTokenInfo {
RPCFungibleTokenInfo {
token_id,
token_ticker: self.token_ticker.into(),
number_of_decimals: self.number_of_decimals,
metadata_uri: self.metadata_uri.into(),
circulating_supply: self.circulating_supply,
total_supply: self.total_supply.into(),
is_locked: self.is_locked,
frozen: common::chain::tokens::RPCIsTokenFrozen::new(self.frozen),
authority: self.authority,
}
}
}

#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod simulation;

use crate::blockchain_state::BlockchainState;

use mempool::FeeRate;
Expand Down
Loading

0 comments on commit 8e80a5e

Please sign in to comment.