mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-30 04:35:22 +08:00
fix(pox-4-tests): Update AllowContractCallerCommand to remove the wallet from ex-allowed's list
This commit is contained in:
committed by
Nikos Baxevanis
parent
d2c1eb74dd
commit
e33895fa78
@@ -74,6 +74,27 @@ export class AllowContractCallerCommand implements PoxCommand {
|
||||
|
||||
// Get the wallets involved from the model and update it with the new state.
|
||||
const wallet = model.stackers.get(this.wallet.stxAddress)!;
|
||||
const callerAllowedBefore = wallet.allowedContractCaller;
|
||||
|
||||
const callerAllowedBeforeState = model.stackers.get(callerAllowedBefore) ||
|
||||
null;
|
||||
|
||||
if (callerAllowedBeforeState) {
|
||||
// Remove the allower from the ex-allowed caller's allowance list.
|
||||
|
||||
const walletIndexInsideAllowedByList = callerAllowedBeforeState
|
||||
.callerAllowedBy.indexOf(
|
||||
this.wallet.stxAddress,
|
||||
);
|
||||
|
||||
expect(walletIndexInsideAllowedByList).toBeGreaterThan(-1);
|
||||
|
||||
callerAllowedBeforeState.callerAllowedBy.splice(
|
||||
walletIndexInsideAllowedByList,
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
const callerToAllow = model.stackers.get(this.allowanceTo.stxAddress)!;
|
||||
// Update model so that we know this wallet has authorized a contract-caller.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user