aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-16 00:09:44 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-16 00:09:44 +0800
commitcc0b451119478ba4a005ec8840573252636f45dc (patch)
treef1e9882b7dea20eab9cd30850224a07bb312f067 /common
parentf2a2164184a9397d8e6100c370595ccdcd00ca0b (diff)
parent2628103f1df35ad6a130f2f41e73c7703bf61886 (diff)
downloadgo-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar.gz
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar.bz2
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar.lz
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar.xz
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.tar.zst
go-tangerine-cc0b451119478ba4a005ec8840573252636f45dc.zip
Merge pull request #1260 from obscuren/tx-drop-low-tx
core: drop low gas tx
Diffstat (limited to 'common')
-rw-r--r--common/types.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/types.go b/common/types.go
index 183d48fb3..d05c21eec 100644
--- a/common/types.go
+++ b/common/types.go
@@ -1,6 +1,7 @@
package common
import (
+ "fmt"
"math/big"
"math/rand"
"reflect"
@@ -95,3 +96,13 @@ func (a *Address) Set(other Address) {
a[i] = v
}
}
+
+// PP Pretty Prints a byte slice in the following format:
+// hex(value[:4])...(hex[len(value)-4:])
+func PP(value []byte) string {
+ if len(value) <= 8 {
+ return Bytes2Hex(value)
+ }
+
+ return fmt.Sprintf("%x...%x", value[:4], value[len(value)-4])
+}