mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
namereg rpc and tests
This commit is contained in:
@ -120,6 +120,13 @@ func makeDefaultCallTx(t *testing.T, typ string, addr, code []byte, amt, gasLim,
|
||||
return tx
|
||||
}
|
||||
|
||||
func makeDefaultNameTx(t *testing.T, typ string, name, value []byte, amt, fee uint64) *types.NameTx {
|
||||
nonce := getNonce(t, typ, user[0].Address)
|
||||
tx := types.NewNameTxWithNonce(user[0].PubKey, name, value, amt, fee, nonce)
|
||||
tx.Sign(user[0])
|
||||
return tx
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// rpc call wrappers (fail on err)
|
||||
|
||||
@ -210,6 +217,16 @@ func callContract(t *testing.T, client cclient.Client, address, data, expected [
|
||||
}
|
||||
}
|
||||
|
||||
// get the namereg entry
|
||||
func getNameRegEntry(t *testing.T, typ string, name []byte) *types.NameRegEntry {
|
||||
client := clients[typ]
|
||||
r, err := client.NameRegEntry(name)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return r.Entry
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// utility verification function
|
||||
|
||||
|
Reference in New Issue
Block a user