diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-09-13 15:01:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 15:01:16 +0800 |
commit | 41f4c2fd789d6b58ca076e675b2ce931aaedb37b (patch) | |
tree | 6a1c1309ef27a82e8e20c65f76268511e1bfe0df | |
parent | e9e0793a7191fb422e5458174d97c84a1f02f26a (diff) | |
download | dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar.gz dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar.bz2 dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar.lz dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar.xz dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.tar.zst dexon-consensus-41f4c2fd789d6b58ca076e675b2ce931aaedb37b.zip |
core: fix VerifyPayload argument (#103)
Since we are using a byte slice for storing payload. VerifyPayload()
should also accepts a byte slice.
-rw-r--r-- | core/interfaces.go | 2 | ||||
-rw-r--r-- | core/nonblocking-application.go | 2 | ||||
-rw-r--r-- | core/nonblocking-application_test.go | 2 | ||||
-rw-r--r-- | core/test/app.go | 2 | ||||
-rw-r--r-- | simulation/app.go | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/core/interfaces.go b/core/interfaces.go index c8f57e9..d4ace51 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -33,7 +33,7 @@ type Application interface { PreparePayload(position types.Position) []byte // VerifyPayloads verifies if the payloads are valid. - VerifyPayloads(payloads [][]byte) bool + VerifyPayloads(payloads []byte) bool // BlockConfirmed is called when a block is confirmed and added to lattice. BlockConfirmed(block *types.Block) diff --git a/core/nonblocking-application.go b/core/nonblocking-application.go index 7af12d4..cb83b17 100644 --- a/core/nonblocking-application.go +++ b/core/nonblocking-application.go @@ -127,7 +127,7 @@ func (app *nonBlockingApplication) PreparePayload( } // VerifyPayloads cannot be non-blocking. -func (app *nonBlockingApplication) VerifyPayloads(payloads [][]byte) bool { +func (app *nonBlockingApplication) VerifyPayloads(payloads []byte) bool { return app.app.VerifyPayloads(payloads) } diff --git a/core/nonblocking-application_test.go b/core/nonblocking-application_test.go index a1dd727..a969530 100644 --- a/core/nonblocking-application_test.go +++ b/core/nonblocking-application_test.go @@ -51,7 +51,7 @@ func (app *slowApp) PreparePayload(_ types.Position) []byte { return []byte{} } -func (app *slowApp) VerifyPayloads(_ [][]byte) bool { +func (app *slowApp) VerifyPayloads(_ []byte) bool { return true } diff --git a/core/test/app.go b/core/test/app.go index 76f1a10..57fc467 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -108,7 +108,7 @@ func (app *App) PreparePayload(position types.Position) []byte { } // VerifyPayloads implements Application. -func (app *App) VerifyPayloads(payloads [][]byte) bool { +func (app *App) VerifyPayloads(payloads []byte) bool { return true } diff --git a/simulation/app.go b/simulation/app.go index 719b8de..9e89516 100644 --- a/simulation/app.go +++ b/simulation/app.go @@ -64,7 +64,7 @@ func (a *simApp) BlockConfirmed(block *types.Block) { } // VerifyPayloads implements core.Application. -func (a *simApp) VerifyPayloads(payloads [][]byte) bool { +func (a *simApp) VerifyPayloads(payloads []byte) bool { return true } |