Obtain actor principal without going through async methods
infu opened this issue · comments
There is currently no way of passing 'this' - the current actor to a library inside the body during installation.
Can we add a system function similar to postupgrade that will trigger on new install only.
https://forum.dfinity.org/t/devefi-ledger-icrc-ledger-client-library/27274/3
When writing libraries - middleware, we have to do something like this:
public shared({caller}) func start() {
assert(Principal.isController(caller));
config.canister := Principal.fromActor(this);
ledgerOne.setOwner(this);
};
c.f #3718