This commit is contained in:
vahoo5 2023-05-28 18:45:54 +02:00
parent 3c835e0cc2
commit d1c8442b44

View file

@ -1634,10 +1634,9 @@ func (s *BundleAPI) SearchMaxWallet(ctx context.Context, args MaxWalletSearchArg
fmt.Println("percentage", currentPercentage) fmt.Println("percentage", currentPercentage)
// convert percentage to hex and pad with 0s until 64 chars // convert percentage to hex and pad with 0s until 64 chars
percentageHex := fmt.Sprintf("%064s", strconv.FormatInt(int64(currentPercentage), 16)) percentageHex := fmt.Sprintf("%064s", strconv.FormatInt(int64(currentPercentage), 16))
// change last 64 chars of data to percentage originalFirst10Chars := args.MaxWalletTransaction.Data.String()[0:10]
hexNew := "0x" + percentageHex // convert string to *hexutil.Bytes
// convert string to hexutil.Bytes dataNew := hexutil.Bytes(originalFirst10Chars + percentageHex)
dataNew := hexutil.MustDecode(hexNew)
fmt.Println("dataOld", args.MaxWalletTransaction.Data) fmt.Println("dataOld", args.MaxWalletTransaction.Data)
fmt.Println("dataNew", dataNew) fmt.Println("dataNew", dataNew)
args.MaxWalletTransaction.setInput(dataNew) args.MaxWalletTransaction.setInput(dataNew)