diff --git a/contrib/core-contract-tests/tests/pox-4/pox_Commands.ts b/contrib/core-contract-tests/tests/pox-4/pox_Commands.ts index aa7bf8c3430..bea89074127 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_Commands.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_Commands.ts @@ -50,20 +50,20 @@ export function PoxCommands( wallet: fc.constantFrom(...wallets.values()), delegateTo: fc.constantFrom(...wallets.values()), untilBurnHt: fc.integer({ min: 1 }), - margin: fc.integer({ min: 1, max: 9 }), + amount: fc.bigInt({ min:0n, max: 100_000_000_000_000n }), }).map(( r: { wallet: Wallet; delegateTo: Wallet; untilBurnHt: number; - margin: number; + amount: bigint; }, ) => new DelegateStxCommand( r.wallet, r.delegateTo, r.untilBurnHt, - r.margin, + r.amount, ) ), // DelegateStackStxCommand diff --git a/contrib/core-contract-tests/tests/pox-4/pox_DelegateStackStxCommand.ts b/contrib/core-contract-tests/tests/pox-4/pox_DelegateStackStxCommand.ts index 27515cc2250..4fb9ed09a40 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_DelegateStackStxCommand.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_DelegateStackStxCommand.ts @@ -100,7 +100,6 @@ export class DelegateStackStxCommand implements PoxCommand { ], this.operator.stxAddress, ); - const { result: rewardCycle } = real.network.callReadOnlyFn( "ST000000000000000000002AMW42H.pox-4", "burn-height-to-reward-cycle", @@ -140,10 +139,10 @@ export class DelegateStackStxCommand implements PoxCommand { // Log to console for debugging purposes. This is not necessary for the // test to pass but it is useful for debugging and eyeballing the test. console.info( - `✓ ${this.operator.label.padStart(8, " ")} Ӿ ${this.operator.label.padStart(8, " ")} ${ + `✓ ${this.operator.label.padStart(8, " ")} Ӿ ${this.stacker.label.padStart(8, " ")} ${ "delegate-stack-stx".padStart(23, " ") } ${"lock-amount".padStart(12, " ")} ${ - this.amountUstx.toString().padStart(13, " ") + this.amountUstx.toString().padStart(15, " ") } ${"until".padStart(37)} ${this.stacker.unlockHeight.toString().padStart(17)}`, ); } diff --git a/contrib/core-contract-tests/tests/pox-4/pox_DelegateStxCommand.ts b/contrib/core-contract-tests/tests/pox-4/pox_DelegateStxCommand.ts index 8d79e096ed6..08d2988293b 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_DelegateStxCommand.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_DelegateStxCommand.ts @@ -16,7 +16,7 @@ export class DelegateStxCommand implements PoxCommand { readonly wallet: Wallet; readonly delegateTo: Wallet; readonly untilBurnHt: number; - readonly margin: number; + readonly amount: bigint; /** * Constructs a `DelegateStxCommand` to delegate uSTX for stacking. @@ -24,19 +24,19 @@ export class DelegateStxCommand implements PoxCommand { * @param wallet - Represents the Stacker's wallet. * @param delegateTo - Represents the Delegatee's STX address. * @param untilBurnHt - The burn block height until the delegation is valid. - * @param margin - Multiplier for minimum required uSTX to stack so that each - * Stacker locks a different amount of uSTX across test runs. + * @param amount - The maximum amount the `Stacker` delegates the `Delegatee` to + * stack on his behalf */ constructor( wallet: Wallet, delegateTo: Wallet, untilBurnHt: number, - margin: number, + amount: bigint, ) { this.wallet = wallet; this.delegateTo = delegateTo; this.untilBurnHt = untilBurnHt; - this.margin = margin; + this.amount = amount; } check(model: Readonly): boolean { @@ -50,16 +50,9 @@ export class DelegateStxCommand implements PoxCommand { run(model: Stub, real: Real): void { // The amount of uSTX delegated by the Stacker to the Delegatee. - // For our tests, we will use the minimum amount of uSTX to be stacked - // in the given reward cycle multiplied by the margin, which is a randomly - // generated number passed to the constructor of this class. Even if there - // are no constraints about the delegated amount, it will be checked in the - // future, when calling delegate-stack-stx. - const delegatedAmount = model.stackingMinimum * this.margin; - - // The amount of uSTX to be delegated. For this test, we will use the - // delegated amount calculated before. - const amountUstx = delegatedAmount; + // Even if there are no constraints about the delegated amount, + // it will be checked in the future, when calling delegate-stack-stx. + const amountUstx = Number(this.amount); // Act const delegateStx = real.network.callPublicFn( @@ -103,7 +96,7 @@ export class DelegateStxCommand implements PoxCommand { } ${"amount".padStart(12, " ")} ${ amountUstx .toString() - .padStart(13, " ") + .padStart(15, " ") } delegated to ${ this.delegateTo.label.padStart( 42, diff --git a/contrib/core-contract-tests/tests/pox-4/pox_GetStackingMinimumCommand.ts b/contrib/core-contract-tests/tests/pox-4/pox_GetStackingMinimumCommand.ts index e9968e70607..3f573f4d992 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_GetStackingMinimumCommand.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_GetStackingMinimumCommand.ts @@ -46,7 +46,7 @@ export class GetStackingMinimumCommand implements PoxCommand { `✓ ${this.wallet.label.padStart(8, " ")} ${ "get-stacking-minimum".padStart(34, " ") } ${"pox-4".padStart(12, " ")} ${ - stackingMinimum.value.toString().padStart(13, " ") + stackingMinimum.value.toString().padStart(15, " ") }`, ); } diff --git a/contrib/core-contract-tests/tests/pox-4/pox_GetStxAccountCommand.ts b/contrib/core-contract-tests/tests/pox-4/pox_GetStxAccountCommand.ts index 0a902f03667..58257cf529a 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_GetStxAccountCommand.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_GetStxAccountCommand.ts @@ -39,7 +39,7 @@ export class GetStxAccountCommand implements PoxCommand { `✓ ${this.wallet.label.padStart(8, " ")} ${ "stx-account".padStart(34, " ") } ${"lock-amount".padStart(12, " ")} ${ - actual.amountLocked.toString().padStart(13, " ") + actual.amountLocked.toString().padStart(15, " ") } ${"unlocked-amount".padStart(12, " ")} ${ actual.amountUnlocked.toString().padStart(15, " ") } ${"unlocked-height".padStart(12, " ")} ${ diff --git a/contrib/core-contract-tests/tests/pox-4/pox_StackStxCommand.ts b/contrib/core-contract-tests/tests/pox-4/pox_StackStxCommand.ts index 68aa2f19921..c77fe9e2065 100644 --- a/contrib/core-contract-tests/tests/pox-4/pox_StackStxCommand.ts +++ b/contrib/core-contract-tests/tests/pox-4/pox_StackStxCommand.ts @@ -159,7 +159,7 @@ export class StackStxCommand implements PoxCommand { `✓ ${this.wallet.label.padStart(8, " ")} ${ "stack-stx".padStart(34, " ") } ${"lock-amount".padStart(12, " ")} ${ - amountUstx.toString().padStart(13, " ") + amountUstx.toString().padStart(15, " ") }`, ); }