mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 03:41:34 +00:00
*: fix whitespace errors
leading/trailing newlines
This commit is contained in:
parent
6fea16451a
commit
c4e084b0d8
36 changed files with 0 additions and 36 deletions
|
@ -156,7 +156,6 @@ func parseMultisigContract(script []byte) (int, keys.PublicKeys, bool) {
|
||||||
return 0, nil, false
|
return 0, nil, false
|
||||||
}
|
}
|
||||||
ret[i] = pub
|
ret[i] = pub
|
||||||
|
|
||||||
}
|
}
|
||||||
return nsigs, ret, true
|
return nsigs, ret, true
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,6 @@ func TestParseMultisigContract(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fromHex(t *testing.T, s string) []byte {
|
func fromHex(t *testing.T, s string) []byte {
|
||||||
|
|
|
@ -226,7 +226,6 @@ func getNEP11Balance(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
fmt.Fprintf(ctx.App.Writer, format, formatArgs...)
|
fmt.Fprintf(ctx.App.Writer, format, formatArgs...)
|
||||||
fmt.Fprintf(ctx.App.Writer, "\tAmount : %s\n", amountStr)
|
fmt.Fprintf(ctx.App.Writer, "\tAmount : %s\n", amountStr)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ func NewDeployTx(bc blockchainer.Blockchainer, name string, sender util.Uint160,
|
||||||
o.ContractEvents = conf.Events
|
o.ContractEvents = conf.Events
|
||||||
o.ContractSupportedStandards = conf.SupportedStandards
|
o.ContractSupportedStandards = conf.SupportedStandards
|
||||||
o.SafeMethods = conf.SafeMethods
|
o.SafeMethods = conf.SafeMethods
|
||||||
|
|
||||||
}
|
}
|
||||||
m, err := compiler.CreateManifest(di, o)
|
m, err := compiler.CreateManifest(di, o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -473,7 +473,6 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
switch n := node.(type) {
|
switch n := node.(type) {
|
||||||
|
|
||||||
// General declarations.
|
// General declarations.
|
||||||
// var (
|
// var (
|
||||||
// x = 2
|
// x = 2
|
||||||
|
|
|
@ -109,7 +109,6 @@ func newStoragePlugin() *storagePlugin {
|
||||||
s.interops[interopnames.ToID([]byte(interopnames.SystemRuntimeNotify))] = s.Notify
|
s.interops[interopnames.ToID([]byte(interopnames.SystemRuntimeNotify))] = s.Notify
|
||||||
s.interops[interopnames.ToID([]byte(interopnames.SystemRuntimeGetTime))] = s.GetTime
|
s.interops[interopnames.ToID([]byte(interopnames.SystemRuntimeGetTime))] = s.GetTime
|
||||||
return s
|
return s
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *storagePlugin) syscallHandler(v *vm.VM, id uint32) error {
|
func (s *storagePlugin) syscallHandler(v *vm.VM, id uint32) error {
|
||||||
|
|
|
@ -309,7 +309,6 @@ events:
|
||||||
s.handleChainBlock(b)
|
s.handleChainBlock(b)
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
close(s.finished)
|
close(s.finished)
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,6 @@ func TestBlockEncodeDecode(t *testing.T) {
|
||||||
|
|
||||||
func TestGetExpectedBlockSize(t *testing.T) {
|
func TestGetExpectedBlockSize(t *testing.T) {
|
||||||
check := func(t *testing.T, stateRootEnabled bool) {
|
check := func(t *testing.T, stateRootEnabled bool) {
|
||||||
|
|
||||||
t.Run("without transactions", func(t *testing.T) {
|
t.Run("without transactions", func(t *testing.T) {
|
||||||
b := newDumbBlock()
|
b := newDumbBlock()
|
||||||
b.StateRootEnabled = stateRootEnabled
|
b.StateRootEnabled = stateRootEnabled
|
||||||
|
|
|
@ -1600,7 +1600,6 @@ func (bc *Blockchain) IsTxStillRelevant(t *transaction.Transaction, txpool *memp
|
||||||
return bc.verifyTxWitnesses(t, nil, isPartialTx) == nil
|
return bc.verifyTxWitnesses(t, nil, isPartialTx) == nil
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyTx verifies whether transaction is bonafide or not relative to the
|
// VerifyTx verifies whether transaction is bonafide or not relative to the
|
||||||
|
|
|
@ -1529,7 +1529,6 @@ func testDumpAndRestore(t *testing.T, dumpF, restoreF func(c *config.Config)) {
|
||||||
require.Equal(t, bc.BlockHeight()-1, lastIndex)
|
require.Equal(t, bc.BlockHeight()-1, lastIndex)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDumpAndRestore(t *testing.T) {
|
func TestDumpAndRestore(t *testing.T) {
|
||||||
|
|
|
@ -208,7 +208,6 @@ func (t *Trie) newSubTrieMany(prefix []byte, kv []keyValue, value []byte) (Node,
|
||||||
if len(kv[0].value) == 0 {
|
if len(kv[0].value) == 0 {
|
||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
return new(HashNode), 1, nil
|
return new(HashNode), 1, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
node, n, err := t.newSubTrieMany(prefix, kv[1:], nil)
|
node, n, err := t.newSubTrieMany(prefix, kv[1:], nil)
|
||||||
return node, n + 1, err
|
return node, n + 1, err
|
||||||
|
|
|
@ -539,7 +539,6 @@ func (m *Management) getNextContractID(d dao.DAO) (int32, error) {
|
||||||
si := d.GetStorageItem(m.ID, keyNextAvailableID)
|
si := d.GetStorageItem(m.ID, keyNextAvailableID)
|
||||||
if si == nil {
|
if si == nil {
|
||||||
return 0, errors.New("nextAvailableID is not initialized")
|
return 0, errors.New("nextAvailableID is not initialized")
|
||||||
|
|
||||||
}
|
}
|
||||||
id := bigint.FromBytes(si)
|
id := bigint.FromBytes(si)
|
||||||
ret := int32(id.Int64())
|
ret := int32(id.Int64())
|
||||||
|
|
|
@ -626,7 +626,6 @@ func domainFromString(name string) (string, bool) {
|
||||||
return name, true
|
return name, true
|
||||||
}
|
}
|
||||||
return name[i+1:], true
|
return name[i+1:], true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func toDomain(name string) string {
|
func toDomain(name string) string {
|
||||||
|
|
|
@ -337,7 +337,6 @@ func (n *NEO) PostPersist(ic *interop.Context) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if n.gasPerBlockChanged.Load().(bool) {
|
if n.gasPerBlockChanged.Load().(bool) {
|
||||||
gr, err := n.getSortedGASRecordFromDAO(ic.DAO)
|
gr, err := n.getSortedGASRecordFromDAO(ic.DAO)
|
||||||
|
|
|
@ -42,7 +42,6 @@ func getIntWithKey(id int32, dao dao.DAO, key []byte) int64 {
|
||||||
si := dao.GetStorageItem(id, key)
|
si := dao.GetStorageItem(id, key)
|
||||||
if si == nil {
|
if si == nil {
|
||||||
panic(fmt.Errorf("item with id = %d and key = %s is not initialized", id, hex.EncodeToString(key)))
|
panic(fmt.Errorf("item with id = %d and key = %s is not initialized", id, hex.EncodeToString(key)))
|
||||||
|
|
||||||
}
|
}
|
||||||
return bigint.FromBytes(si).Int64()
|
return bigint.FromBytes(si).Int64()
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,6 @@ func TestDesignate_DesignateAsRoleTx(t *testing.T) {
|
||||||
bc.setNodesByRole(t, true, noderoles.NeoFSAlphabet, pubs)
|
bc.setNodesByRole(t, true, noderoles.NeoFSAlphabet, pubs)
|
||||||
bc.getNodesByRole(t, true, noderoles.NeoFSAlphabet, bc.BlockHeight()+1, 1)
|
bc.getNodesByRole(t, true, noderoles.NeoFSAlphabet, bc.BlockHeight()+1, 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDesignate_DesignateAsRole(t *testing.T) {
|
func TestDesignate_DesignateAsRole(t *testing.T) {
|
||||||
|
|
|
@ -577,7 +577,6 @@ func TestContractDestroy(t *testing.T) {
|
||||||
t.Run("check contract", func(t *testing.T) {
|
t.Run("check contract", func(t *testing.T) {
|
||||||
checkContractState(t, bc, cs1.Hash, nil)
|
checkContractState(t, bc, cs1.Hash, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,6 @@ func TestExpiration(t *testing.T) {
|
||||||
aer, err = bc.GetAppExecResults(tx.Hash(), trigger.Application)
|
aer, err = bc.GetAppExecResults(tx.Hash(), trigger.Application)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
checkResult(t, &aer[0], stackitem.Null{})
|
checkResult(t, &aer[0], stackitem.Null{})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const secondsInYear = 365 * 24 * 3600
|
const secondsInYear = 365 * 24 * 3600
|
||||||
|
|
|
@ -226,7 +226,6 @@ func TestNEO_CalculateBonus(t *testing.T) {
|
||||||
res, err := neo.CalculateNEOHolderReward(ic.DAO, big.NewInt(100), 5, 15)
|
res, err := neo.CalculateNEOHolderReward(ic.DAO, big.NewInt(100), 5, 15)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.EqualValues(t, (100*5*5/10)+(100*5*1/10), res.Int64())
|
require.EqualValues(t, (100*5*5/10)+(100*5*1/10), res.Int64())
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,6 @@ func TestMarshalUnmarshalJSONNotificationEvent(t *testing.T) {
|
||||||
err := json.Unmarshal([]byte(errCase), new(NotificationEvent))
|
err := json.Unmarshal([]byte(errCase), new(NotificationEvent))
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,5 +76,4 @@ func TestOracleRequest_EncodeBinary(t *testing.T) {
|
||||||
t.Run("Method", runInvalid(5, stackitem.NewMap()))
|
t.Run("Method", runInvalid(5, stackitem.NewMap()))
|
||||||
t.Run("UserData", runInvalid(6, stackitem.NewMap()))
|
t.Run("UserData", runInvalid(6, stackitem.NewMap()))
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
|
|
||||||
func TestNEP2Encrypt(t *testing.T) {
|
func TestNEP2Encrypt(t *testing.T) {
|
||||||
for _, testCase := range keytestcases.Arr {
|
for _, testCase := range keytestcases.Arr {
|
||||||
|
|
||||||
privKey, err := NewPrivateKeyFromHex(testCase.PrivateKey)
|
privKey, err := NewPrivateKeyFromHex(testCase.PrivateKey)
|
||||||
if testCase.Invalid {
|
if testCase.Invalid {
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
|
|
|
@ -161,7 +161,6 @@ func (p *PublicKey) getBytes(compressed bool) []byte {
|
||||||
prefix = 0x04
|
prefix = 0x04
|
||||||
yBytes := p.Y.Bytes()
|
yBytes := p.Y.Bytes()
|
||||||
copy(res[1+coordLen+coordLen-len(yBytes):], yBytes)
|
copy(res[1+coordLen+coordLen-len(yBytes):], yBytes)
|
||||||
|
|
||||||
}
|
}
|
||||||
res[0] = prefix
|
res[0] = prefix
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ func TestFixed8Add(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFixed8Sub(t *testing.T) {
|
func TestFixed8Sub(t *testing.T) {
|
||||||
|
|
||||||
a := Fixed8FromInt64(42)
|
a := Fixed8FromInt64(42)
|
||||||
b := Fixed8FromInt64(34)
|
b := Fixed8FromInt64(34)
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,6 @@ func (w *BinWriter) WriteVarUint(val uint64) {
|
||||||
w.WriteB(byte(0xfe))
|
w.WriteB(byte(0xfe))
|
||||||
w.WriteU32LE(uint32(val))
|
w.WriteU32LE(uint32(val))
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteB(byte(0xff))
|
w.WriteB(byte(0xff))
|
||||||
|
|
|
@ -34,7 +34,6 @@ func (p *GetBlocks) DecodeBinary(br *io.BinReader) {
|
||||||
if p.Count < -1 || p.Count == 0 {
|
if p.Count < -1 || p.Count == 0 {
|
||||||
br.Err = errors.New("invalid count")
|
br.Err = errors.New("invalid count")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncodeBinary implements Serializable interface.
|
// EncodeBinary implements Serializable interface.
|
||||||
|
|
|
@ -409,7 +409,6 @@ func (s *Server) run() {
|
||||||
// because we have two goroutines sending signals here
|
// because we have two goroutines sending signals here
|
||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,6 @@ func TestServerRegisterPeer(t *testing.T) {
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}, time.Second, time.Millisecond*50)
|
}, time.Second, time.Millisecond*50)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetBlocksByIndex(t *testing.T) {
|
func TestGetBlocksByIndex(t *testing.T) {
|
||||||
|
|
|
@ -209,7 +209,6 @@ func (c *WSClient) wsWriter() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *WSClient) makeWsRequest(r *request.Raw) (*response.Raw, error) {
|
func (c *WSClient) makeWsRequest(r *request.Raw) (*response.Raw, error) {
|
||||||
|
|
|
@ -44,7 +44,6 @@ func NewError(code int64, httpCode int, message string, data string, cause error
|
||||||
Message: message,
|
Message: message,
|
||||||
Data: data,
|
Data: data,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewParseError creates a new error with code
|
// NewParseError creates a new error with code
|
||||||
|
|
|
@ -421,7 +421,6 @@ requestloop:
|
||||||
break requestloop
|
break requestloop
|
||||||
case resChan <- res:
|
case resChan <- res:
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
s.subsLock.Lock()
|
s.subsLock.Lock()
|
||||||
delete(s.subscribers, subscr)
|
delete(s.subscribers, subscr)
|
||||||
|
|
|
@ -1261,7 +1261,6 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
|
||||||
tc.check(t, e, res)
|
tc.check(t, e, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -311,7 +311,6 @@ func TestFilteredBlockSubscriptions(t *testing.T) {
|
||||||
rmap := resp.Payload[0].(map[string]interface{})
|
rmap := resp.Payload[0].(map[string]interface{})
|
||||||
primary := rmap["primary"].(float64)
|
primary := rmap["primary"].(float64)
|
||||||
require.Equal(t, 3, int(primary))
|
require.Equal(t, 3, int(primary))
|
||||||
|
|
||||||
}
|
}
|
||||||
callUnsubscribe(t, c, respMsgs, blockSubID)
|
callUnsubscribe(t, c, respMsgs, blockSubID)
|
||||||
finishedFlag.CAS(false, true)
|
finishedFlag.CAS(false, true)
|
||||||
|
|
|
@ -78,7 +78,6 @@ func TestParseNeoFSURL(t *testing.T) {
|
||||||
require.Equal(t, tc.params, ps)
|
require.Equal(t, tc.params, ps)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ func (t *incompleteTx) addResponse(pub *keys.PublicKey, sig []byte, isBackup boo
|
||||||
ok: tx != nil,
|
ok: tx != nil,
|
||||||
sig: sig,
|
sig: sig,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// finalize checks is either main or backup tx has sufficient number of signatures and returns
|
// finalize checks is either main or backup tx has sufficient number of signatures and returns
|
||||||
|
|
|
@ -753,7 +753,6 @@ func TestArithNullArg(t *testing.T) {
|
||||||
runWithArgs(t, prog, false, 0, stackitem.Null{})
|
runWithArgs(t, prog, false, 0, stackitem.Null{})
|
||||||
runWithArgs(t, prog, nil, stackitem.NewInterop(nil), 1) // also has `.Value() == nil`
|
runWithArgs(t, prog, nil, stackitem.NewInterop(nil), 1) // also has `.Value() == nil`
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue