forked from cerc-io/plugeth
Format code as hexdata
This commit is contained in:
parent
b86450aaae
commit
81de8ed091
@ -146,7 +146,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
|
||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||
return err
|
||||
}
|
||||
*reply = api.xethAtStateNum(args.BlockNumber).CodeAt(args.Address)
|
||||
v := api.xethAtStateNum(args.BlockNumber).CodeAtBytes(args.Address)
|
||||
*reply = newHexData(v)
|
||||
case "eth_sendTransaction", "eth_transact":
|
||||
args := new(NewTxArgs)
|
||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||
|
@ -325,6 +325,10 @@ func (self *XEth) CodeAt(address string) string {
|
||||
return common.ToHex(self.State().SafeGet(address).Code())
|
||||
}
|
||||
|
||||
func (self *XEth) CodeAtBytes(address string) []byte {
|
||||
return self.State().SafeGet(address).Code()
|
||||
}
|
||||
|
||||
func (self *XEth) IsContract(address string) bool {
|
||||
return len(self.State().SafeGet(address).Code()) > 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user