AppendTx -> DeliverTx

This commit is contained in:
Ethan Buchman
2017-01-12 15:27:08 -05:00
parent 2e414ebe6b
commit 80f377135b
28 changed files with 168 additions and 168 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ func (app *DummyApplication) SetOption(key string, value string) (log string) {
}
// tx is either "key=value" or just arbitrary bytes
func (app *DummyApplication) AppendTx(tx []byte) types.Result {
func (app *DummyApplication) DeliverTx(tx []byte) types.Result {
parts := strings.Split(string(tx), "=")
if len(parts) == 2 {
app.state.Set([]byte(parts[0]), []byte(parts[1]))
+3 -3
View File
@@ -13,10 +13,10 @@ import (
)
func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) {
if r := dummy.AppendTx(tx); r.IsErr() {
if r := dummy.DeliverTx(tx); r.IsErr() {
t.Fatal(r)
}
if r := dummy.AppendTx(tx); r.IsErr() {
if r := dummy.DeliverTx(tx); r.IsErr() {
t.Fatal(r)
}
@@ -175,7 +175,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [
dummyChain := dummy.(types.BlockchainAware) // hmm...
dummyChain.BeginBlock(hash, header)
for _, tx := range txs {
if r := dummy.AppendTx(tx); r.IsErr() {
if r := dummy.DeliverTx(tx); r.IsErr() {
t.Fatal(r)
}
}
+2 -2
View File
@@ -59,7 +59,7 @@ func (app *PersistentDummyApplication) SetOption(key string, value string) (log
}
// tx is either "key=value" or just arbitrary bytes
func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result {
func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.Result {
// if it starts with "val:", update the validator set
// format is "val:pubkey/power"
if isValidatorTx(tx) {
@@ -69,7 +69,7 @@ func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result {
}
// otherwise, update the key-value store
return app.app.AppendTx(tx)
return app.app.DeliverTx(tx)
}
func (app *PersistentDummyApplication) CheckTx(tx []byte) types.Result {