Struct Contract

Source
pub struct Contract { /* private fields */ }

Implementations§

Source§

impl Contract

Source

pub fn create_address( &mut self, address: AccountId, category: Category, risk_score: RiskScore, case_id: CaseId, )

Source

pub fn update_address( &mut self, address: AccountId, category: Category, risk_score: RiskScore, case_id: CaseId, )

Source

pub fn confirm_address(&mut self, address: AccountId)

Source§

impl Contract

Source

pub fn get_address(&self, address: &AccountId) -> AddressView

Source

pub fn get_addresses(&self, take: u64, skip: u64) -> Vec<AddressView>

Source

pub fn get_address_count(&self) -> u64

Source§

impl Contract

Source

pub fn get_address_internal(&self, address: &AccountId) -> Address

Source§

impl Contract

Source

pub fn create_asset( &mut self, address: AccountId, id: U64, category: Category, risk_score: RiskScore, case_id: CaseId, )

Source

pub fn update_asset( &mut self, address: AccountId, id: U64, category: Category, risk_score: RiskScore, case_id: CaseId, )

Source

pub fn confirm_asset(&mut self, address: AccountId, id: U64)

Source§

impl Contract

Source

pub fn get_asset(&self, address: AccountId, id: U64) -> AssetView

Source

pub fn get_assets(&self, take: u64, skip: u64) -> Vec<AssetView>

Source

pub fn get_asset_count(&self) -> u64

Source§

impl Contract

Source

pub fn create_case(&mut self, id: CaseId, name: String, url: String)

Source

pub fn update_case( &mut self, id: CaseId, name: String, status: CaseStatus, url: String, )

Source§

impl Contract

Source

pub fn get_case(&self, id: CaseId) -> Case

Source

pub fn get_cases(&self, skip: u64, take: u64) -> Vec<Case>

Source

pub fn get_case_count(&self) -> u64

Source§

impl Contract

Source

pub fn update_stake_configuration( &mut self, stake_configuration: StakeConfiguration, )

Source

pub fn update_reward_configuration( &mut self, reward_configuration: RewardConfiguration, )

Source

pub fn set_authority(&mut self, authority: AccountId)

Source

pub fn get_stake_configuration(&self) -> StakeConfiguration

Source

pub fn get_reward_configuration(&self) -> RewardConfiguration

Source

pub fn get_authority(&self) -> AccountId

Source§

impl Contract

Source

pub fn create_reporter( &mut self, id: ReporterId, account_id: AccountId, name: String, role: Role, url: String, )

Source

pub fn update_reporter( &mut self, id: ReporterId, account_id: AccountId, name: String, role: Role, url: String, )

Source

pub fn deactivate_reporter(&mut self)

Source

pub fn unstake(&mut self)

Source§

impl Contract

Source

pub fn activate_reporter(&mut self, account_id: AccountId, amount: U128)

Source§

impl Contract

Source

pub fn get_reporter(&self, id: ReporterId) -> Reporter

Source

pub fn get_reporters(&self, take: u64, skip: u64) -> Vec<Reporter>

Source

pub fn get_reporter_count(&self) -> u64

Source

pub fn get_reporter_by_account(&self, account_id: AccountId) -> Reporter

Source§

impl Contract

Source

pub fn ext(account_id: AccountId) -> ContractExt

API for calling this contract’s functions in a subsequent execution.

Source§

impl Contract

Source§

impl Contract

Trait Implementations§

Source§

impl BorshDeserialize for Contract

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for Contract

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl Default for Contract

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ExtSelf for Contract

Source§

fn after_transfer_stake(&mut self, reporter_account: AccountId, amount: U128)

Source§

impl FungibleTokenReceiver for Contract

Source§

fn ft_on_transfer( &mut self, sender_id: AccountId, amount: U128, msg: String, ) -> PromiseOrValue<U128>

Called by fungible token contract after ft_transfer_call was initiated by sender_id of the given amount with the transfer message given in msg field. The amount of tokens were already transferred to this contract account and ready to be used. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.