Skip to content

Commit 79dd422

Browse files
SkandaBhatashish10677Yashk767
authored
v0.1.6 (#241)
* Modify asset status implemented. (#163) * Modify asset status implemented. * Add modifyAsset command. * Apply gofmt. * Fix README. * Made status as a string and parsed to bool later. * Apply gofmt. Signed-off-by: Ashish Mishra <[email protected]> * Update go.yml (#173) * Update CONTRIBUTING.md (#174) * Checked Eth Balance is 0 instead of RZR balance check. (#162) * Added CheckEthBalanceIsZero() function * Removed RZR balance==0 check, instead added eth Balance check * Removed 'yes' as an option (#176) * Added condition to check ethBalance=0 in state dependent functions. (#175) * Added condition to check ethBalance=0 * Checked eth balance before fetching epoch * Propose only when iteration is less than last block in alt blocks when no. of proposed blocks == max alt blocks (#139) * Added GetMaxAltBlocks() function * Added condition to check numOfProposedBlocks == maxAltBlocks * Added aditional condition when numOfProposedBlocks > maxAltBlocks * Changed log.Infof to log.Info where it was not required * Modified log * minor changes to optimize code * Ux improvements for incentivized test-net. (#140) * Add description for `addJobToCollection` command. * Run help command by default. * Cobra CLI placeholder texts removed. Running razor without any commands displays the help page. Description of all commands changed. * Update fetching of addresses from addresses.json (#120) * Added addresses.json file * Added AssignAddressesFromJSON() function * Added getters for deployed addresses * Made changes according to new getters * Capitalized GetParametersAddress() function * Ran gofmt * Changed path to 'addresses.json' * minor changes * Moved addresses.json to dir deployed_addresses * Remove cache requirement. (#142) * Revert "Update fetching of addresses from addresses.json (#120)" (#147) This reverts commit 978bcdf. * Change amount to value and add -a shorthand for address. * Renamed docekerize-build to build-noargs * Throw warning if the RPC URL isn't an https URL. * Waiting for x blocks now changed to waiting x seconds. * Address validation done before checking for epoch and sending txn. * Run gofmt to format the code. * Made setconfig as camelcase. * Check if the user has unstaked before withdrawing funds. Signed-off-by: Ashish Mishra <[email protected]> Co-authored-by: Skanda Bhat <[email protected]> * Read password from file (#177) * Added GetPasswordFromFile(), IsFlagPassed() functions * Added an optional password flag * Added AssignPassword() function and moved password util functions to utils/password.go * Used AssignPassword() for same block of codes at places * Added a confirmation from user to set password from file * Revert "Added a confirmation from user to set password from file" This reverts commit 75e9402. * Added a warning when password flag is passed * Added chainID and salt in hash calculation (#161) * Auto unstake and withdraw if stake < minStake while voting (#181) * Added function to auto unstake and withdraw * Added condition when staker has already auto withdrawn * Shifted log statement * Added condition when stakerId=0 * Created Unstake and AutoWithdraw functions seperately in unstake.go * Changed log.Fatal to log.Error * Transact fractional RZRs (#180) * Added AssignAmountInWei(),GetFractionalAmountInWei() functions * Added pow flag, assigned valueInWei = AssignAmountInWei() * Changed 'amount' type to '*big.Int' in TestGetAmountWithChecks() * minor change * Added tests for new functions * Ran gofmt * Added GetAmountInDecimal() function * Implement algorithm to support large amount of votes during giveSorted. (#172) Signed-off-by: Ashish Mishra <[email protected]> * Apply gofmt. (#183) Signed-off-by: Ashish Mishra <[email protected]> * PR template (#184) * Apply gofmt. * Add Pull Request Template. Signed-off-by: Ashish Mishra <[email protected]> * v0.1.6 support implemented (#182) * Start working on v0.1.6 * Change contracts version on package.json * Fixed all compilation errors. * Ran gofmt. * Fix linting and test issues. * Fix performAggregation and add test cases. * Add new state parameter. * Commit and Reveal working. * Vote working. * Run gofmt. * Change version * Change the log messages. * Fix requested changes. * Remove unnecessary test. * Add stakerId as a flag in unstake, withdraw and reset lock. Signed-off-by: Ashish Mishra <[email protected]> * Implement logger (#209) * Initialize logger package. * Change log file name. * Add log rotation using lumberjack. * Apply gofmt. * Change log.Info to log.Debug at unnecessary places. * Removed icons from log. * Removed sleep animations. * Apply gofmt and run golangci lint run. * Implement config variable to toggle debug mode. * Add config details in log. * Modify README to support new changes. Signed-off-by: Ashish Mishra <[email protected]> * Fix bug in median calculation (#211) * Fix the issue of the wrong median while proposing. Signed-off-by: Ashish Mishra <[email protected]> * Displayed state name instead of state no. (#190) * Added switch case for state names * Removed state no. from log * Created new files * Displayed state name in vote.go * Revert "Created new files" This reverts commit 90a958d. * Add check for inactive stakers (#217) * Add a check for active staker while proposing a block. Signed-off-by: Ashish Mishra <[email protected]> * Test approve (#218) * Added interfaces and supporting structs in new file * Created mocks * Modified approve() and seperated it in approve.go * Added Test cases for approve() * minor changes * Changed error formating * requested changes * Logger hotfix (#225) Logger now logs to both STDERR and the log file. Signed-off-by: Ashish Mishra <[email protected]> * Stake value is now shown in highest denomination with precision of 32bytes. (#226) Converted stake from Wei. Signed-off-by: Ashish Mishra <[email protected]> * Median calculation fix (#228) * Fix issue of wrong median while proposing. * Median calculation fixed by multiplying stake of each staker with their influence. * Fix typo in log. Signed-off-by: Ashish Mishra <[email protected]> * Test create (#229) * Separate create function * Implemented functions and added mocks * Added create tests * Minor changes * Test stake (#223) * Added stakeManager utils * Modified stake function * Added tests for stake * minor changes * minor changes and removed unused functions * Fixed error package (#235) * Retry mechanism (#234) * Apply gofmt. Signed-off-by: Ashish Mishra <[email protected]> * PR template (#184) * Apply gofmt. * Add Pull Request Template. Signed-off-by: Ashish Mishra <[email protected]> * v0.1.6 support implemented (#182) * Start working on v0.1.6 * Change contracts version on package.json * Fixed all compilation errors. * Ran gofmt. * Fix linting and test issues. * Fix performAggregation and add test cases. * Add new state parameter. * Commit and Reveal working. * Vote working. * Run gofmt. * Change version * Change the log messages. * Fix requested changes. * Remove unnecessary test. * Add stakerId as a flag in unstake, withdraw and reset lock. Signed-off-by: Ashish Mishra <[email protected]> * Fix issue of wrong median while proposing. Signed-off-by: Ashish Mishra <[email protected]> * Retry fallback mechanism implemented in Commit state. Signed-off-by: Ashish Mishra <[email protected]> * Add retry mechanism completely in GetActiveAssetsData function. Signed-off-by: Ashish Mishra <[email protected]> * Implement retry for block manager functions. Signed-off-by: Ashish Mishra <[email protected]> * Implement retry in stake.go. Signed-off-by: Ashish Mishra <[email protected]> * Implement retry mechanism for vote.go. Signed-off-by: Ashish Mishra <[email protected]> * Apply gofmt. Signed-off-by: Ashish Mishra <[email protected]> * Fix bug in median calculation (#211) * Fix the issue of the wrong median while proposing. Signed-off-by: Ashish Mishra <[email protected]> * Displayed state name instead of state no. (#190) * Added switch case for state names * Removed state no. from log * Created new files * Displayed state name in vote.go * Revert "Created new files" This reverts commit 90a958d. * Add retry mechanism completely in GetActiveAssetsData function. Signed-off-by: Ashish Mishra <[email protected]> * Apply gofmt. Signed-off-by: Ashish Mishra <[email protected]> * Run golangci lint. Signed-off-by: Ashish Mishra <[email protected]> * Remove TODO comments. Signed-off-by: Ashish Mishra <[email protected]> * Stake value is now shown in highest denomination with precision of 32bytes. (#226) Converted stake from Wei. Signed-off-by: Ashish Mishra <[email protected]> * Median calculation fix (#228) * Fix issue of wrong median while proposing. * Median calculation fixed by multiplying stake of each staker with their influence. * Fix typo in log. Signed-off-by: Ashish Mishra <[email protected]> * Test create (#229) * Separate create function * Implemented functions and added mocks * Added create tests * Minor changes * Test stake (#223) * Added stakeManager utils * Modified stake function * Added tests for stake * minor changes * minor changes and removed unused functions * Apply new fallback algorithm for fetching collection values. Signed-off-by: Ashish Mishra <[email protected]> Co-authored-by: Yashk767 <[email protected]> Co-authored-by: Ashish Kumar Mishra <[email protected]> Co-authored-by: Yashk767 <[email protected]>
1 parent 7e78406 commit 79dd422

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3116
-6692
lines changed

.github/CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ We use github to host code, to track issues and feature requests, as well as acc
1313
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
1414
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
1515

16-
1. Fork the repo and create your branch from `main`.
16+
1. Fork the repo and create your branch from `develop`.
1717
2. If you've added code that should be tested, add tests.
1818
3. If you've changed commands, update the documentation.
1919
4. Ensure the test suite passes.
2020
5. Issue that pull request!
2121

22-
PS: make sure that your commits are [signed](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/about-commit-signature-verification). Only signed commits can be merged to the `main` branch.
22+
PS: make sure that your commits are [signed](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/about-commit-signature-verification). Only signed commits can be merged to the `develop` branch.
2323

2424
## Report bugs using Github's [issues](https://github.com/razor-network/razor-go/issues)
2525
If you've found something wrong we want to know about it, please help us understand the problem so we can resolve it.

.github/PULL_REQUEST_TEMPLATE.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
**Test Configuration**:
24+
* Contracts version:
25+
* Hardware:
26+
27+
# Checklist:
28+
29+
- [ ] My code follows the style guidelines of this project
30+
- [ ] I have performed a self-review of my own code
31+
- [ ] I have commented my code, particularly in hard-to-understand areas
32+
- [ ] I have made corresponding changes to the documentation
33+
- [ ] My changes generate no new warnings
34+
- [ ] I have added tests that prove my fix is effective or that my feature works
35+
- [ ] New and existing unit tests pass locally with my changes
36+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/go.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Go
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, develop ]
66
tags: [ v* ]
77
pull_request:
8-
branches: [ main ]
8+
branches: [ main, develop ]
99

1010
jobs:
1111

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ RAZOR = ${BIN_DIR}/razor
55

66
all: fetch_bindings install_razor set_config
77
build: install_razor set_config
8-
docker-build: fetch_bindings install_razor
8+
build-noargs: fetch_bindings install_razor
99
setup: fetch_bindings
1010

1111
fetch_bindings:
1212
@echo "Installing contract dependencies..."
13+
@echo ""
1314
@${SHELL} generate-bindings.sh
14-
@echo "Contract bindings generated....\n"
15+
@echo "Contract bindings generated...."
16+
@echo ""
1517

1618
install_razor:
1719
@echo "Installing razor node...."

README.md

+43-22
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,40 @@ Example:
168168
$ ./razor transfer --amount 100 --to 0x91b1E6488307450f4c0442a1c35Bc314A505293e --from 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c
169169
```
170170

171+
### Set Config
172+
There are a set of parameters that are configurable. These include:
173+
174+
* Provider: The RPC URL of the provider you are using to connect to the blockchain.
175+
* Gas Multiplier: The value with which the gas price will be multiplied while sending every transaction.
176+
* Buffer Size: Buffer size determines, out of all blocks in a state, in how many blocks the voting or any other operation can be performed.
177+
* Wait Time: This is the number of blocks the system will wait while voting.
178+
* Gas Price: The value of gas price if you want to set manually. If you don't provide any value or simply keep it to 0, the razor client will automatically calculate the optimum gas price and send it.
179+
* Log Level: Normally debug logs are not logged into the log file. But if you want you can set `logLevel` to `debug` and fetch the debug logs.
180+
181+
The config is set while the build is generated, but if you need to change any of the above parameter, you can use the `setConfig` command.
182+
183+
```
184+
$ ./razor setConfig --provider <rpc_provider> --gasmultiplier <multiplier_value> --buffer <buffer_percentage> --wait <wait_for_n_blocks> --gasprice <gas_price> --logLevel <debug_or_info>
185+
```
186+
187+
Example:
188+
```
189+
$ ./razor setConfig --provider https://infura/v3/matic --gasmultiplier 1.5 --buffer 20 --wait 70 --gasprice 1 --logLevel debug
190+
```
191+
192+
Other than setting these parameters in the config, you can use different values of these parameters in different command. Just add the same flag to any command you want to use and the new config changes will appear for that command.
193+
194+
Example:
195+
```
196+
$ ./razor vote --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --gasprice 10
197+
```
198+
This will cause this particular vote command to run with a gas price of 10.
199+
200+
171201
### Create Job
172-
You can create new jobs using `creteJob` command. This command will work only for admins.
202+
Create new jobs using `creteJob` command.
173203

204+
_Note: This command is restricted to "Admin Role"_
174205
```
175206
$ ./razor createJob --url <URL> --selector <selector_in_json_selector_format> --name <name> --address <address> --repeat <true_or_false>
176207
```
@@ -185,7 +216,9 @@ $ ./razor createJob --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c -n eth
185216
```
186217

187218
### Create Collection
188-
You can create new collections using `creteCollection` command. This command will work only for admins.
219+
Create new collections using `creteCollection` command.
220+
221+
_Note: This command is restricted to "Admin Role"_
189222

190223
```
191224
$ ./razor createCollection --name <collection_name> --address <address> --jobIds <list_of_job_ids> --aggregation <aggregation_method>
@@ -197,7 +230,9 @@ $ ./razor createCollection --name btcCollectionMean --address 0x5a0b54d5dc17e0aa
197230
```
198231

199232
### Add Job to Collection
200-
You can add existing jobs to existing collections using `addJobToCollection` command. This command will work only for admins.
233+
Add existing jobs to existing collections using `addJobToCollection` command.
234+
235+
_Note: This command is restricted to "Admin Role"_
201236

202237
```
203238
$ ./razor addJobToCollection --address <address> --jobId <job_id> --collectionId <collection_id>
@@ -208,33 +243,19 @@ Example:
208243
$ ./razor addJobToCollection --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --collectionId 6 --jobId 7
209244
```
210245

211-
### Set Config
212-
There are a set of parameters that are configurable. These include:
213-
214-
* Provider: The RPC URL of the provider you are using to connect to the blockchain.
215-
* Gas Multiplier: The value with which the gas price will be multiplied while sending every transaction.
216-
* Buffer Size: Buffer size determines, out of all blocks in a state, in how many blocks the voting or any other operation can be performed.
217-
* Wait Time: This is the number of blocks the system will wait while voting.
218-
* Gas Price: The value of gas price if you want to set manually. If you don't provide any value or simply keep it to 0, the razor client will automatically calculate the optimum gas price and send it.
219-
220-
The config is set while the build is generated, but if you need to change any of the above parameter, you can use the `setconfig` command.
246+
### Modify Asset Status
247+
Modify the active status of an asset using the `modifyAssetStatus` command.
221248

222-
```
223-
$ ./razor setconfig --provider <rpc_provider> --gasmultiplier <multiplier_value> --buffer <buffer_percentage> --wait <wait_for_n_blocks> --gasprice <gas_price>
224-
```
249+
_Note: This command is restricted to "Admin Role"_
225250

226-
Example:
227251
```
228-
$ ./razor setconfig --provider https://infura/v3/matic --gasmultiplier 1.5 --buffer 20 --wait 70 --gasprice 1
252+
$ ./razor modifyAssetStatus --assetId <assetId> --address <address> --status <true_or_false>
229253
```
230254

231-
Other than setting these parameters in the config, you can use different values of these parameters in different command. Just add the same flag to any command you want to use and the new config changes will appear for that command.
232-
233255
Example:
234256
```
235-
$ ./razor vote --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --gasprice 10
257+
$ ./razor modifyAssetStatus --assetId 1 --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --status false
236258
```
237-
This will cause this particular vote command to run with a gas price of 10.
238259

239260
### Contribute to razor-go
240261
We would really appreciate your contribution. To see our [contribution guideline](https://github.com/razor-network/razor-go/blob/main/.github/CONTRIBUTING.md)

accounts/accounts.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import (
55
"github.com/ethereum/go-ethereum/accounts"
66
"github.com/ethereum/go-ethereum/accounts/keystore"
77
"github.com/ethereum/go-ethereum/crypto"
8-
log "github.com/sirupsen/logrus"
98
"io/ioutil"
109
"razor/core/types"
10+
"razor/logger"
1111
"strings"
1212
)
1313

14+
var log = logger.NewLogger()
15+
1416
func CreateAccount(path string, password string) accounts.Account {
1517
ks := keystore.NewKeyStore(path, keystore.StandardScryptN, keystore.StandardScryptP)
1618
accounts.NewManager(&accounts.Config{InsecureUnlockAllowed: false}, ks)

cmd/addJobToCollection.go

+18-28
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
package cmd
22

33
import (
4-
log "github.com/sirupsen/logrus"
5-
"math/big"
64
"razor/core"
75
"razor/core/types"
86
"razor/utils"
97

108
"github.com/spf13/cobra"
119
)
1210

13-
// addJobToCollectionCmd represents the addJobToCollection command
1411
var addJobToCollectionCmd = &cobra.Command{
1512
Use: "addJobToCollection",
16-
Short: "A brief description of your command",
17-
Long: `A longer description that spans multiple lines and likely contains examples
18-
and usage of using your command. For example:
13+
Short: "addJobToCollection can be used to add a particular job to an existing collection",
14+
Long: `If there are existing jobs and collections, this command can be used to add a job to a collection.
1915
20-
Cobra is a CLI library for Go that empowers applications.
21-
This application is a tool to generate the needed files
22-
to quickly create a Cobra application.`,
16+
Example:
17+
./razor addJobToCollection --address 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c --collectionId 6 --jobId 7
18+
19+
Note:
20+
This command only works for the admin.
21+
`,
2322
Run: func(cmd *cobra.Command, args []string) {
2423
config, err := GetConfigData()
2524
if err != nil {
@@ -29,21 +28,11 @@ to quickly create a Cobra application.`,
2928
password := utils.PasswordPrompt()
3029

3130
address, _ := cmd.Flags().GetString("address")
32-
jobId, _ := cmd.Flags().GetString("jobId")
33-
collectionId, _ := cmd.Flags().GetString("collectionId")
31+
jobId, _ := cmd.Flags().GetUint8("jobId")
32+
collectionId, _ := cmd.Flags().GetUint8("collectionId")
3433

3534
client := utils.ConnectToClient(config.Provider)
3635

37-
jobIdInBigInt, ok := new(big.Int).SetString(jobId, 10)
38-
if !ok {
39-
log.Fatal("SetString: error")
40-
}
41-
42-
collectionIdInBigInt, ok := new(big.Int).SetString(collectionId, 10)
43-
if !ok {
44-
log.Fatal("SetString: error")
45-
}
46-
4736
txnOpts := utils.GetTxnOpts(types.TransactionOptions{
4837
Client: client,
4938
Password: password,
@@ -53,11 +42,12 @@ to quickly create a Cobra application.`,
5342
})
5443

5544
assetManager := utils.GetAssetManager(client)
56-
log.Infof("Adding Job %s to collection %s", jobIdInBigInt, collectionIdInBigInt)
57-
txn, err := assetManager.AddJobToCollection(txnOpts, collectionIdInBigInt, jobIdInBigInt)
45+
log.Infof("Adding Job %d to collection %d", jobId, collectionId)
46+
txn, err := assetManager.AddJobToCollection(txnOpts, collectionId, jobId)
5847
if err != nil {
5948
log.Fatal(err)
6049
}
50+
log.Info("Txn Hash: ", txn.Hash())
6151
utils.WaitForBlockCompletion(client, txn.Hash().String())
6252
},
6353
}
@@ -67,13 +57,13 @@ func init() {
6757

6858
var (
6959
Account string
70-
JobId string
71-
CollectionId string
60+
JobId uint8
61+
CollectionId uint8
7262
)
7363

74-
addJobToCollectionCmd.Flags().StringVarP(&Account, "address", "", "", "address of the job creator")
75-
addJobToCollectionCmd.Flags().StringVarP(&JobId, "jobId", "", "", "job id to add to the collection")
76-
addJobToCollectionCmd.Flags().StringVarP(&CollectionId, "collectionId", "", "", "collection id")
64+
addJobToCollectionCmd.Flags().StringVarP(&Account, "address", "a", "", "address of the job creator")
65+
addJobToCollectionCmd.Flags().Uint8VarP(&JobId, "jobId", "", 0, "job id to add to the collection")
66+
addJobToCollectionCmd.Flags().Uint8VarP(&CollectionId, "collectionId", "", 0, "collection id")
7767

7868
addrErr := addJobToCollectionCmd.MarkFlagRequired("address")
7969
utils.CheckError("Address error: ", addrErr)

cmd/approve.go

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package cmd
2+
3+
import (
4+
"github.com/ethereum/go-ethereum/common"
5+
"razor/core"
6+
"razor/core/types"
7+
)
8+
9+
func approve(txnArgs types.TransactionOptions, razorUtils utilsInterface, tokenManagerUtils tokenManagerInterface, transactionUtils transactionInterface) (common.Hash, error) {
10+
opts := razorUtils.GetOptions(false, txnArgs.AccountAddress, "")
11+
allowance, err := tokenManagerUtils.Allowance(txnArgs.Client, &opts, common.HexToAddress(txnArgs.AccountAddress), common.HexToAddress(core.StakeManagerAddress))
12+
if err != nil {
13+
return common.Hash{0x00}, err
14+
}
15+
if allowance.Cmp(txnArgs.Amount) >= 0 {
16+
log.Debug("Sufficient allowance, no need to increase")
17+
return common.Hash{0x00}, nil
18+
} else {
19+
log.Info("Sending Approve transaction...")
20+
txnOpts := razorUtils.GetTxnOpts(txnArgs)
21+
txn, err := tokenManagerUtils.Approve(txnArgs.Client, txnOpts, common.HexToAddress(core.StakeManagerAddress), txnArgs.Amount)
22+
if err != nil {
23+
return common.Hash{0x00}, err
24+
}
25+
log.Info("Txn Hash: ", transactionUtils.Hash(txn))
26+
return transactionUtils.Hash(txn), nil
27+
}
28+
}

0 commit comments

Comments
 (0)