From dba2367157fc4ad7947ee1632dbe76d6a110f49f Mon Sep 17 00:00:00 2001 From: zsfelfoldi Date: Tue, 14 Apr 2015 15:20:52 +0200 Subject: NatSpec contracts are now not in the genesis block but added by the test --- common/resolver/resolver.go | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'common/resolver') diff --git a/common/resolver/resolver.go b/common/resolver/resolver.go index 2858a049d..45afb2971 100644 --- a/common/resolver/resolver.go +++ b/common/resolver/resolver.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" + xe "github.com/ethereum/go-ethereum/xeth" ) /* @@ -17,10 +17,24 @@ UrlHint : Content Hash -> Url Hint The resolver is meant to be called by the roundtripper transport implementation of a url scheme */ -const ( - URLHintContractAddress = core.ContractAddrURLhint - HashRegContractAddress = core.ContractAddrHashReg -) + +// contract addresses will be hardcoded after they're created +var URLHintContractAddress string = "0000000000000000000000000000000000000000000000000000000000001234" +var HashRegContractAddress string = "0000000000000000000000000000000000000000000000000000000000005678" + +func CreateContracts(xeth *xe.XEth, addr string) { + var err error + URLHintContractAddress, err = xeth.Transact(addr, "", "100000000000", "1000000", "100000", ContractCodeURLhint) + if err != nil { + panic(err) + } + HashRegContractAddress, err = xeth.Transact(addr, "", "100000000000", "1000000", "100000", ContractCodeHashReg) + if err != nil { + panic(err) + } + URLHintContractAddress = URLHintContractAddress[2:] + HashRegContractAddress = HashRegContractAddress[2:] +} type Resolver struct { backend Backend -- cgit v1.2.3