diff --git a/pkg/compiler/codegen.go b/pkg/compiler/codegen.go index 6bb8b2c62..f80311da5 100644 --- a/pkg/compiler/codegen.go +++ b/pkg/compiler/codegen.go @@ -1521,33 +1521,6 @@ func getJumpForToken(tok token.Token, typ types.Type) (opcode.Opcode, bool) { return 0, false } -// getByteArray returns byte array value from constant expr. -// Only literals are supported. -func (c *codegen) getByteArray(expr ast.Expr) []byte { - switch t := expr.(type) { - case *ast.CompositeLit: - if !isByteSlice(c.typeOf(t.Type)) { - return nil - } - buf := make([]byte, len(t.Elts)) - for i := 0; i < len(t.Elts); i++ { - t := c.typeAndValueOf(t.Elts[i]) - val, _ := constant.Int64Val(t.Value) - buf[i] = byte(val) - } - return buf - case *ast.CallExpr: - if tv := c.typeAndValueOf(t.Args[0]); tv.Value != nil { - val := constant.StringVal(tv.Value) - return []byte(val) - } - - return nil - default: - return nil - } -} - func (c *codegen) convertSyscall(f *funcScope, expr *ast.CallExpr) { for _, arg := range expr.Args[1:] { ast.Walk(c, arg) diff --git a/pkg/core/mpt/batch_test.go b/pkg/core/mpt/batch_test.go index eebc21caa..dffb4b9ae 100644 --- a/pkg/core/mpt/batch_test.go +++ b/pkg/core/mpt/batch_test.go @@ -277,6 +277,8 @@ func TestTrie_PutBatch(t *testing.T) { testPut(t, ps, tr1, tr2) } +var _ = printNode + // This function is unused, but is helpful for debugging // as it provides more readable Trie representation compared to // `spew.Dump()` diff --git a/pkg/core/native/name_service.go b/pkg/core/native/name_service.go index b2a950699..0044624d3 100644 --- a/pkg/core/native/name_service.go +++ b/pkg/core/native/name_service.go @@ -711,17 +711,6 @@ func (sl stringList) index(s string) (int, bool) { return index, index < len(sl) && sl[index] == s } -func (sl *stringList) remove(s string) bool { - index, has := sl.index(s) - if !has { - return false - } - - copy((*sl)[index:], (*sl)[index+1:]) - *sl = (*sl)[:len(*sl)-1] - return true -} - func (sl *stringList) add(s string) bool { index, has := sl.index(s) if has { diff --git a/pkg/core/native/nonfungible.go b/pkg/core/native/nonfungible.go index 03cd67ef7..4288824f7 100644 --- a/pkg/core/native/nonfungible.go +++ b/pkg/core/native/nonfungible.go @@ -305,6 +305,8 @@ func (n *nonfungible) postTransfer(ic *interop.Context, from, to *util.Uint160, } } +var _ = (*nonfungible).burn // fix unused warning + func (n *nonfungible) burn(ic *interop.Context, tokenID []byte) { key := n.getTokenKey(tokenID) n.burnByKey(ic, key) diff --git a/pkg/services/oracle/transaction.go b/pkg/services/oracle/transaction.go index 6e38b8416..b76552f28 100644 --- a/pkg/services/oracle/transaction.go +++ b/pkg/services/oracle/transaction.go @@ -117,15 +117,3 @@ func finalizeTx(oracleNodes keys.PublicKeys, tx *transaction.Transaction, txSigs tx.Scripts[1].InvocationScript = w.Bytes() return true } - -func (t *incompleteTx) getRequest() *state.OracleRequest { - t.RLock() - defer t.RUnlock() - return t.request -} - -func (t *incompleteTx) getTime() time.Time { - t.RLock() - defer t.RUnlock() - return t.time -}