nearprotocol

Error on returning environmental account id's

眉间皱痕 提交于 2019-12-24 06:31:19
问题 If I have the following method to test predecessor_account_id behaviour pub fn get_pred_acc(&self) -> (String { let prev_acc = env::predecessor_account_id().to_string(); return prev_acc; } And try to call this from frontend const contract = await this.near.loadContract(window.nearConfig.contractName, { viewMethods: ["get_pred_acc", ], changeMethods: [], sender: this.accountId, }); const acc = await contract.get_pred_acc(); I get the following error: Uncaught (in promise) Error: Querying call