mirror of
https://github.com/status-im/op-geth.git
synced 2025-01-23 13:09:40 +00:00
ac0e5e8b6d
- add resolver tests and fix resolver to pass - statereg constructor fixed - comments added to natspec plus docserver integration for natspec userdoc fetching
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package natspec
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/xeth"
|
|
)
|
|
|
|
type StateReg struct {
|
|
xeth *xeth.XEth
|
|
caURL, caNatSpec string //contract addresses
|
|
}
|
|
|
|
func NewStateReg(xeth *xeth.XEth) (self *StateReg) {
|
|
self = &StateReg{}
|
|
self.xeth = xeth
|
|
self.testCreateContracts()
|
|
return
|
|
|
|
}
|
|
|
|
const codeURLhint = "0x33600081905550609c8060136000396000f30060003560e060020a900480632f926732" +
|
|
"14601f578063f39ec1f714603157005b602b6004356024356044565b60006000f35b603a" +
|
|
"600435607f565b8060005260206000f35b600054600160a060020a031633600160a06002" +
|
|
"0a031614606257607b565b8060016000848152602001908152602001600020819055505b" +
|
|
"5050565b60006001600083815260200190815260200160002054905091905056"
|
|
|
|
const codeNatSpec = "0x33600081905550609c8060136000396000f30060003560e060020a900480632f926732" +
|
|
"14601f578063f39ec1f714603157005b602b6004356024356044565b60006000f35b603a" +
|
|
"600435607f565b8060005260206000f35b600054600160a060020a031633600160a06002" +
|
|
"0a031614606257607b565b8060016000848152602001908152602001600020819055505b" +
|
|
"5050565b60006001600083815260200190815260200160002054905091905056"
|
|
|
|
func (self *StateReg) testCreateContracts() {
|
|
|
|
var err error
|
|
self.caURL, err = self.xeth.Transact(self.xeth.Coinbase(), "", "100000", "", self.xeth.DefaultGas().String(), codeURLhint)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
self.caNatSpec, err = self.xeth.Transact(self.xeth.Coinbase(), "", "100000", "", self.xeth.DefaultGas().String(), codeNatSpec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
}
|