// PutElementsRaw stores given key-value pairs, with []byte values. See PutElements for a
// convenience function using string values
PutElementsRaw stores given key-value pairs, with []byte values. See PutElements for a
convenience function using string values
// PutElementsRaw stores given key - value pairs with [] byte values . See PutElements for a // convenience function using string values
func (ab *AlgorandBuffer) PutElementsRaw(ctx context.Context, data map[string][]byte) error {
	for k, v := range data {
		if len(k)+len(v) > 128 {
			return errors.New("kv pair cannot exceed 128 bytes")
		}
	}
	partitions := partitionMapByte(data, client.MaxKVArgs)
	for _, p := range partitions {
		kvArray := make([]models.TealKeyValue, 0, client.MaxKVArgs)
		for k, v := range p {
			tkv := models.TealKeyValue{Key: k, Value: models.TealValue{Bytes: string(v)}}
			kvArray = append(kvArray, tkv)
		}
		err := ab.Client.StoreGlobals(ab.AccountCrypt, ab.AppId, kvArray)
		if err != nil {
			return err
		}
	}
	return nil
}
func ( ab * AlgorandBuffer ) PutElementsRaw ( ctx context . Context , data map [ string ] [ ] byte ) error { for k , v := range data { if len ( k ) + len ( v ) > 128 { return errors . New ( " " ) } } partitions := partitionMapByte ( data , client . MaxKVArgs ) for _ , p := range partitions { kvArray := make ( [ ] models . TealKeyValue , 0 , client . MaxKVArgs ) for k , v := range p { tkv := models . TealKeyValue { Key : k , Value : models . TealValue { Bytes : string ( v ) } } kvArray = append ( kvArray , tkv ) } err := ab . Client . StoreGlobals ( ab . AccountCrypt , ab . AppId , kvArray ) if err != nil { return err } } return nil }
PutElementsRaw stores given key-value pairs, with []byte values.
PutElementsRaw stores given key - value pairs with [] byte values .
// if the number of kv pairs exceed client.MaxKVArgs, we need to split them up // into partitions. One txn for each partition