Candid interface compatibility check failed in Motoko

343 Views Asked by At

When I run the code dfx deploy, it shows:

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

How can I solve the problem????

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");
        }
 };
}

I am trying to show my application to Candid user Interface.

1

There are 1 best solutions below

0
On

If I remember correctly you have to type yes and not y.