mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
f
This commit is contained in:
parent
3c835e0cc2
commit
d1c8442b44
1 changed files with 3 additions and 4 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue