From 1a9ada48972770971ac5f1cd6810da445236eda4 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 29 Jul 2017 18:24:47 -0700 Subject: [PATCH] lnwallet: move stateHintTests global var into TestCommitTxStateHint --- lnwallet/script_utils_test.go | 68 ++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lnwallet/script_utils_test.go b/lnwallet/script_utils_test.go index e5d360d0..d954ea35 100644 --- a/lnwallet/script_utils_test.go +++ b/lnwallet/script_utils_test.go @@ -573,44 +573,46 @@ func TestHTLCReceiverSpendValidation(t *testing.T) { } } -var stateHintTests = []struct { - name string - from uint64 - to uint64 - inputs int - shouldFail bool -}{ - { - name: "states 0 to 1000", - from: 0, - to: 1000, - inputs: 1, - shouldFail: false, - }, - { - name: "states 'maxStateHint-1000' to 'maxStateHint'", - from: maxStateHint - 1000, - to: maxStateHint, - inputs: 1, - shouldFail: false, - }, - { - name: "state 'maxStateHint+1'", - from: maxStateHint + 1, - to: maxStateHint + 10, - inputs: 1, - shouldFail: true, - }, - { - name: "commit transaction with two inputs", - inputs: 2, - shouldFail: true, - }, } func TestCommitTxStateHint(t *testing.T) { t.Parallel() + stateHintTests := []struct { + name string + from uint64 + to uint64 + inputs int + shouldFail bool + }{ + { + name: "states 0 to 1000", + from: 0, + to: 1000, + inputs: 1, + shouldFail: false, + }, + { + name: "states 'maxStateHint-1000' to 'maxStateHint'", + from: maxStateHint - 1000, + to: maxStateHint, + inputs: 1, + shouldFail: false, + }, + { + name: "state 'maxStateHint+1'", + from: maxStateHint + 1, + to: maxStateHint + 10, + inputs: 1, + shouldFail: true, + }, + { + name: "commit transaction with two inputs", + inputs: 2, + shouldFail: true, + }, + } + var obsfucator [StateHintSize]byte copy(obsfucator[:], testHdSeed[:StateHintSize]) timeYesterday := uint32(time.Now().Unix() - 24*60*60)