Skip to content

Commit

Permalink
refactor: use object instead of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Mar 15, 2024
1 parent b0c1d0a commit cbd5030
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/bond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,13 +814,15 @@ export class BondContract extends Contract {
*/
addPeriodsBonds(
senderAddress: IAddress,
periods: number[],
bonds: BigNumber.Value[]
lockPeriodsWithBonds: {
lockPeriod: number;
amount: BigNumber.Value;
}[]
) {
let combinedArray: TypedValue[] = [];
periods.map((period, index) => {
combinedArray.push(new U64Value(period));
combinedArray.push(new BigUIntValue(bonds[index]));
lockPeriodsWithBonds.map((lockPeriodWithBond) => {
combinedArray.push(new U64Value(lockPeriodWithBond.lockPeriod));
combinedArray.push(new BigUIntValue(lockPeriodWithBond.amount));
});

const tx = new Transaction({
Expand Down

0 comments on commit cbd5030

Please sign in to comment.