// Copyright 2016 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . package abi import ( "reflect" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" ) // packBytesSlice packs the given bytes as [L, V] as the canonical representation // bytes slice func packBytesSlice(bytes []byte, l int) []byte { len := packNum(reflect.ValueOf(l)) return append(len, common.RightPadBytes(bytes, (l+31)/32*32)...) } // packElement packs the given reflect value according to the abi specification in // t. func packElement(t Type, reflectValue reflect.Value) []byte { switch t.T { case IntTy, UintTy: return packNum(reflectValue) case StringTy: return packBytesSlice([]byte(reflectValue.String()), reflectValue.Len()) case AddressTy: if reflectValue.Kind() == reflect.Array { reflectValue = mustArrayToByteSlice(reflectValue) } return common.LeftPadBytes(reflectValue.Bytes(), 32) case BoolTy: if reflectValue.Bool() { return math.PaddedBigBytes(common.Big1, 32) } else { return math.PaddedBigBytes(common.Big0, 32) } case BytesTy: if reflectValue.Kind() == reflect.Array { reflectValue = mustArrayToByteSlice(reflectValue) } return packBytesSlice(reflectValue.Bytes(), reflectValue.Len()) case FixedBytesTy, FunctionTy: if reflectValue.Kind() == reflect.Array { reflectValue = mustArrayToByteSlice(reflectValue) } return common.RightPadBytes(reflectValue.Bytes(), 32) } panic("abi: fatal error") } abot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/devel/rubygem-fattr
Commit message (Expand)AuthorAgeFilesLines
* Remove # $FreeBSD$ from Makefiles.Mathieu Arnold2021-04-061-1/+0
* Update to 2.4.0Sunpoet Po-Chuan Hsieh2018-03-042-3/+4
* Convert USES=gem:autoplist to USES=gem since autoplist is defaultSteve Wills2016-04-281-1/+1
* create USES=gem and update rubygem- ports to use itSteve Wills2016-04-281-2/+1
* - Update to 2.3.0Sunpoet Po-Chuan Hsieh2016-03-312-4/+3
* Set NO_ARCH for remaining rubygem-* ports with no arch dependent filesPhilip M. Gollucci2015-07-031-0/+2
* - Add LICENSESunpoet Po-Chuan Hsieh2015-05-312-1/+4
* devel/rubygem-fattr: update to 2.2.2Steve Wills2014-08-242-3/+3
* Remove indefinite articles and trailing periods from COMMENT, plusJimmy Olgeni2014-06-101-1/+1
* - Add stage supportSteve Wills2013-10-301-1/+0
* Add NO_STAGE all over the place in preparation for the staging support (cat: ...Baptiste Daroussin2013-09-211-5/+2
* - Update to 2.2.1Philip M. Gollucci2012-02-122-3/+3
* - github is redirecting all these to https nowPhilip M. Gollucci2010-11-111-1/+1
* - Update to 2.2.0Philip M. Gollucci2010-11-102-4/+3
* - Mass fixup of WWW: lines pkg-descr based on rubygems.org Homepage meta infoPhilip M. Gollucci2010-10-201-1/+1
* Move wen@FreeBSD.org -> ruby@FreeBSD.org for rubygem-*Philip M. Gollucci2010-08-271-1/+1
* RF -> RG Conversion (Part II)Philip M. Gollucci2010-06-241-1/+1
* - Update to 2.1.0Wen Heping2009-10-152-4/+4
* - Update to 1.1.0Wen Heping2009-09-302-5/+5
* - convert to RUBYGEM_AUTOPLISTPhilip M. Gollucci2009-04-091-8/+1