Rename `config` to `configuration`

There was a symbol clash preventing compilation and it was easiest to rename `config` to `configuration` in the contracts. Not even remotely ideal, but it was the only way.
This commit is contained in:
Eric 2024-10-29 09:49:09 +11:00
parent 4a4880f8b7
commit f917100268
No known key found for this signature in database
4 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ proc approveFunds(market: OnChainMarket, amount: UInt256) {.async.} =
discard await token.increaseAllowance(market.contract.address(), amount).confirm(0) discard await token.increaseAllowance(market.contract.address(), amount).confirm(0)
method getZkeyHash*(market: OnChainMarket): Future[?string] {.async.} = method getZkeyHash*(market: OnChainMarket): Future[?string] {.async.} =
let config = await market.contract.config() let config = await market.contract.configuration()
return some config.proofs.zkeyHash return some config.proofs.zkeyHash
method getSigner*(market: OnChainMarket): Future[Address] {.async.} = method getSigner*(market: OnChainMarket): Future[Address] {.async.} =
@ -65,18 +65,18 @@ method getSigner*(market: OnChainMarket): Future[Address] {.async.} =
method periodicity*(market: OnChainMarket): Future[Periodicity] {.async.} = method periodicity*(market: OnChainMarket): Future[Periodicity] {.async.} =
convertEthersError: convertEthersError:
let config = await market.contract.config() let config = await market.contract.configuration()
let period = config.proofs.period let period = config.proofs.period
return Periodicity(seconds: period) return Periodicity(seconds: period)
method proofTimeout*(market: OnChainMarket): Future[UInt256] {.async.} = method proofTimeout*(market: OnChainMarket): Future[UInt256] {.async.} =
convertEthersError: convertEthersError:
let config = await market.contract.config() let config = await market.contract.configuration()
return config.proofs.timeout return config.proofs.timeout
method proofDowntime*(market: OnChainMarket): Future[uint8] {.async.} = method proofDowntime*(market: OnChainMarket): Future[uint8] {.async.} =
convertEthersError: convertEthersError:
let config = await market.contract.config() let config = await market.contract.configuration()
return config.proofs.downtime return config.proofs.downtime
method getPointer*(market: OnChainMarket, slotId: SlotId): Future[uint8] {.async.} = method getPointer*(market: OnChainMarket, slotId: SlotId): Future[uint8] {.async.} =

View File

@ -17,7 +17,7 @@ export requests
type type
Marketplace* = ref object of Contract Marketplace* = ref object of Contract
proc config*(marketplace: Marketplace): MarketplaceConfig {.contract, view.} proc configuration*(marketplace: Marketplace): MarketplaceConfig {.contract, view.}
proc token*(marketplace: Marketplace): Address {.contract, view.} proc token*(marketplace: Marketplace): Address {.contract, view.}
proc slashMisses*(marketplace: Marketplace): UInt256 {.contract, view.} proc slashMisses*(marketplace: Marketplace): UInt256 {.contract, view.}
proc slashPercentage*(marketplace: Marketplace): UInt256 {.contract, view.} proc slashPercentage*(marketplace: Marketplace): UInt256 {.contract, view.}

View File

@ -1,5 +1,5 @@
import pkg/chronos import pkg/chronos
import pkg/ethers/erc20 import pkg/ethers
from pkg/libp2p import Cid from pkg/libp2p import Cid
import pkg/codex/contracts/marketplace as mp import pkg/codex/contracts/marketplace as mp
import pkg/codex/periods import pkg/codex/periods
@ -85,7 +85,7 @@ template marketplacesuite*(name: string, body: untyped) =
marketplace = Marketplace.new(Marketplace.address, ethProvider.getSigner()) marketplace = Marketplace.new(Marketplace.address, ethProvider.getSigner())
let tokenAddress = await marketplace.token() let tokenAddress = await marketplace.token()
token = Erc20Token.new(tokenAddress, ethProvider.getSigner()) token = Erc20Token.new(tokenAddress, ethProvider.getSigner())
let config = await mp.config(marketplace) let config = await marketplace.configuration()
period = config.proofs.period.truncate(uint64) period = config.proofs.period.truncate(uint64)
periodicity = Periodicity(seconds: period.u256) periodicity = Periodicity(seconds: period.u256)

@ -1 +1 @@
Subproject commit 997696a20e0976011cdbc2f0ff3a844672056ba2 Subproject commit 0586425980ae56dd438aaa8963acd0ec185c2e83