|
@ -5,10 +5,12 @@ import ( |
|
|
"errors" |
|
|
"errors" |
|
|
"io" |
|
|
"io" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/Godeps/_workspace/src/golang.org/x/crypto/ripemd160" |
|
|
|
|
|
|
|
|
acm "github.com/tendermint/tendermint/account" |
|
|
acm "github.com/tendermint/tendermint/account" |
|
|
"github.com/tendermint/tendermint/wire" |
|
|
|
|
|
. "github.com/tendermint/tendermint/common" |
|
|
. "github.com/tendermint/tendermint/common" |
|
|
ptypes "github.com/tendermint/tendermint/permission/types" |
|
|
ptypes "github.com/tendermint/tendermint/permission/types" |
|
|
|
|
|
"github.com/tendermint/tendermint/wire" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var ( |
|
|
var ( |
|
@ -189,6 +191,15 @@ func (tx *CallTx) String() string { |
|
|
return Fmt("CallTx{%v -> %x: %x}", tx.Input, tx.Address, tx.Data) |
|
|
return Fmt("CallTx{%v -> %x: %x}", tx.Input, tx.Address, tx.Data) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewContractAddress(caller []byte, nonce int) []byte { |
|
|
|
|
|
temp := make([]byte, 32+8) |
|
|
|
|
|
copy(temp, caller) |
|
|
|
|
|
PutInt64BE(temp[32:], int64(nonce)) |
|
|
|
|
|
hasher := ripemd160.New() |
|
|
|
|
|
hasher.Write(temp) // does not error
|
|
|
|
|
|
return hasher.Sum(nil) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
type NameTx struct { |
|
|
type NameTx struct { |
|
|