Skip to content

Commit

Permalink
Update NPM dependencies.
Browse files Browse the repository at this point in the history
Use the actual 1.0.0 (deployed on Polygon) contracts for XayaAccounts
and switch to @truffle/contract instead of the deprecated truffle-contract.
Both changes together required some tweaks in the other parts of the code,
such as deploying also NftMetadata on the Ganache environment.
  • Loading branch information
domob1812 committed Jul 20, 2022
1 parent 1ac1bba commit 61702b3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions eth/solidity/test/movetracking.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2021 Autonomous Worlds Ltd
// Copyright (C) 2021-2022 Autonomous Worlds Ltd

const truffleAssert = require ("truffle-assertions");
const truffleContract = require ("truffle-contract");
const truffleContract = require ("@truffle/contract");
const { time } = require ("@openzeppelin/test-helpers");

/* We want to use chai-subset for checking the MoveData structs easily,
Expand Down
3 changes: 2 additions & 1 deletion eth/solidity/truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
version: "^0.8.4",
settings: {
optimizer: {
enabled: false
enabled: true,
runs: 100
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"chai": "",
"chai-subset": "",
"truffle-assertions": "",
"truffle-contract": "",
"@openzeppelin/test-helpers": "",
"@truffle/contract": "",
"@xaya/wchi": "1.0.0",
"@xaya/eth-account-registry": "0.1.2"
"@xaya/eth-account-registry": "1.0.0"
}
}
1 change: 1 addition & 0 deletions xayax/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
WCHI_CONTRACTS = WCHI.json
ACCOUNTS_CONTRACTS = \
NftMetadata.json \
XayaAccounts.json \
XayaPolicy.json
CONTRACTS = $(WCHI_CONTRACTS) $(ACCOUNTS_CONTRACTS)
Expand Down
6 changes: 5 additions & 1 deletion xayax/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,17 @@ class XayaDeployment:
wchi = None
registry = None
policy = None
metadata = None

res = XayaDeployment ()
res.account = self.w3.eth.accounts[0]

res.wchi = self.deployContract (res.account, loadJsonData ("WCHI.json"))
res.metadata = self.deployContract (res.account,
loadJsonData ("NftMetadata.json"))
res.policy = self.deployContract (
res.account, loadJsonData ("XayaPolicy.json"), 100_0000)
res.account, loadJsonData ("XayaPolicy.json"),
res.metadata.address, 100_0000)
res.registry = self.deployContract (
res.account, loadJsonData ("XayaAccounts.json"),
res.wchi.address, res.policy.address)
Expand Down

0 comments on commit 61702b3

Please sign in to comment.