good morning!!!!

Skip to content
Snippets Groups Projects
Commit 0f84b9c3 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Added exist method

parent 342cc122
Branches
Tags
No related merge requests found
...@@ -75,6 +75,10 @@ func (self *Pipe) ToAddress(priv []byte) []byte { ...@@ -75,6 +75,10 @@ func (self *Pipe) ToAddress(priv []byte) []byte {
return pair.Address() return pair.Address()
} }
func (self *Pipe) Exists(addr []byte) bool {
return self.World().Get(addr) != nil
}
func (self *Pipe) TransactString(key *ethcrypto.KeyPair, rec string, value, gas, price *ethutil.Value, data []byte) error { func (self *Pipe) TransactString(key *ethcrypto.KeyPair, rec string, value, gas, price *ethutil.Value, data []byte) error {
// Check if an address is stored by this address // Check if an address is stored by this address
var hash []byte var hash []byte
......
...@@ -34,6 +34,7 @@ func TestNew(t *testing.T) { ...@@ -34,6 +34,7 @@ func TestNew(t *testing.T) {
pipe.Block(addr) pipe.Block(addr)
pipe.Storage(addr, addr) pipe.Storage(addr, addr)
pipe.ToAddress(privy) pipe.ToAddress(privy)
pipe.Exists(addr)
// Doesn't change state // Doesn't change state
pipe.Execute(addr, nil, Val(0), Val(1000000), Val(10)) pipe.Execute(addr, nil, Val(0), Val(1000000), Val(10))
// Doesn't change state // Doesn't change state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment