当我运行代码dfx deploy
时,显示:
Candid interface compatibility check failed for canister 'dbank'.
You are making a BREAKING change. Other canisters or frontend clients relying on your canister may stop working.
Method topUp: func (nat) -> () oneway is not a subtype of func () -> () oneway
Do you want to proceed? yes/No
y
Error: Refusing to install canister without approval
我如何解决这个问题????
import Debug "mo:base/Debug";
actor DBank {
var currentValue = 300;
currentValue := 100;
let id = 12545856545;
public func topUp(amount: Nat){
currentValue += amount;
Debug.print(debug_show(currentValue));
};
public func withdraw(amount: Nat) {
if (amount <= currentValue) {
currentValue -= amount;
Debug.print(debug_show(currentValue));
} else {
Debug.print("amount too large, not enough balance");
}
};
}
我正在尝试向Candid用户界面展示我的应用程序。
如果我没记错的话,你必须输入yes
而不是y
。