From ba2b9c8a1bb1876b6eb4c9783fde798b19de4418 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 24 May 2023 08:32:08 -0400 Subject: init --- node/stack.go | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 node/stack.go (limited to 'node/stack.go') diff --git a/node/stack.go b/node/stack.go deleted file mode 100644 index a5460a7..0000000 --- a/node/stack.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "log" - - "github.com/holiman/uint256" -) - -const STACK_CAP = (1 << 10) - -type Stack []uint256.Int - -func NewStack() *Stack { - return &Stack{} -} - -func (s *Stack) Push(x *uint256.Int) { - *s = append(*s, *x) - if len(*s) > STACK_CAP { - log.Fatal("stack overflow") - } -} - -func (s *Stack) Pop() *uint256.Int { - if len(*s) <= 0 { - log.Fatal("stack underflow") - } - - r := (*s)[len(*s)-1] - *s = (*s)[:len(*s)-1] - return &r -} -- cgit v1.2.3