(meta map[string]interface{})
| 339 | } |
| 340 | |
| 341 | func GetAttachmentVersion(meta map[string]interface{}) (int, bool) { |
| 342 | ver, ok := meta["ver"] |
| 343 | if !ok { |
| 344 | return AttVersion1, true |
| 345 | } |
| 346 | val, ok := base.ToInt64(ver) |
| 347 | return int(val), ok |
| 348 | } |
| 349 | |
| 350 | // GenerateProofOfAttachment returns a nonce and proof for an attachment body. |
| 351 | func GenerateProofOfAttachment(ctx context.Context, attachmentData []byte) (nonce []byte, proof string, err error) { |