Skip to content

Commit 35e1545

Browse files
authored
Update contracts (#66)
* Update razor network version * package lock * Update schelling coin to razor * Fix for latest contracts * Update npm version
1 parent 21d30be commit 35e1545

File tree

7 files changed

+19
-30
lines changed

7 files changed

+19
-30
lines changed

core/constants.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "math/big"
44

55
//TODO: Change these addresses to the deployed address.
66
var StakeManagerAddress = "0xBfBA8b5F2CaD3Fdd82893BECDBfb0193C878CED6"
7-
var SchellingCoinAddress = "0x1Ca31A8832c532DD22AcFB0a3cf7b9F87F4574e6"
7+
var RAZORAddress = "0x1Ca31A8832c532DD22AcFB0a3cf7b9F87F4574e6"
88
var ParametersAddress = "0x1B08F228697A195fB0406A8EB24C3A4E35209c1A"
99
var AssetManagerAddress = "0xC5edba1DdA6FF3D7682284Da6eeb65b793704a5c"
1010
var VoteManagerAddress = "0xA47b2F152628E2865A42153d59dFa4336E94be50"

core/types/contract.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ type Job struct {
1313
Selector string
1414
Name string
1515
Repeat bool
16+
Active bool
1617
Creator common.Address
17-
Credit *big.Int
18-
Fulfilled bool
1918
Result *big.Int
2019
AssetType *big.Int
2120
}

generate-bindings.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ contracts=(
2828
"AssetManager assetManager.go"
2929
"AssetStorage assetStorage.go"
3030
"Random random.go"
31-
"SchellingCoin schellingCoin.go"
31+
"RAZOR RAZOR.go"
3232
"StakeManager stakeManager.go"
3333
"StakeStorage stakeStorage.go"
3434
"VoteManager voteManager.go"

package-lock.json

+11-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"homepage": "https://github.com/ashish10677/go-cli#readme",
2121
"dependencies": {
22-
"@razor-network/contracts": "^0.1.0"
22+
"@razor-network/contracts": "^0.1.1"
2323
}
2424
}

utils/asset.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ func GetActiveJob(client *ethclient.Client, address string, jobId *big.Int) (typ
5757
assetManager := GetAssetManager(client)
5858
callOpts := GetOptions(false, address, "")
5959
epoch, err := GetEpoch(client, address)
60+
6061
if err != nil {
6162
return types.Job{}, err
6263
}
6364
job, err := assetManager.Jobs(&callOpts, jobId)
6465
if err != nil {
6566
return types.Job{}, err
6667
}
67-
if !job.Fulfilled && job.Epoch.Cmp(epoch) < 0 {
68+
if job.Active && job.Epoch.Cmp(epoch) < 0 {
6869
return job, nil
6970
}
7071
return types.Job{}, errors.New("job already fulfilled")

utils/contract-manager.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/ethereum/go-ethereum/ethclient"
1212
)
1313

14-
func GetTokenManager(client *ethclient.Client) *bindings.SchellingCoin {
15-
coinContract, err := bindings.NewSchellingCoin(common.HexToAddress(core.SchellingCoinAddress), client)
14+
func GetTokenManager(client *ethclient.Client) *bindings.RAZOR {
15+
coinContract, err := bindings.NewRAZOR(common.HexToAddress(core.RAZORAddress), client)
1616
if err != nil {
1717
log.Fatal(err)
1818
}

0 commit comments

Comments
 (0)